OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkSLCompiler.h" | 8 #include "SkSLCompiler.h" |
9 | 9 |
10 #include "Test.h" | 10 #include "Test.h" |
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 " switch (3) {\n" | 857 " switch (3) {\n" |
858 " case 0:\n" | 858 " case 0:\n" |
859 " x = 0.0;\n" | 859 " x = 0.0;\n" |
860 " case 1:\n" | 860 " case 1:\n" |
861 " x = 1.0;\n" | 861 " x = 1.0;\n" |
862 " }\n" | 862 " }\n" |
863 " sk_FragColor = vec4(x);\n" | 863 " sk_FragColor = vec4(x);\n" |
864 "}\n"); | 864 "}\n"); |
865 } | 865 } |
866 | 866 |
| 867 DEF_TEST(SkSLRectangleTexture, r) { |
| 868 test(r, |
| 869 "uniform sampler2D test;" |
| 870 "void main() {" |
| 871 " sk_FragColor = texture(test, vec2(1));" |
| 872 "}", |
| 873 *SkSL::ShaderCapsFactory::Default(), |
| 874 "#version 400\n" |
| 875 "out vec4 sk_FragColor;\n" |
| 876 "uniform sampler2D test;\n" |
| 877 "void main() {\n" |
| 878 " sk_FragColor = texture(test, vec2(1.0));\n" |
| 879 "}\n"); |
| 880 test(r, |
| 881 "uniform sampler2DRect test;" |
| 882 "void main() {" |
| 883 " sk_FragColor = texture(test, vec2(1));" |
| 884 "}", |
| 885 *SkSL::ShaderCapsFactory::Default(), |
| 886 "#version 400\n" |
| 887 "out vec4 sk_FragColor;\n" |
| 888 "uniform sampler2DRect test;\n" |
| 889 "void main() {\n" |
| 890 " sk_FragColor = texture(test, textureSize(test) * vec2(1.0));\n" |
| 891 "}\n"); |
| 892 test(r, |
| 893 "uniform sampler2DRect test;" |
| 894 "void main() {" |
| 895 " sk_FragColor = texture(test, vec3(1));" |
| 896 "}", |
| 897 *SkSL::ShaderCapsFactory::Default(), |
| 898 "#version 400\n" |
| 899 "out vec4 sk_FragColor;\n" |
| 900 "uniform sampler2DRect test;\n" |
| 901 "void main() {\n" |
| 902 " sk_FragColor = texture(test, vec3(textureSize(test), 1.0) * vec3(1
.0));\n" |
| 903 "}\n"); |
| 904 } |
| 905 |
867 #endif | 906 #endif |
OLD | NEW |