aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPaint.cpp
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2015-11-23 13:20:41 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-11-23 13:20:42 -0800
commitc4b72720e75313079212e69e46a5ef7c474b2305 (patch)
treeb0bf74db86503bd22684bb3107613db4e6625244 /src/gpu/GrPaint.cpp
parent60ce86d4718dab83f33488ec41710ad6763fc7f8 (diff)
Don't create a GXPFactory when blend is SrcOver
Diffstat (limited to 'src/gpu/GrPaint.cpp')
-rw-r--r--src/gpu/GrPaint.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gpu/GrPaint.cpp b/src/gpu/GrPaint.cpp
index 6f218a4b0b..1ec8e502be 100644
--- a/src/gpu/GrPaint.cpp
+++ b/src/gpu/GrPaint.cpp
@@ -50,7 +50,14 @@ bool GrPaint::isConstantBlendedColor(GrColor* color) const {
kRGBA_GrColorComponentFlags, false);
GrXPFactory::InvariantBlendedColor blendedColor;
- fXPFactory->getInvariantBlendedColor(colorProcInfo, &blendedColor);
+ if (fXPFactory) {
+ fXPFactory->getInvariantBlendedColor(colorProcInfo, &blendedColor);
+ } else {
+ GrPorterDuffXPFactory::SrcOverInvariantBlendedColor(colorProcInfo.color(),
+ colorProcInfo.validFlags(),
+ colorProcInfo.isOpaque(),
+ &blendedColor);
+ }
if (kRGBA_GrColorComponentFlags == blendedColor.fKnownColorFlags) {
*color = blendedColor.fKnownColor;