Permalink
Browse files

Avoid div by 0 in some video cards

  • Loading branch information...
1 parent cd44da9 commit 7f81f4fe4d2f20a0b96bab9645fb567115adee24 @achicu achicu committed Jun 20, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 Source/WebCore/platform/graphics/chromium/ShaderChromium.cpp
@@ -276,6 +276,8 @@ static String formulaForBlendMode(EBlendMode blendMode, EAlphaCompositingMode al
builder.append(
SHADER(
vec4 unmultiply(vec4 premultipliedSourceColor) {
+ if (premultipliedSourceColor.a == 0.0)
+ return vec4(1.0, 1.0, 1.0, 0.0);
return vec4(clamp(premultipliedSourceColor.rgb / premultipliedSourceColor.a, 0.0, 1.0), premultipliedSourceColor.a);
}
vec4 composite(float alphaA, float Fa, vec3 Ca,

0 comments on commit 7f81f4f

Please sign in to comment.