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

Side by Side Diff: src/gpu/GrPaint.cpp

Issue 649783003: Force input coverage to be only a byte in gpu shaders. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/GrDrawState.cpp ('k') | src/gpu/gl/GrGLProgram.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 /* 2 /*
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrPaint.h" 9 #include "GrPaint.h"
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 } 48 }
49 49
50 bool GrPaint::getOpaqueAndKnownColor(GrColor* solidColor, 50 bool GrPaint::getOpaqueAndKnownColor(GrColor* solidColor,
51 uint32_t* solidColorKnownComponents) const { 51 uint32_t* solidColorKnownComponents) const {
52 52
53 // TODO: Share this implementation with GrDrawState 53 // TODO: Share this implementation with GrDrawState
54 54
55 GrProcessor::InvariantOutput inout; 55 GrProcessor::InvariantOutput inout;
56 inout.fColor = GrColorPackRGBA(fCoverage, fCoverage, fCoverage, fCoverage); 56 inout.fColor = GrColorPackRGBA(fCoverage, fCoverage, fCoverage, fCoverage);
57 inout.fValidFlags = kRGBA_GrColorComponentFlags; 57 inout.fValidFlags = kRGBA_GrColorComponentFlags;
58 inout.fIsSingleComponent = false; 58 inout.fIsSingleComponent = true;
59 int count = fCoverageStages.count(); 59 int count = fCoverageStages.count();
60 for (int i = 0; i < count; ++i) { 60 for (int i = 0; i < count; ++i) {
61 fCoverageStages[i].getProcessor()->computeInvariantOutput(&inout); 61 fCoverageStages[i].getProcessor()->computeInvariantOutput(&inout);
62 } 62 }
63 if (!inout.isSolidWhite()) { 63 if (!inout.isSolidWhite()) {
64 return false; 64 return false;
65 } 65 }
66 66
67 inout.fColor = fColor; 67 inout.fColor = fColor;
68 inout.fValidFlags = kRGBA_GrColorComponentFlags; 68 inout.fValidFlags = kRGBA_GrColorComponentFlags;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 case kIConstA_GrBlendCoeff: 114 case kIConstA_GrBlendCoeff:
115 *solidColorKnownComponents = 0; 115 *solidColorKnownComponents = 0;
116 break; 116 break;
117 } 117 }
118 } else { 118 } else {
119 solidColorKnownComponents = 0; 119 solidColorKnownComponents = 0;
120 } 120 }
121 } 121 }
122 return opaque; 122 return opaque;
123 } 123 }
OLDNEW
« no previous file with comments | « src/gpu/GrDrawState.cpp ('k') | src/gpu/gl/GrGLProgram.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698