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

Side by Side Diff: src/gpu/SkGr.cpp

Issue 1471053002: Don't create a GXPFactory when blend is SrcOver (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix compile Created 5 years, 1 month 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/GrYUVProvider.cpp ('k') | src/gpu/batches/GrDefaultPathRenderer.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 2010 Google Inc. 2 * Copyright 2010 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 8
9 #include "SkGr.h" 9 #include "SkGr.h"
10 10
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 if (cfFP) { 482 if (cfFP) {
483 grPaint->addColorFragmentProcessor(cfFP); 483 grPaint->addColorFragmentProcessor(cfFP);
484 } else { 484 } else {
485 return false; 485 return false;
486 } 486 }
487 } 487 }
488 } 488 }
489 489
490 SkXfermode* mode = skPaint.getXfermode(); 490 SkXfermode* mode = skPaint.getXfermode();
491 GrXPFactory* xpFactory = nullptr; 491 GrXPFactory* xpFactory = nullptr;
492 if (!SkXfermode::AsXPFactory(mode, &xpFactory)) { 492 SkXfermode::AsXPFactory(mode, &xpFactory);
493 // Fall back to src-over 493 SkSafeUnref(grPaint->setXPFactory(xpFactory));
494 // return false here?
495 xpFactory = GrPorterDuffXPFactory::Create(SkXfermode::kSrcOver_Mode);
496 }
497 SkASSERT(xpFactory);
498 grPaint->setXPFactory(xpFactory)->unref();
499 494
500 #ifndef SK_IGNORE_GPU_DITHER 495 #ifndef SK_IGNORE_GPU_DITHER
501 if (skPaint.isDither() && grPaint->numColorFragmentProcessors() > 0) { 496 if (skPaint.isDither() && grPaint->numColorFragmentProcessors() > 0) {
502 grPaint->addColorFragmentProcessor(GrDitherEffect::Create())->unref(); 497 grPaint->addColorFragmentProcessor(GrDitherEffect::Create())->unref();
503 } 498 }
504 #endif 499 #endif
505 return true; 500 return true;
506 } 501 }
507 502
508 bool SkPaintToGrPaint(GrContext* context, const SkPaint& skPaint, const SkMatrix & viewM, 503 bool SkPaintToGrPaint(GrContext* context, const SkPaint& skPaint, const SkMatrix & viewM,
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 SkErrorInternals::SetError( kInvalidPaint_SkError, 627 SkErrorInternals::SetError( kInvalidPaint_SkError,
633 "Sorry, I don't understand the filtering " 628 "Sorry, I don't understand the filtering "
634 "mode you asked for. Falling back to " 629 "mode you asked for. Falling back to "
635 "MIPMaps."); 630 "MIPMaps.");
636 textureFilterMode = GrTextureParams::kMipMap_FilterMode; 631 textureFilterMode = GrTextureParams::kMipMap_FilterMode;
637 break; 632 break;
638 633
639 } 634 }
640 return textureFilterMode; 635 return textureFilterMode;
641 } 636 }
OLDNEW
« no previous file with comments | « src/gpu/GrYUVProvider.cpp ('k') | src/gpu/batches/GrDefaultPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698