aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar wangyix <wangyix@google.com>2015-09-01 07:56:14 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-01 07:56:14 -0700
commitaeb77eaff8549704bd27e0f47ad43267350ff067 (patch)
treeadf04be4f8bd23861f5ef07581e98ab7adce82d9 /src/gpu
parent2dc29940c54b5d21c81dade8a7755dd08316b6b3 (diff)
GrGLBlend::AppendPorterDuffBlend now supports kClear_Mode
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/gl/GrGLBlend.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gpu/gl/GrGLBlend.cpp b/src/gpu/gl/GrGLBlend.cpp
index 0f73fbdbdb..4179ec0b53 100644
--- a/src/gpu/gl/GrGLBlend.cpp
+++ b/src/gpu/gl/GrGLBlend.cpp
@@ -58,12 +58,13 @@ void GrGLBlend::AppendPorterDuffBlend(GrGLFragmentBuilder* fsBuilder, const char
SkXfermode::Coeff srcCoeff, dstCoeff;
SkXfermode::ModeAsCoeff(mode, &srcCoeff, &dstCoeff);
- fsBuilder->codeAppendf("%s =", outColor);
+ fsBuilder->codeAppendf("%s = ", outColor);
// append src blend
bool didAppend = append_porterduff_term(fsBuilder, srcCoeff, srcColor, srcColor, dstColor,
false);
// append dst blend
- SkAssertResult(append_porterduff_term(fsBuilder, dstCoeff, dstColor, srcColor, dstColor,
- didAppend));
+ if(!append_porterduff_term(fsBuilder, dstCoeff, dstColor, srcColor, dstColor, didAppend)) {
+ fsBuilder->codeAppend("vec4(0, 0, 0, 0)");
+ }
fsBuilder->codeAppend(";");
}