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

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

Issue 735363003: dstCopy on optdrawstate (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 1 month 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/GrGLProgramDesc.h ('k') | src/gpu/gl/GrGpuGL.h » ('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 "GrGLProcessor.h" 9 #include "GrGLProcessor.h"
10 #include "GrBackendProcessorFactory.h" 10 #include "GrBackendProcessorFactory.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 offsetAndSize[0] = SkToU16(processorOffset); 197 offsetAndSize[0] = SkToU16(processorOffset);
198 offsetAndSize[1] = processorKeySize; 198 offsetAndSize[1] = processorKeySize;
199 ++(*offsetAndSizeIndex); 199 ++(*offsetAndSizeIndex);
200 return true; 200 return true;
201 } 201 }
202 202
203 bool GrGLProgramDescBuilder::Build(const GrOptDrawState& optState, 203 bool GrGLProgramDescBuilder::Build(const GrOptDrawState& optState,
204 const GrProgramDesc::DescInfo& descInfo, 204 const GrProgramDesc::DescInfo& descInfo,
205 GrGpu::DrawType drawType, 205 GrGpu::DrawType drawType,
206 GrGpuGL* gpu, 206 GrGpuGL* gpu,
207 const GrDeviceCoordTexture* dstCopy,
208 GrProgramDesc* desc) { 207 GrProgramDesc* desc) {
209 bool inputColorIsUsed = descInfo.fInputColorIsUsed; 208 bool inputColorIsUsed = descInfo.fInputColorIsUsed;
210 bool inputCoverageIsUsed = descInfo.fInputCoverageIsUsed; 209 bool inputCoverageIsUsed = descInfo.fInputCoverageIsUsed;
211 210
212 // The descriptor is used as a cache key. Thus when a field of the 211 // The descriptor is used as a cache key. Thus when a field of the
213 // descriptor will not affect program generation (because of the attribute 212 // descriptor will not affect program generation (because of the attribute
214 // bindings in use or other descriptor field settings) it should be set 213 // bindings in use or other descriptor field settings) it should be set
215 // to a canonical value to avoid duplicate programs with different keys. 214 // to a canonical value to avoid duplicate programs with different keys.
216 215
217 bool requiresLocalCoordAttrib = descInfo.fRequiresLocalCoordAttrib; 216 bool requiresLocalCoordAttrib = descInfo.fRequiresLocalCoordAttrib;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 if (covIsSolidWhite || !inputCoverageIsUsed) { 286 if (covIsSolidWhite || !inputCoverageIsUsed) {
288 header->fCoverageInput = GrProgramDesc::kAllOnes_ColorInput; 287 header->fCoverageInput = GrProgramDesc::kAllOnes_ColorInput;
289 } else if (hasUniformCoverage) { 288 } else if (hasUniformCoverage) {
290 header->fCoverageInput = GrProgramDesc::kUniform_ColorInput; 289 header->fCoverageInput = GrProgramDesc::kUniform_ColorInput;
291 } else { 290 } else {
292 header->fCoverageInput = GrProgramDesc::kAttribute_ColorInput; 291 header->fCoverageInput = GrProgramDesc::kAttribute_ColorInput;
293 SkASSERT(!header->fUseNvpr); 292 SkASSERT(!header->fUseNvpr);
294 } 293 }
295 294
296 if (descInfo.fReadsDst) { 295 if (descInfo.fReadsDst) {
296 const GrDeviceCoordTexture* dstCopy = optState.getDstCopy();
297 SkASSERT(dstCopy || gpu->caps()->dstReadInShaderSupport()); 297 SkASSERT(dstCopy || gpu->caps()->dstReadInShaderSupport());
298 const GrTexture* dstCopyTexture = NULL; 298 const GrTexture* dstCopyTexture = NULL;
299 if (dstCopy) { 299 if (dstCopy) {
300 dstCopyTexture = dstCopy->texture(); 300 dstCopyTexture = dstCopy->texture();
301 } 301 }
302 header->fDstReadKey = GrGLFragmentShaderBuilder::KeyForDstRead(dstCopyTe xture, 302 header->fDstReadKey = GrGLFragmentShaderBuilder::KeyForDstRead(dstCopyTe xture,
303 gpu->glCa ps()); 303 gpu->glCa ps());
304 SkASSERT(0 != header->fDstReadKey); 304 SkASSERT(0 != header->fDstReadKey);
305 } else { 305 } else {
306 header->fDstReadKey = 0; 306 header->fDstReadKey = 0;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 } 340 }
341 341
342 header->fPrimaryOutputType = descInfo.fPrimaryOutputType; 342 header->fPrimaryOutputType = descInfo.fPrimaryOutputType;
343 header->fSecondaryOutputType = descInfo.fSecondaryOutputType; 343 header->fSecondaryOutputType = descInfo.fSecondaryOutputType;
344 344
345 header->fColorEffectCnt = optState.numColorStages(); 345 header->fColorEffectCnt = optState.numColorStages();
346 header->fCoverageEffectCnt = optState.numCoverageStages(); 346 header->fCoverageEffectCnt = optState.numCoverageStages();
347 desc->finalize(); 347 desc->finalize();
348 return true; 348 return true;
349 } 349 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.h ('k') | src/gpu/gl/GrGpuGL.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698