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

Side by Side Diff: src/effects/SkArithmeticMode_gpu.cpp

Issue 1316513002: Change SkShader;asFragmentProcessor signature to no longer take skpaint\grcolor* (Closed) Base URL: https://skia.googlesource.com/skia.git@things
Patch Set: Address comments, fix roll(?) Created 5 years, 3 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/effects/SkAlphaThresholdFilter.cpp ('k') | src/effects/SkBlurMaskFilter.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 "SkArithmeticMode_gpu.h" 8 #include "SkArithmeticMode_gpu.h"
9 9
10 #if SK_SUPPORT_GPU 10 #if SK_SUPPORT_GPU
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 fEnforcePMColor == fp.fEnforcePMColor; 130 fEnforcePMColor == fp.fEnforcePMColor;
131 } 131 }
132 132
133 void GrArithmeticFP::onComputeInvariantOutput(GrInvariantOutput* inout) const { 133 void GrArithmeticFP::onComputeInvariantOutput(GrInvariantOutput* inout) const {
134 // TODO: optimize this 134 // TODO: optimize this
135 inout->setToUnknown(GrInvariantOutput::kWill_ReadInput); 135 inout->setToUnknown(GrInvariantOutput::kWill_ReadInput);
136 } 136 }
137 137
138 /////////////////////////////////////////////////////////////////////////////// 138 ///////////////////////////////////////////////////////////////////////////////
139 139
140 GrFragmentProcessor* GrArithmeticFP::TestCreate(GrProcessorTestData* d) { 140 const GrFragmentProcessor* GrArithmeticFP::TestCreate(GrProcessorTestData* d) {
141 float k1 = d->fRandom->nextF(); 141 float k1 = d->fRandom->nextF();
142 float k2 = d->fRandom->nextF(); 142 float k2 = d->fRandom->nextF();
143 float k3 = d->fRandom->nextF(); 143 float k3 = d->fRandom->nextF();
144 float k4 = d->fRandom->nextF(); 144 float k4 = d->fRandom->nextF();
145 bool enforcePMColor = d->fRandom->nextBool(); 145 bool enforcePMColor = d->fRandom->nextBool();
146 146
147 return new GrArithmeticFP(d->fProcDataManager, k1, k2, k3, k4, enforcePMColo r, d->fTextures[0]); 147 return new GrArithmeticFP(d->fProcDataManager, k1, k2, k3, k4, enforcePMColo r, d->fTextures[0]);
148 } 148 }
149 149
150 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrArithmeticFP); 150 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrArithmeticFP);
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 blendedColor->fWillBlendWithDst = true; 288 blendedColor->fWillBlendWithDst = true;
289 289
290 // TODO: We could try to optimize this more. For example if fK1 and fK3 are zero, then we won't 290 // TODO: We could try to optimize this more. For example if fK1 and fK3 are zero, then we won't
291 // be blending the color with dst at all so we can know what the output colo r is (up to the 291 // be blending the color with dst at all so we can know what the output colo r is (up to the
292 // valid color components passed in). 292 // valid color components passed in).
293 blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags; 293 blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags;
294 } 294 }
295 295
296 GR_DEFINE_XP_FACTORY_TEST(GrArithmeticXPFactory); 296 GR_DEFINE_XP_FACTORY_TEST(GrArithmeticXPFactory);
297 297
298 GrXPFactory* GrArithmeticXPFactory::TestCreate(GrProcessorTestData* d) { 298 const GrXPFactory* GrArithmeticXPFactory::TestCreate(GrProcessorTestData* d) {
299 float k1 = d->fRandom->nextF(); 299 float k1 = d->fRandom->nextF();
300 float k2 = d->fRandom->nextF(); 300 float k2 = d->fRandom->nextF();
301 float k3 = d->fRandom->nextF(); 301 float k3 = d->fRandom->nextF();
302 float k4 = d->fRandom->nextF(); 302 float k4 = d->fRandom->nextF();
303 bool enforcePMColor = d->fRandom->nextBool(); 303 bool enforcePMColor = d->fRandom->nextBool();
304 304
305 return GrArithmeticXPFactory::Create(k1, k2, k3, k4, enforcePMColor); 305 return GrArithmeticXPFactory::Create(k1, k2, k3, k4, enforcePMColor);
306 } 306 }
307 307
308 #endif 308 #endif
OLDNEW
« no previous file with comments | « src/effects/SkAlphaThresholdFilter.cpp ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698