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

Side by Side Diff: src/gpu/effects/GrConstColorProcessor.cpp

Issue 1213383005: Rework GrPipelineInfo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fixed Created 5 years, 5 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/GrTestBatch.h ('k') | src/gpu/effects/GrCustomXfermode.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 2015 Google Inc. 2 * Copyright 2015 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 "effects/GrConstColorProcessor.h" 8 #include "effects/GrConstColorProcessor.h"
9 #include "gl/GrGLProcessor.h" 9 #include "gl/GrGLProcessor.h"
10 #include "gl/builders/GrGLProgramBuilder.h" 10 #include "gl/builders/GrGLProgramBuilder.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 GrGLProgramDataManager::UniformHandle fColorUniform; 59 GrGLProgramDataManager::UniformHandle fColorUniform;
60 GrColor fPrevColor; 60 GrColor fPrevColor;
61 61
62 typedef GrGLFragmentProcessor INHERITED; 62 typedef GrGLFragmentProcessor INHERITED;
63 }; 63 };
64 64
65 /////////////////////////////////////////////////////////////////////////////// 65 ///////////////////////////////////////////////////////////////////////////////
66 66
67 void GrConstColorProcessor::onComputeInvariantOutput(GrInvariantOutput* inout) c onst { 67 void GrConstColorProcessor::onComputeInvariantOutput(GrInvariantOutput* inout) c onst {
68 if (kIgnore_InputMode == fMode) { 68 if (kIgnore_InputMode == fMode) {
69 inout->setToOther(kRGBA_GrColorComponentFlags, fColor, GrInvariantOutput ::kWill_ReadInput); 69 inout->setToOther(kRGBA_GrColorComponentFlags, fColor,
70 GrInvariantOutput::kWillNot_ReadInput);
70 } else { 71 } else {
71 GrColor r = GrColorUnpackR(fColor); 72 GrColor r = GrColorUnpackR(fColor);
72 bool colorIsSingleChannel = r == GrColorUnpackG(fColor) && r == GrColorU npackB(fColor) && 73 bool colorIsSingleChannel = r == GrColorUnpackG(fColor) && r == GrColorU npackB(fColor) &&
73 r == GrColorUnpackA(fColor); 74 r == GrColorUnpackA(fColor);
74 if (kModulateRGBA_InputMode == fMode) { 75 if (kModulateRGBA_InputMode == fMode) {
75 if (colorIsSingleChannel) { 76 if (colorIsSingleChannel) {
76 inout->mulByKnownSingleComponent(r); 77 inout->mulByKnownSingleComponent(r);
77 } else { 78 } else {
78 inout->mulByKnownFourComponents(fColor); 79 inout->mulByKnownFourComponents(fColor);
79 } 80 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 color = 0; 124 color = 0;
124 break; 125 break;
125 case 2: 126 case 2:
126 color = random->nextULessThan(0x100); 127 color = random->nextULessThan(0x100);
127 color = color | (color << 8) | (color << 16) | (color << 24); 128 color = color | (color << 8) | (color << 16) | (color << 24);
128 break; 129 break;
129 } 130 }
130 InputMode mode = static_cast<InputMode>(random->nextULessThan(kInputModeCnt) ); 131 InputMode mode = static_cast<InputMode>(random->nextULessThan(kInputModeCnt) );
131 return GrConstColorProcessor::Create(color, mode); 132 return GrConstColorProcessor::Create(color, mode);
132 } 133 }
OLDNEW
« no previous file with comments | « src/gpu/GrTestBatch.h ('k') | src/gpu/effects/GrCustomXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698