DescriptionExpress (GLSL expression, possibly known value) pairs as a class
Express (GLSL expression, possibly known value) pairs as a class
instead of two variables Introduces GrGLSLExpr<N> to encapsulate
the expression and possibly constant-folded value of the expression.
This simplifies passing of the expressions to functions.
Changes the shaders with following patterns:
{ // Stage 0: Linear Gradient
vec4 colorTemp = mix(uGradientStartColor_Stage0, uGradientEndColor_Stage0, clamp(vMatrixCoord_Stage0.x, 0.0, 1
colorTemp.rgb *= colorTemp.a;
- output_Stage0 = vec4((vColor) * (colorTemp));
+ output_Stage0 = (vColor * colorTemp);
+ }
Previously the vector cast was always added if constant folding was
effective, regardless of the term dimensions. Now the vector upcast is
not inserted in places where it is not needed, ie. when the binary
operator term is of the target dimension.
Also, some parentheses can be omitted. It is assumed that
GrGLSLExpr<N>("string") constructors construct a simple expression or
parenthesized expression.
Otherwise the shader code remains identical.
Committed: http://code.google.com/p/skia/source/detail?r=11690
Patch Set 1 #Patch Set 2 : for review #Patch Set 3 : clarify commit msg #Patch Set 4 : rebase #
Total comments: 28
Patch Set 5 : address most comments #Patch Set 6 : rebase #Patch Set 7 : rebase #Patch Set 8 : rebase #
Total comments: 11
Patch Set 9 : addressing comments #
Total comments: 2
Patch Set 10 : addressing review comments #
Messages
Total messages: 10 (0 generated)
|