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

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

Issue 914003003: Use dst copies in porter duffer XP to correctly render certain blends. (Closed) Base URL: https://skia.googlesource.com/skia.git@prePDDstCopy
Patch Set: Rebase Created 5 years, 10 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/GrXferProcessor.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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 297
298 /////////////////////////////////////////////////////////////////////////////// 298 ///////////////////////////////////////////////////////////////////////////////
299 299
300 GrArithmeticXPFactory::GrArithmeticXPFactory(float k1, float k2, float k3, float k4, 300 GrArithmeticXPFactory::GrArithmeticXPFactory(float k1, float k2, float k3, float k4,
301 bool enforcePMColor) 301 bool enforcePMColor)
302 : fK1(k1), fK2(k2), fK3(k3), fK4(k4), fEnforcePMColor(enforcePMColor) { 302 : fK1(k1), fK2(k2), fK3(k3), fK4(k4), fEnforcePMColor(enforcePMColor) {
303 this->initClassID<GrArithmeticXPFactory>(); 303 this->initClassID<GrArithmeticXPFactory>();
304 } 304 }
305 305
306 GrXferProcessor* 306 GrXferProcessor*
307 GrArithmeticXPFactory::onCreateXferProcessor(const GrProcOptInfo& colorPOI, 307 GrArithmeticXPFactory::onCreateXferProcessor(const GrDrawTargetCaps& caps,
308 const GrProcOptInfo& colorPOI,
308 const GrProcOptInfo& coveragePOI, 309 const GrProcOptInfo& coveragePOI,
309 const GrDeviceCoordTexture* dstCopy ) const { 310 const GrDeviceCoordTexture* dstCopy ) const {
310 return ArithmeticXP::Create(fK1, fK2, fK3, fK4, fEnforcePMColor, dstCopy, 311 return ArithmeticXP::Create(fK1, fK2, fK3, fK4, fEnforcePMColor, dstCopy,
311 this->willReadDstColor(colorPOI, coveragePOI)); 312 this->willReadDstColor(caps, colorPOI, coverageP OI));
312 } 313 }
313 314
314 315
315 void GrArithmeticXPFactory::getInvariantOutput(const GrProcOptInfo& colorPOI, 316 void GrArithmeticXPFactory::getInvariantOutput(const GrProcOptInfo& colorPOI,
316 const GrProcOptInfo& coveragePOI, 317 const GrProcOptInfo& coveragePOI,
317 GrXPFactory::InvariantOutput* out put) const { 318 GrXPFactory::InvariantOutput* out put) const {
318 output->fWillBlendWithDst = true; 319 output->fWillBlendWithDst = true;
319 320
320 // TODO: We could try to optimize this more. For example if we have solid co verage and fK1 and 321 // TODO: We could try to optimize this more. For example if we have solid co verage and fK1 and
321 // fK3 are zero, then we won't be blending the color with dst at all so we c an know what the 322 // fK3 are zero, then we won't be blending the color with dst at all so we c an know what the
(...skipping 10 matching lines...) Expand all
332 float k1 = random->nextF(); 333 float k1 = random->nextF();
333 float k2 = random->nextF(); 334 float k2 = random->nextF();
334 float k3 = random->nextF(); 335 float k3 = random->nextF();
335 float k4 = random->nextF(); 336 float k4 = random->nextF();
336 bool enforcePMColor = random->nextBool(); 337 bool enforcePMColor = random->nextBool();
337 338
338 return GrArithmeticXPFactory::Create(k1, k2, k3, k4, enforcePMColor); 339 return GrArithmeticXPFactory::Create(k1, k2, k3, k4, enforcePMColor);
339 } 340 }
340 341
341 #endif 342 #endif
OLDNEW
« no previous file with comments | « src/effects/SkArithmeticMode_gpu.h ('k') | src/gpu/GrXferProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698