OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |