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

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

Issue 1161273005: Update XPF invariant info to not account for conflation (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_reenablebea
Patch Set: rebase Created 5 years, 6 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/SkArithmeticMode_gpu.h ('k') | src/gpu/GrDrawContext.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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 GrXferProcessor* 299 GrXferProcessor*
300 GrArithmeticXPFactory::onCreateXferProcessor(const GrCaps& caps, 300 GrArithmeticXPFactory::onCreateXferProcessor(const GrCaps& caps,
301 const GrProcOptInfo& colorPOI, 301 const GrProcOptInfo& colorPOI,
302 const GrProcOptInfo& coveragePOI, 302 const GrProcOptInfo& coveragePOI,
303 const DstTexture* dstTexture) const { 303 const DstTexture* dstTexture) const {
304 return ArithmeticXP::Create(fK1, fK2, fK3, fK4, fEnforcePMColor, dstTexture, 304 return ArithmeticXP::Create(fK1, fK2, fK3, fK4, fEnforcePMColor, dstTexture,
305 this->willReadDstColor(caps, colorPOI, coverageP OI)); 305 this->willReadDstColor(caps, colorPOI, coverageP OI));
306 } 306 }
307 307
308 308
309 void GrArithmeticXPFactory::getInvariantOutput(const GrProcOptInfo& colorPOI, 309 void GrArithmeticXPFactory::getInvariantBlendedColor(const GrProcOptInfo& colorP OI,
310 const GrProcOptInfo& coveragePOI, 310 InvariantBlendedColor* blen dedColor) const {
311 GrXPFactory::InvariantOutput* out put) const { 311 blendedColor->fWillBlendWithDst = true;
312 output->fWillBlendWithDst = true;
313 312
314 // TODO: We could try to optimize this more. For example if we have solid co verage and fK1 and 313 // TODO: We could try to optimize this more. For example if fK1 and fK3 are zero, then we won't
315 // fK3 are zero, then we won't be blending the color with dst at all so we c an know what the 314 // be blending the color with dst at all so we can know what the output colo r is (up to the
316 // output color is (up to the valid color components passed in). 315 // valid color components passed in).
317 output->fBlendedColorFlags = 0; 316 blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags;
318 } 317 }
319 318
320 GR_DEFINE_XP_FACTORY_TEST(GrArithmeticXPFactory); 319 GR_DEFINE_XP_FACTORY_TEST(GrArithmeticXPFactory);
321 320
322 GrXPFactory* GrArithmeticXPFactory::TestCreate(SkRandom* random, 321 GrXPFactory* GrArithmeticXPFactory::TestCreate(SkRandom* random,
323 GrContext*, 322 GrContext*,
324 const GrCaps&, 323 const GrCaps&,
325 GrTexture*[]) { 324 GrTexture*[]) {
326 float k1 = random->nextF(); 325 float k1 = random->nextF();
327 float k2 = random->nextF(); 326 float k2 = random->nextF();
328 float k3 = random->nextF(); 327 float k3 = random->nextF();
329 float k4 = random->nextF(); 328 float k4 = random->nextF();
330 bool enforcePMColor = random->nextBool(); 329 bool enforcePMColor = random->nextBool();
331 330
332 return GrArithmeticXPFactory::Create(k1, k2, k3, k4, enforcePMColor); 331 return GrArithmeticXPFactory::Create(k1, k2, k3, k4, enforcePMColor);
333 } 332 }
334 333
335 #endif 334 #endif
OLDNEW
« no previous file with comments | « src/effects/SkArithmeticMode_gpu.h ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698