fixed type error in RTAdjust application

Bug: skia:
Change-Id: I94ba5853812659920bba781ae983fc9fbb647f9c
Reviewed-on: https://skia-review.googlesource.com/95082
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This commit is contained in:
Ethan Nicholas 2018-01-16 16:37:58 -05:00 committed by Skia Commit-Bot
parent 2ac5868f4a
commit 9d8abc5816
2 changed files with 6 additions and 5 deletions

View File

@ -629,7 +629,7 @@ std::unique_ptr<Statement> IRGenerator::getNormalizeSkPositionCode() {
children.push_back(OP(OP(SWIZZLE(POS, 1), Token::STAR, SWIZZLE(ADJUST, 2)),
Token::PLUS,
OP(SWIZZLE(POS, 3), Token::STAR, SWIZZLE(ADJUST, 3))));
children.push_back(std::unique_ptr<Expression>(new IntLiteral(fContext, -1, 0)));
children.push_back(std::unique_ptr<Expression>(new FloatLiteral(fContext, -1, 0.0)));
children.push_back(SWIZZLE(POS, 3));
std::unique_ptr<Expression> result = OP(POS, Token::EQ,
std::unique_ptr<Expression>(new Constructor(-1,

View File

@ -1081,7 +1081,8 @@ DEF_TEST(SkSLFragCoord, r) {
"void main() {\n"
" sk_FragCoord_Workaround = (gl_Position = pos);\n"
" gl_Position = vec4(gl_Position.x * sk_RTAdjust.x + gl_Position.w * sk_RTAdjust.y, "
"gl_Position.y * sk_RTAdjust.z + gl_Position.w * sk_RTAdjust.w, 0, gl_Position.w);\n"
"gl_Position.y * sk_RTAdjust.z + gl_Position.w * sk_RTAdjust.w, 0.0, "
"gl_Position.w);\n"
"}\n",
SkSL::Program::kVertex_Kind);
@ -1760,7 +1761,7 @@ DEF_TEST(SkSLNormalization, r) {
" gl_Position = vec4(1.0);\n"
" gl_Position = vec4(gl_Position.x * sk_RTAdjust.x + gl_Position.w * sk_RTAdjust.y, "
"gl_Position.y * sk_RTAdjust.z + gl_Position.w * sk_RTAdjust.w, "
"0, "
"0.0, "
"gl_Position.w);\n"
"}\n",
SkSL::Program::kVertex_Kind);
@ -1787,14 +1788,14 @@ DEF_TEST(SkSLNormalization, r) {
" {\n"
" gl_Position = vec4(gl_Position.x * sk_RTAdjust.x + gl_Position.w * "
"sk_RTAdjust.y, gl_Position.y * sk_RTAdjust.z + gl_Position.w * "
"sk_RTAdjust.w, 0, gl_Position.w);\n"
"sk_RTAdjust.w, 0.0, gl_Position.w);\n"
" EmitVertex();\n"
" }\n"
" gl_Position = gl_in[0].gl_Position + vec4(0.5, 0.0, 0.0, float(gl_InvocationID));\n"
" {\n"
" gl_Position = vec4(gl_Position.x * sk_RTAdjust.x + gl_Position.w * "
"sk_RTAdjust.y, gl_Position.y * sk_RTAdjust.z + gl_Position.w * "
"sk_RTAdjust.w, 0, gl_Position.w);\n"
"sk_RTAdjust.w, 0.0, gl_Position.w);\n"
" EmitVertex();\n"
" }\n"
" EndPrimitive();\n"