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

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

Issue 852203003: Add Xfer Processor for GrCustomXfermodes (Closed) Base URL: https://skia.googlesource.com/skia.git@xferMover
Patch Set: Fix build Created 5 years, 11 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/core/SkXfermode_proccoeff.h ('k') | src/gpu/GrProcessor.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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 GrColor* overrideColo r, 231 GrColor* overrideColo r,
232 const GrDrawTargetCap s& caps) { 232 const GrDrawTargetCap s& caps) {
233 return GrXferProcessor::kNone_Opt; 233 return GrXferProcessor::kNone_Opt;
234 } 234 }
235 235
236 /////////////////////////////////////////////////////////////////////////////// 236 ///////////////////////////////////////////////////////////////////////////////
237 237
238 GrArithmeticXPFactory::GrArithmeticXPFactory(float k1, float k2, float k3, float k4, 238 GrArithmeticXPFactory::GrArithmeticXPFactory(float k1, float k2, float k3, float k4,
239 bool enforcePMColor) 239 bool enforcePMColor)
240 : fK1(k1), fK2(k2), fK3(k3), fK4(k4), fEnforcePMColor(enforcePMColor) { 240 : fK1(k1), fK2(k2), fK3(k3), fK4(k4), fEnforcePMColor(enforcePMColor) {
241 this->initClassID<GrArithmeticXPFactory>(); 241 this->initClassID<GrArithmeticXPFactory>();
242 } 242 }
243 243
244 void GrArithmeticXPFactory::getInvariantOutput(const GrProcOptInfo& colorPOI, 244 void GrArithmeticXPFactory::getInvariantOutput(const GrProcOptInfo& colorPOI,
245 const GrProcOptInfo& coveragePOI, 245 const GrProcOptInfo& coveragePOI,
246 GrXPFactory::InvariantOutput* out put) const { 246 GrXPFactory::InvariantOutput* out put) const {
247 output->fWillBlendWithDst = true; 247 output->fWillBlendWithDst = true;
248 248
249 // TODO: We could try to optimize this more. For example if we have solid co verage and fK1 and 249 // TODO: We could try to optimize this more. For example if we have solid co verage and fK1 and
250 // fK3 are zero, then we won't be blending the color with dst at all so we c an know what the 250 // fK3 are zero, then we won't be blending the color with dst at all so we c an know what the
251 // output color is (up to the valid color components passed in). 251 // output color is (up to the valid color components passed in).
252 output->fBlendedColorFlags = 0; 252 output->fBlendedColorFlags = 0;
253 } 253 }
254 254
255 GR_DEFINE_XP_FACTORY_TEST(GrArithmeticXPFactory); 255 GR_DEFINE_XP_FACTORY_TEST(GrArithmeticXPFactory);
256 256
257 GrXPFactory* GrArithmeticXPFactory::TestCreate(SkRandom* random, 257 GrXPFactory* GrArithmeticXPFactory::TestCreate(SkRandom* random,
258 GrContext*, 258 GrContext*,
259 const GrDrawTargetCaps&, 259 const GrDrawTargetCaps&,
260 GrTexture*[]) { 260 GrTexture*[]) {
261 float k1 = random->nextF(); 261 float k1 = random->nextF();
262 float k2 = random->nextF(); 262 float k2 = random->nextF();
263 float k3 = random->nextF(); 263 float k3 = random->nextF();
264 float k4 = random->nextF(); 264 float k4 = random->nextF();
265 bool enforcePMColor = random->nextBool(); 265 bool enforcePMColor = random->nextBool();
266 266
267 return GrArithmeticXPFactory::Create(k1, k2, k3, k4, enforcePMColor); 267 return GrArithmeticXPFactory::Create(k1, k2, k3, k4, enforcePMColor);
268 } 268 }
269 269
270 #endif 270 #endif
OLDNEW
« no previous file with comments | « src/core/SkXfermode_proccoeff.h ('k') | src/gpu/GrProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698