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

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

Issue 1110033004: Make XPFragmentBuilder only Builder with access to DstCopy. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLPrimitiveProcessor.cpp ('k') | src/gpu/gl/builders/GrGLFragmentShaderBuilder.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 2014 Google Inc. 2 * Copyright 2014 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 7
8 #include "gl/GrGLXferProcessor.h" 8 #include "gl/GrGLXferProcessor.h"
9 9
10 #include "GrXferProcessor.h" 10 #include "GrXferProcessor.h"
11 #include "gl/builders/GrGLFragmentShaderBuilder.h" 11 #include "gl/builders/GrGLFragmentShaderBuilder.h"
12 #include "gl/builders/GrGLProgramBuilder.h" 12 #include "gl/builders/GrGLProgramBuilder.h"
13 13
14 void GrGLXferProcessor::emitCode(const EmitArgs& args) { 14 void GrGLXferProcessor::emitCode(const EmitArgs& args) {
15 if (args.fXP.getDstCopyTexture()) { 15 if (args.fXP.getDstCopyTexture()) {
16 bool topDown = kTopLeft_GrSurfaceOrigin == args.fXP.getDstCopyTexture()- >origin(); 16 bool topDown = kTopLeft_GrSurfaceOrigin == args.fXP.getDstCopyTexture()- >origin();
17 17
18 GrGLFPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder(); 18 GrGLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
19 19
20 // We don't think any shaders actually output negative coverage, but jus t as a safety check 20 // We don't think any shaders actually output negative coverage, but jus t as a safety check
21 // for floating point precision errors we compare with <= here 21 // for floating point precision errors we compare with <= here
22 fsBuilder->codeAppendf("if (all(lessThanEqual(%s, vec4(0)))) {" 22 fsBuilder->codeAppendf("if (all(lessThanEqual(%s, vec4(0)))) {"
23 " discard;" 23 " discard;"
24 "}", args.fInputCoverage); 24 "}", args.fInputCoverage);
25 const char* dstColor = fsBuilder->dstColor(); 25 const char* dstColor = fsBuilder->dstColor();
26 26
27 const char* dstCopyTopLeftName; 27 const char* dstCopyTopLeftName;
28 const char* dstCopyCoordScaleName; 28 const char* dstCopyCoordScaleName;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } else { 65 } else {
66 SkASSERT(!fDstCopyScaleUni.isValid()); 66 SkASSERT(!fDstCopyScaleUni.isValid());
67 } 67 }
68 } else { 68 } else {
69 SkASSERT(!fDstCopyTopLeftUni.isValid()); 69 SkASSERT(!fDstCopyTopLeftUni.isValid());
70 SkASSERT(!fDstCopyScaleUni.isValid()); 70 SkASSERT(!fDstCopyScaleUni.isValid());
71 } 71 }
72 this->onSetData(pdm, xp); 72 this->onSetData(pdm, xp);
73 } 73 }
74 74
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLPrimitiveProcessor.cpp ('k') | src/gpu/gl/builders/GrGLFragmentShaderBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698