Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Unified Diff: src/gpu/gl/GrGLProgramDesc.cpp

Issue 1576023002: Make readback of alpha channel work for RGBA. (Closed) Base URL: https://skia.googlesource.com/skia.git@swiz
Patch Set: more Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | src/gpu/gl/builders/GrGLProgramBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLProgramDesc.cpp
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp
index 032562550cec5d5541f5405f77fcb861e8b046ed..31eeffac4e9566af1785592d81a8d4dd2721ef37 100644
--- a/src/gpu/gl/GrGLProgramDesc.cpp
+++ b/src/gpu/gl/GrGLProgramDesc.cpp
@@ -42,7 +42,7 @@ static void add_texture_key(GrProcessorKeyBuilder* b, const GrProcessor& proc,
* function because it is hairy, though FPs do not have attribs, and GPs do not have transforms
*/
static bool gen_meta_key(const GrProcessor& proc,
- const GrGLCaps& caps,
+ const GrGLSLCaps& glslCaps,
uint32_t transformKey,
GrProcessorKeyBuilder* b) {
size_t processorKeySize = b->size();
@@ -54,7 +54,7 @@ static bool gen_meta_key(const GrProcessor& proc,
return false;
}
- add_texture_key(b, proc, *caps.glslCaps());
+ add_texture_key(b, proc, glslCaps);
uint32_t* key = b->add32n(2);
key[0] = (classID << 16) | SkToU32(processorKeySize);
@@ -75,7 +75,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 gen_meta_key(fp, *caps.glslCaps(), primProc.getTransformKey(fp.coordTransforms(),
fp.numTransformsExclChildren()), b);
}
@@ -83,6 +83,8 @@ bool GrGLProgramDescBuilder::Build(GrProgramDesc* desc,
const GrPrimitiveProcessor& primProc,
const GrPipeline& pipeline,
const GrGLGpu* gpu) {
+ const GrGLSLCaps& glslCaps = *gpu->glCaps().glslCaps();
+
// The descriptor is used as a cache key. Thus when a field of the
// descriptor will not affect program generation (because of the attribute
// bindings in use or other descriptor field settings) it should be set
@@ -97,9 +99,8 @@ bool GrGLProgramDescBuilder::Build(GrProgramDesc* desc,
GrProcessorKeyBuilder b(&glDesc->key());
- primProc.getGLSLProcessorKey(*gpu->glCaps().glslCaps(), &b);
- //**** use glslCaps here?
- if (!gen_meta_key(primProc, gpu->glCaps(), 0, &b)) {
+ primProc.getGLSLProcessorKey(glslCaps, &b);
+ if (!gen_meta_key(primProc, glslCaps, 0, &b)) {
glDesc->key().reset();
return false;
}
@@ -115,7 +116,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 (!gen_meta_key(xp, glslCaps, 0, &b)) {
glDesc->key().reset();
return false;
}
@@ -128,6 +129,9 @@ bool GrGLProgramDescBuilder::Build(GrProgramDesc* desc,
// make sure any padding in the header is zeroed.
memset(header, 0, kHeaderSize);
+ header->fOutputSwizzle =
+ glslCaps.configOutputSwizzle(pipeline.getRenderTarget()->config()).asKey();
+
if (pipeline.readsFragPosition()) {
header->fFragPosKey =
GrGLSLFragmentShaderBuilder::KeyForFragmentPosition(pipeline.getRenderTarget());
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | src/gpu/gl/builders/GrGLProgramBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698