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

Side by Side Diff: src/core/SkXfermode.cpp

Issue 1471053002: Don't create a GXPFactory when blend is SrcOver (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkXfermode.h" 9 #include "SkXfermode.h"
10 #include "SkXfermode_proccoeff.h" 10 #include "SkXfermode_proccoeff.h"
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 } 657 }
658 658
659 bool SkXfermode::asXPFactory(GrXPFactory**) const { 659 bool SkXfermode::asXPFactory(GrXPFactory**) const {
660 return false; 660 return false;
661 } 661 }
662 662
663 663
664 #if SK_SUPPORT_GPU 664 #if SK_SUPPORT_GPU
665 #include "effects/GrPorterDuffXferProcessor.h" 665 #include "effects/GrPorterDuffXferProcessor.h"
666 666
667 bool SkXfermode::AsXPFactory(SkXfermode* xfermode, GrXPFactory** xpf) { 667 bool SkXfermode::AsXPFactory(SkXfermode* xfermode, GrXPFactory** xpf) {
bsalomon 2015/11/23 20:19:52 should we inline the top part of this function in
egdaniel 2015/11/23 20:49:04 Done.
668 if (nullptr == xfermode) { 668 if (nullptr == xfermode) {
669 if (xpf) { 669 if (xpf) {
670 *xpf = GrPorterDuffXPFactory::Create(kSrcOver_Mode); 670 *xpf = nullptr;
671 } 671 }
672 return true; 672 return true;
673 } else { 673 } else {
674 return xfermode->asXPFactory(xpf); 674 return xfermode->asXPFactory(xpf);
675 } 675 }
676 } 676 }
677 #else 677 #else
678 bool SkXfermode::AsXPFactory(SkXfermode* xfermode, GrXPFactory** xpf) { 678 bool SkXfermode::AsXPFactory(SkXfermode* xfermode, GrXPFactory** xpf) {
679 return false; 679 return false;
680 } 680 }
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 if (!xfer) { 1083 if (!xfer) {
1084 return SkXfermode::kOpaque_SrcColorOpacity == opacityType; 1084 return SkXfermode::kOpaque_SrcColorOpacity == opacityType;
1085 } 1085 }
1086 1086
1087 return xfer->isOpaque(opacityType); 1087 return xfer->isOpaque(opacityType);
1088 } 1088 }
1089 1089
1090 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode) 1090 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode)
1091 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode) 1091 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode)
1092 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1092 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698