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

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

Issue 1455273006: Make specialized SrcOver XPFactory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/GrProcessor.cpp ('k') | src/gpu/effects/GrCustomXfermode.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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 colorFilter->asFragmentProcessor(context)); 481 colorFilter->asFragmentProcessor(context));
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 const GrXPFactory* xpFactory = nullptr;
492 if (!SkXfermode::AsXPFactory(mode, &xpFactory)) { 492 if (!SkXfermode::AsXPFactory(mode, &xpFactory)) {
493 // Fall back to src-over 493 // Fall back to src-over
494 // return false here? 494 // return false here?
495 xpFactory = GrPorterDuffXPFactory::Create(SkXfermode::kSrcOver_Mode); 495 xpFactory = GrPorterDuffXPFactory::Create(SkXfermode::kSrcOver_Mode);
496 } 496 }
497 SkASSERT(xpFactory); 497 SkASSERT(xpFactory);
498 grPaint->setXPFactory(xpFactory)->unref(); 498 grPaint->setXPFactory(xpFactory)->unref();
499 499
500 #ifndef SK_IGNORE_GPU_DITHER 500 #ifndef SK_IGNORE_GPU_DITHER
501 if (skPaint.isDither() && grPaint->numColorFragmentProcessors() > 0) { 501 if (skPaint.isDither() && grPaint->numColorFragmentProcessors() > 0) {
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 SkErrorInternals::SetError( kInvalidPaint_SkError, 632 SkErrorInternals::SetError( kInvalidPaint_SkError,
633 "Sorry, I don't understand the filtering " 633 "Sorry, I don't understand the filtering "
634 "mode you asked for. Falling back to " 634 "mode you asked for. Falling back to "
635 "MIPMaps."); 635 "MIPMaps.");
636 textureFilterMode = GrTextureParams::kMipMap_FilterMode; 636 textureFilterMode = GrTextureParams::kMipMap_FilterMode;
637 break; 637 break;
638 638
639 } 639 }
640 return textureFilterMode; 640 return textureFilterMode;
641 } 641 }
OLDNEW
« no previous file with comments | « src/gpu/GrProcessor.cpp ('k') | src/gpu/effects/GrCustomXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698