diff options
author | bsalomon <bsalomon@google.com> | 2015-11-20 20:24:31 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-20 20:24:31 -0800 |
commit | 0315dbcb554fe7f5fa80a81079fd8d2e61fc20e1 (patch) | |
tree | e8aca2e2b4437baf79c8a85ddc9bc2ce659ac734 /src/gpu/gl/GrGLProgramDesc.cpp | |
parent | 27a048700778d4cebfc23301d1780649791b0e03 (diff) |
Revert of Initial version of external_oes texture support and unit test (patchset #14 id:260001 of https://codereview.chromium.org/1451683002/ )
Reason for revert:
Error wrapping external texture in GrTexture on some devices.
Original issue's description:
> Initial version of external_oes texture support and unit test
>
> Committed: https://skia.googlesource.com/skia/+/27a048700778d4cebfc23301d1780649791b0e03
TBR=joshualitt@google.com,egdaniel@google.com,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/1459323004
Diffstat (limited to 'src/gpu/gl/GrGLProgramDesc.cpp')
-rw-r--r-- | src/gpu/gl/GrGLProgramDesc.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp index a1646618e8..172aca77ab 100644 --- a/src/gpu/gl/GrGLProgramDesc.cpp +++ b/src/gpu/gl/GrGLProgramDesc.cpp @@ -31,16 +31,11 @@ static bool swizzle_requires_alpha_remapping(const GrGLSLCaps& caps, GrPixelConf static uint32_t gen_texture_key(const GrProcessor& proc, const GrGLCaps& caps) { uint32_t key = 0; int numTextures = proc.numTextures(); - int shift = 0; for (int t = 0; t < numTextures; ++t) { const GrTextureAccess& access = proc.textureAccess(t); if (swizzle_requires_alpha_remapping(*caps.glslCaps(), access.getTexture()->config())) { - key |= 1 << shift; + key |= 1 << t; } - if (GR_GL_TEXTURE_EXTERNAL == static_cast<GrGLTexture*>(access.getTexture())->target()) { - key |= 2 << shift; - } - shift += 2; } return key; } @@ -53,8 +48,10 @@ static uint32_t gen_texture_key(const GrProcessor& proc, const GrGLCaps& caps) { * which must be different for every GrProcessor subclass. It can fail if an effect uses too many * textures, transforms, etc, for the space allotted in the meta-key. NOTE, both FPs and GPs share * this function because it is hairy, though FPs do not have attribs, and GPs do not have transforms + * + * TODO: A better name for this function would be "compute" instead of "get". */ -static bool gen_meta_key(const GrProcessor& proc, +static bool get_meta_key(const GrProcessor& proc, const GrGLCaps& caps, uint32_t transformKey, GrProcessorKeyBuilder* b) { @@ -78,12 +75,15 @@ static bool gen_meta_key(const GrProcessor& proc, return true; } -static bool gen_frag_proc_and_meta_keys(const GrPrimitiveProcessor& primProc, +/* + * TODO: A better name for this function would be "compute" instead of "get". + */ +static bool get_frag_proc_and_meta_keys(const GrPrimitiveProcessor& primProc, const GrFragmentProcessor& fp, const GrGLCaps& caps, GrProcessorKeyBuilder* b) { for (int i = 0; i < fp.numChildProcessors(); ++i) { - if (!gen_frag_proc_and_meta_keys(primProc, fp.childProcessor(i), caps, b)) { + if (!get_frag_proc_and_meta_keys(primProc, fp.childProcessor(i), caps, b)) { return false; } } @@ -91,7 +91,7 @@ static bool gen_frag_proc_and_meta_keys(const GrPrimitiveProcessor& primProc, fp.getGLSLProcessorKey(*caps.glslCaps(), b); //**** use glslCaps here? - return gen_meta_key(fp, caps, primProc.getTransformKey(fp.coordTransforms(), + return get_meta_key(fp, caps, primProc.getTransformKey(fp.coordTransforms(), fp.numTransformsExclChildren()), b); } @@ -115,14 +115,14 @@ bool GrGLProgramDescBuilder::Build(GrProgramDesc* desc, primProc.getGLSLProcessorKey(*gpu->glCaps().glslCaps(), &b); //**** use glslCaps here? - if (!gen_meta_key(primProc, gpu->glCaps(), 0, &b)) { + if (!get_meta_key(primProc, gpu->glCaps(), 0, &b)) { glDesc->key().reset(); return false; } for (int i = 0; i < pipeline.numFragmentProcessors(); ++i) { const GrFragmentProcessor& fp = pipeline.getFragmentProcessor(i); - if (!gen_frag_proc_and_meta_keys(primProc, fp, gpu->glCaps(), &b)) { + if (!get_frag_proc_and_meta_keys(primProc, fp, gpu->glCaps(), &b)) { glDesc->key().reset(); return false; } @@ -131,7 +131,7 @@ bool GrGLProgramDescBuilder::Build(GrProgramDesc* desc, const GrXferProcessor& xp = *pipeline.getXferProcessor(); xp.getGLSLProcessorKey(*gpu->glCaps().glslCaps(), &b); //**** use glslCaps here? - if (!gen_meta_key(xp, gpu->glCaps(), 0, &b)) { + if (!get_meta_key(xp, gpu->glCaps(), 0, &b)) { glDesc->key().reset(); return false; } |