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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
482 SkAutoTUnref<const GrFragmentProcessor> cfFP( | 482 SkAutoTUnref<const GrFragmentProcessor> cfFP( |
483 colorFilter->asFragmentProcessor(context)); | 483 colorFilter->asFragmentProcessor(context)); |
484 if (cfFP) { | 484 if (cfFP) { |
485 grPaint->addColorFragmentProcessor(cfFP); | 485 grPaint->addColorFragmentProcessor(cfFP); |
486 } else { | 486 } else { |
487 return false; | 487 return false; |
488 } | 488 } |
489 } | 489 } |
490 } | 490 } |
491 | 491 |
492 SkXfermode* mode = skPaint.getXfermode(); | 492 SkXfermode* xfermode = skPaint.getXfermode(); |
493 GrXPFactory* xpFactory = nullptr; | 493 if (xfermode) { |
egdaniel
2016/02/08 15:32:11
This is the check for srcOver right? So that we ke
robertphillips
2016/02/08 15:54:53
Done.
| |
494 SkXfermode::AsXPFactory(mode, &xpFactory); | 494 grPaint->setXPFactory(xfermode->asXPFactory())->unref(); |
495 SkSafeUnref(grPaint->setXPFactory(xpFactory)); | 495 } |
496 | 496 |
497 #ifndef SK_IGNORE_GPU_DITHER | 497 #ifndef SK_IGNORE_GPU_DITHER |
498 if (skPaint.isDither() && grPaint->numColorFragmentProcessors() > 0) { | 498 if (skPaint.isDither() && grPaint->numColorFragmentProcessors() > 0) { |
499 grPaint->addColorFragmentProcessor(GrDitherEffect::Create())->unref(); | 499 grPaint->addColorFragmentProcessor(GrDitherEffect::Create())->unref(); |
500 } | 500 } |
501 #endif | 501 #endif |
502 return true; | 502 return true; |
503 } | 503 } |
504 | 504 |
505 bool SkPaintToGrPaint(GrContext* context, const SkPaint& skPaint, const SkMatrix & viewM, | 505 bool SkPaintToGrPaint(GrContext* context, const SkPaint& skPaint, const SkMatrix & viewM, |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
629 SkErrorInternals::SetError( kInvalidPaint_SkError, | 629 SkErrorInternals::SetError( kInvalidPaint_SkError, |
630 "Sorry, I don't understand the filtering " | 630 "Sorry, I don't understand the filtering " |
631 "mode you asked for. Falling back to " | 631 "mode you asked for. Falling back to " |
632 "MIPMaps."); | 632 "MIPMaps."); |
633 textureFilterMode = GrTextureParams::kMipMap_FilterMode; | 633 textureFilterMode = GrTextureParams::kMipMap_FilterMode; |
634 break; | 634 break; |
635 | 635 |
636 } | 636 } |
637 return textureFilterMode; | 637 return textureFilterMode; |
638 } | 638 } |
OLD | NEW |