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

Side by Side Diff: src/gpu/gl/GrGLProgramDesc.cpp

Issue 1530713002: make alpha read back of bgra/rgba work (Closed) Base URL: https://skia.googlesource.com/skia.git@align
Patch Set: cleanup Created 5 years 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "GrGLProgramDesc.h" 7 #include "GrGLProgramDesc.h"
8 8
9 #include "GrProcessor.h" 9 #include "GrProcessor.h"
10 #include "GrGLGpu.h" 10 #include "GrGLGpu.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 135
136 // --------DO NOT MOVE HEADER ABOVE THIS LINE------------------------------- ------------------- 136 // --------DO NOT MOVE HEADER ABOVE THIS LINE------------------------------- -------------------
137 // Because header is a pointer into the dynamic array, we can't push any new data into the key 137 // Because header is a pointer into the dynamic array, we can't push any new data into the key
138 // below here. 138 // below here.
139 KeyHeader* header = glDesc->atOffset<KeyHeader, kHeaderOffset>(); 139 KeyHeader* header = glDesc->atOffset<KeyHeader, kHeaderOffset>();
140 140
141 // make sure any padding in the header is zeroed. 141 // make sure any padding in the header is zeroed.
142 memset(header, 0, kHeaderSize); 142 memset(header, 0, kHeaderSize);
143 143
144 header->fSwapDstRedAndAlpha = false;
145 if (GrPixelConfigIsAlphaOnly(pipeline.getRenderTarget()->config()) &&
146 gpu->glCaps().textureRedSupport()) {
147 header->fSwapDstRedAndAlpha = true;
148 }
149
144 if (pipeline.readsFragPosition()) { 150 if (pipeline.readsFragPosition()) {
145 header->fFragPosKey = 151 header->fFragPosKey =
146 GrGLSLFragmentShaderBuilder::KeyForFragmentPosition(pipeline.get RenderTarget()); 152 GrGLSLFragmentShaderBuilder::KeyForFragmentPosition(pipeline.get RenderTarget());
147 } else { 153 } else {
148 header->fFragPosKey = 0; 154 header->fFragPosKey = 0;
149 } 155 }
150 156
151 if (pipeline.ignoresCoverage()) { 157 if (pipeline.ignoresCoverage()) {
152 header->fIgnoresCoverage = 1; 158 header->fIgnoresCoverage = 1;
153 } else { 159 } else {
154 header->fIgnoresCoverage = 0; 160 header->fIgnoresCoverage = 0;
155 } 161 }
156 162
157 header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters(); 163 header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters();
158 header->fColorEffectCnt = pipeline.numColorFragmentProcessors(); 164 header->fColorEffectCnt = pipeline.numColorFragmentProcessors();
159 header->fCoverageEffectCnt = pipeline.numCoverageFragmentProcessors(); 165 header->fCoverageEffectCnt = pipeline.numCoverageFragmentProcessors();
160 glDesc->finalize(); 166 glDesc->finalize();
161 return true; 167 return true;
162 } 168 }
OLDNEW
« 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