aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2017-02-09 17:01:22 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-13 14:49:09 +0000
commit3865711259e25a90a1d72480f848863ada202067 (patch)
tree4fc40848238f7d38123fa19032513751923e6bea /tests
parentb34727f1a3150de2e3e95beb79900a0a848a984c (diff)
Replaced all calls to fragmentPosition() with sk_FragCoord
Change-Id: I2ed4558aea74b3ae7ee11dfe4736cdbcb16ae49e Reviewed-on: https://skia-review.googlesource.com/8278 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/ImageStorageTest.cpp4
-rw-r--r--tests/SkSLErrorTest.cpp9
2 files changed, 10 insertions, 3 deletions
diff --git a/tests/ImageStorageTest.cpp b/tests/ImageStorageTest.cpp
index 20c9713745..aa34831d1e 100644
--- a/tests/ImageStorageTest.cpp
+++ b/tests/ImageStorageTest.cpp
@@ -31,7 +31,6 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageStorageLoad, reporter, ctxInfo) {
: INHERITED(kNone_OptimizationFlags)
, fImageStorageAccess(std::move(texture), kRead_GrIOType, mm, restrict) {
this->initClassID<TestFP>();
- this->setWillReadFragmentPosition();
this->addImageStorageAccess(&fImageStorageAccess);
}
@@ -51,8 +50,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageStorageLoad, reporter, ctxInfo) {
const TestFP& tfp = args.fFp.cast<TestFP>();
GrGLSLFPFragmentBuilder* fb = args.fFragBuilder;
SkString imageLoadStr;
- fb->codeAppendf("highp vec2 coord = %s.xy;",
- args.fFragBuilder->fragmentPosition());
+ fb->codeAppend("highp vec2 coord = sk_FragCoord.xy;");
fb->appendImageStorageLoad(&imageLoadStr, args.fImageStorages[0],
"ivec2(coord)");
if (GrPixelConfigIsSint(tfp.fImageStorageAccess.texture()->config())) {
diff --git a/tests/SkSLErrorTest.cpp b/tests/SkSLErrorTest.cpp
index 9c34ab41fb..301281c28e 100644
--- a/tests/SkSLErrorTest.cpp
+++ b/tests/SkSLErrorTest.cpp
@@ -421,4 +421,13 @@ DEF_TEST(SkSLDivByZero, r) {
"error: 1: division by zero\n1 error\n");
}
+DEF_TEST(SkSLUnsupportedGLSLIdentifiers, r) {
+ test_failure(r,
+ "void main() { float x = gl_FragCoord.x; };",
+ "error: 1: unknown identifier 'gl_FragCoord'\n1 error\n");
+ test_failure(r,
+ "void main() { float r = gl_FragColor.r; };",
+ "error: 1: unknown identifier 'gl_FragColor'\n1 error\n");
+}
+
#endif