Skip to content
This repository has been archived by the owner on Jun 16, 2018. It is now read-only.

Commit

Permalink
Avoid div by 0 in some video cards
Browse files Browse the repository at this point in the history
  • Loading branch information
achicu committed Jun 20, 2012
1 parent cd44da9 commit 7f81f4f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/WebCore/platform/graphics/chromium/ShaderChromium.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7f81f4f

Please sign in to comment.