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

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

Issue 1109863004: Use GLSLCaps for creating processor keys and GLSL-specific programs (Closed) Base URL: https://chromium.googlesource.com/skia@master
Patch Set: Created 5 years, 8 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/effects/GrConfigConversionEffect.cpp ('k') | src/gpu/effects/GrConvexPolyEffect.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 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/GrGLSL.h" 10 #include "gl/GrGLSL.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } else { 81 } else {
82 if (colorIsSingleChannel) { 82 if (colorIsSingleChannel) {
83 inout->mulAlphaByKnownSingleComponent(r); 83 inout->mulAlphaByKnownSingleComponent(r);
84 } else { 84 } else {
85 inout->mulAlphaByKnownFourComponents(fColor); 85 inout->mulAlphaByKnownFourComponents(fColor);
86 } 86 }
87 } 87 }
88 } 88 }
89 } 89 }
90 90
91 void GrConstColorProcessor::getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBui lder* b) const { 91 void GrConstColorProcessor::getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyB uilder* b) const {
92 b->add32(fMode); 92 b->add32(fMode);
93 } 93 }
94 94
95 GrGLFragmentProcessor* GrConstColorProcessor::createGLInstance() const { 95 GrGLFragmentProcessor* GrConstColorProcessor::createGLInstance() const {
96 return SkNEW(GLConstColorProcessor); 96 return SkNEW(GLConstColorProcessor);
97 } 97 }
98 98
99 bool GrConstColorProcessor::onIsEqual(const GrFragmentProcessor& other) const { 99 bool GrConstColorProcessor::onIsEqual(const GrFragmentProcessor& other) const {
100 const GrConstColorProcessor& that = other.cast<GrConstColorProcessor>(); 100 const GrConstColorProcessor& that = other.cast<GrConstColorProcessor>();
101 return fMode == that.fMode && fColor == that.fColor; 101 return fMode == that.fMode && fColor == that.fColor;
(...skipping 22 matching lines...) Expand all
124 color = 0; 124 color = 0;
125 break; 125 break;
126 case 2: 126 case 2:
127 color = random->nextULessThan(0x100); 127 color = random->nextULessThan(0x100);
128 color = color | (color << 8) | (color << 16) | (color << 24); 128 color = color | (color << 8) | (color << 16) | (color << 24);
129 break; 129 break;
130 } 130 }
131 InputMode mode = static_cast<InputMode>(random->nextULessThan(kInputModeCnt) ); 131 InputMode mode = static_cast<InputMode>(random->nextULessThan(kInputModeCnt) );
132 return GrConstColorProcessor::Create(color, mode); 132 return GrConstColorProcessor::Create(color, mode);
133 } 133 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrConfigConversionEffect.cpp ('k') | src/gpu/effects/GrConvexPolyEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698