Brian Osman | 088913a | 2019-12-19 15:44:56 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019 Google LLC |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 8 | #include "include/core/SkBitmap.h" |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 9 | #include "include/core/SkCanvas.h" |
Brian Osman | 92aac1e | 2020-08-05 16:48:58 -0400 | [diff] [blame] | 10 | #include "include/core/SkColorFilter.h" |
Brian Osman | 269b21c | 2020-08-06 12:15:53 -0400 | [diff] [blame] | 11 | #include "include/core/SkData.h" |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 12 | #include "include/core/SkPaint.h" |
| 13 | #include "include/core/SkSurface.h" |
Brian Osman | ee426f2 | 2020-01-02 11:55:24 -0500 | [diff] [blame] | 14 | #include "include/effects/SkRuntimeEffect.h" |
Robert Phillips | 6d344c3 | 2020-07-06 10:56:46 -0400 | [diff] [blame] | 15 | #include "include/gpu/GrDirectContext.h" |
Brian Osman | d9bde07 | 2020-04-15 14:18:13 -0400 | [diff] [blame] | 16 | #include "src/core/SkTLazy.h" |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 17 | #include "src/gpu/GrColor.h" |
Brian Osman | 088913a | 2019-12-19 15:44:56 -0500 | [diff] [blame] | 18 | #include "tests/Test.h" |
| 19 | |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 20 | #include <algorithm> |
| 21 | |
Brian Osman | 5f6b41e | 2020-03-09 11:53:24 -0400 | [diff] [blame] | 22 | DEF_TEST(SkRuntimeEffectInvalid, r) { |
| 23 | auto test = [r](const char* hdr, const char* body, const char* expected) { |
| 24 | SkString src = SkStringPrintf("%s void main(float2 p, inout half4 color) { %s }", |
| 25 | hdr, body); |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 26 | auto[effect, errorText] = SkRuntimeEffect::Make(src); |
Brian Osman | 088913a | 2019-12-19 15:44:56 -0500 | [diff] [blame] | 27 | REPORTER_ASSERT(r, !effect); |
| 28 | REPORTER_ASSERT(r, errorText.contains(expected), |
| 29 | "Expected error message to contain \"%s\". Actual message: \"%s\"", |
| 30 | expected, errorText.c_str()); |
| 31 | }; |
| 32 | |
| 33 | // Features that are only allowed in .fp files (key, in uniform, ctype, when, tracked). |
| 34 | // Ensure that these fail, and the error messages contain the relevant keyword. |
Brian Osman | 5f6b41e | 2020-03-09 11:53:24 -0400 | [diff] [blame] | 35 | test("layout(key) in bool Input;", "", "key"); |
| 36 | test("in uniform float Input;", "", "in uniform"); |
| 37 | test("layout(ctype=SkRect) float4 Input;", "", "ctype"); |
| 38 | test("in bool Flag; layout(when=Flag) uniform float Input;", "", "when"); |
| 39 | test("layout(tracked) uniform float Input;", "", "tracked"); |
Brian Osman | 088913a | 2019-12-19 15:44:56 -0500 | [diff] [blame] | 40 | |
Brian Osman | 82d4970 | 2019-12-30 13:44:01 -0500 | [diff] [blame] | 41 | // Runtime SkSL supports a limited set of uniform types. No samplers, for example: |
Brian Osman | 5f6b41e | 2020-03-09 11:53:24 -0400 | [diff] [blame] | 42 | test("uniform sampler2D s;", "", "sampler2D"); |
Brian Osman | 088913a | 2019-12-19 15:44:56 -0500 | [diff] [blame] | 43 | |
Brian Osman | 82d4970 | 2019-12-30 13:44:01 -0500 | [diff] [blame] | 44 | // 'in' variables can't be arrays |
Brian Osman | 5f6b41e | 2020-03-09 11:53:24 -0400 | [diff] [blame] | 45 | test("in int Input[2];", "", "array"); |
Brian Osman | 8783b78 | 2020-01-06 11:13:45 -0500 | [diff] [blame] | 46 | |
| 47 | // Type specific restrictions: |
| 48 | |
| 49 | // 'bool', 'int' can't be 'uniform' |
Brian Osman | 5f6b41e | 2020-03-09 11:53:24 -0400 | [diff] [blame] | 50 | test("uniform bool Input;", "", "'uniform'"); |
| 51 | test("uniform int Input;", "", "'uniform'"); |
Brian Osman | 8783b78 | 2020-01-06 11:13:45 -0500 | [diff] [blame] | 52 | |
| 53 | // vector and matrix types can't be 'in' |
Brian Osman | 5f6b41e | 2020-03-09 11:53:24 -0400 | [diff] [blame] | 54 | test("in float2 Input;", "", "'in'"); |
| 55 | test("in half3x3 Input;", "", "'in'"); |
| 56 | |
Brian Osman | e64ae86 | 2020-07-16 15:29:15 -0400 | [diff] [blame] | 57 | // 'marker' is only permitted on 'uniform' variables |
| 58 | test("layout(marker=local_to_world) in float4x4 localToWorld;", "", "'uniform'"); |
| 59 | // 'marker' is only permitted on float4x4 variables |
| 60 | test("layout(marker=local_to_world) uniform float3x3 localToWorld;", "", "float4x4"); |
| 61 | |
Brian Osman | 5f6b41e | 2020-03-09 11:53:24 -0400 | [diff] [blame] | 62 | test("half missing();", "color.r = missing();", "undefined function"); |
Brian Osman | 182c92e | 2020-07-20 15:18:33 -0400 | [diff] [blame] | 63 | |
| 64 | // Shouldn't be possible to create an SkRuntimeEffect without "main" |
| 65 | test("//", "", "main"); |
Brian Osman | 8232900 | 2020-07-21 09:39:27 -0400 | [diff] [blame] | 66 | |
| 67 | // Various places that shaders (fragmentProcessors) should not be allowed |
| 68 | test("", |
| 69 | "shader child;", |
| 70 | "must be global"); |
| 71 | test("in shader child; half4 helper(shader fp) { return sample(fp); }", |
| 72 | "color = helper(child);", |
| 73 | "parameter"); |
| 74 | test("in shader child; shader get_child() { return child; }", |
| 75 | "color = sample(get_child());", |
| 76 | "return"); |
| 77 | test("in shader child;", |
| 78 | "color = sample(shader(child));", |
| 79 | "construct"); |
| 80 | test("in shader child1; in shader child2;", |
| 81 | "color = sample(p.x > 10 ? child1 : child2);", |
| 82 | "expression"); |
Brian Osman | 088913a | 2019-12-19 15:44:56 -0500 | [diff] [blame] | 83 | } |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 84 | |
Brian Osman | 92aac1e | 2020-08-05 16:48:58 -0400 | [diff] [blame] | 85 | DEF_TEST(SkRuntimeEffectInvalidColorFilters, r) { |
| 86 | auto test = [r](const char* sksl) { |
| 87 | auto [effect, errorText] = SkRuntimeEffect::Make(SkString(sksl)); |
| 88 | REPORTER_ASSERT(r, effect); |
Brian Osman | 269b21c | 2020-08-06 12:15:53 -0400 | [diff] [blame] | 89 | |
| 90 | sk_sp<SkData> inputs = SkData::MakeUninitialized(effect->inputSize()); |
| 91 | |
| 92 | REPORTER_ASSERT(r, effect->makeShader(inputs, nullptr, 0, nullptr, false)); |
| 93 | REPORTER_ASSERT(r, !effect->makeColorFilter(inputs)); |
Brian Osman | 92aac1e | 2020-08-05 16:48:58 -0400 | [diff] [blame] | 94 | }; |
| 95 | |
| 96 | // Runtime effects that use sample coords or sk_FragCoord are valid shaders, |
| 97 | // but not valid color filters |
| 98 | test("void main(float2 p, inout half4 color) { color.rg = half2(p); }"); |
| 99 | test("void main(float2 p, inout half4 color) { color.rg = half2(sk_FragCoord.xy); }"); |
Brian Osman | 269b21c | 2020-08-06 12:15:53 -0400 | [diff] [blame] | 100 | |
| 101 | // We also can't use layout(marker), which would give the runtime color filter CTM information |
| 102 | test("layout(marker=ctm) uniform float4x4 ctm;" |
| 103 | "void main(float2 p, inout half4 color) { color.r = half(ctm[0][0]); }"); |
Brian Osman | 92aac1e | 2020-08-05 16:48:58 -0400 | [diff] [blame] | 104 | } |
| 105 | |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 106 | class TestEffect { |
| 107 | public: |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 108 | TestEffect(skiatest::Reporter* r, sk_sp<SkSurface> surface) |
| 109 | : fReporter(r), fSurface(std::move(surface)) {} |
| 110 | |
| 111 | void build(const char* header, const char* body) { |
Brian Osman | 7353dc5 | 2020-02-07 13:37:12 -0500 | [diff] [blame] | 112 | SkString src = SkStringPrintf("%s void main(float2 p, inout half4 color) { %s }", |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 113 | header, body); |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 114 | auto[effect, errorText] = SkRuntimeEffect::Make(src); |
| 115 | if (!effect) { |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 116 | REPORT_FAILURE(fReporter, "effect", |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 117 | SkStringPrintf("Effect didn't compile: %s", errorText.c_str())); |
| 118 | return; |
| 119 | } |
Brian Osman | d9bde07 | 2020-04-15 14:18:13 -0400 | [diff] [blame] | 120 | fBuilder.init(std::move(effect)); |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 121 | } |
| 122 | |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 123 | SkRuntimeShaderBuilder::BuilderInput input(const char* name) { |
Brian Osman | d9bde07 | 2020-04-15 14:18:13 -0400 | [diff] [blame] | 124 | return fBuilder->input(name); |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 125 | } |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 126 | SkRuntimeShaderBuilder::BuilderChild child(const char* name) { |
| 127 | return fBuilder->child(name); |
| 128 | } |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 129 | |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 130 | using PreTestFn = std::function<void(SkCanvas*, SkPaint*)>; |
| 131 | |
| 132 | void test(GrColor TL, GrColor TR, GrColor BL, GrColor BR, |
| 133 | PreTestFn preTestCallback = nullptr) { |
Brian Osman | d9bde07 | 2020-04-15 14:18:13 -0400 | [diff] [blame] | 134 | auto shader = fBuilder->makeShader(nullptr, false); |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 135 | if (!shader) { |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 136 | REPORT_FAILURE(fReporter, "shader", SkString("Effect didn't produce a shader")); |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 137 | return; |
| 138 | } |
| 139 | |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 140 | SkCanvas* canvas = fSurface->getCanvas(); |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 141 | SkPaint paint; |
| 142 | paint.setShader(std::move(shader)); |
| 143 | paint.setBlendMode(SkBlendMode::kSrc); |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 144 | |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 145 | canvas->save(); |
| 146 | if (preTestCallback) { |
| 147 | preTestCallback(canvas, &paint); |
| 148 | } |
| 149 | canvas->drawPaint(paint); |
| 150 | canvas->restore(); |
| 151 | |
| 152 | GrColor actual[4]; |
| 153 | SkImageInfo info = fSurface->imageInfo(); |
| 154 | if (!fSurface->readPixels(info, actual, info.minRowBytes(), 0, 0)) { |
| 155 | REPORT_FAILURE(fReporter, "readPixels", SkString("readPixels failed")); |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 156 | return; |
| 157 | } |
| 158 | |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 159 | GrColor expected[4] = {TL, TR, BL, BR}; |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 160 | if (memcmp(actual, expected, sizeof(actual)) != 0) { |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 161 | REPORT_FAILURE(fReporter, "Runtime effect didn't match expectations", |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 162 | SkStringPrintf("\n" |
| 163 | "Expected: [ %08x %08x %08x %08x ]\n" |
| 164 | "Got : [ %08x %08x %08x %08x ]\n" |
| 165 | "SkSL:\n%s\n", |
| 166 | TL, TR, BL, BR, actual[0], actual[1], actual[2], |
Brian Osman | d9bde07 | 2020-04-15 14:18:13 -0400 | [diff] [blame] | 167 | actual[3], fBuilder->fEffect->source().c_str())); |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 168 | } |
| 169 | } |
| 170 | |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 171 | void test(GrColor expected, PreTestFn preTestCallback = nullptr) { |
| 172 | this->test(expected, expected, expected, expected, preTestCallback); |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 173 | } |
| 174 | |
| 175 | private: |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 176 | skiatest::Reporter* fReporter; |
| 177 | sk_sp<SkSurface> fSurface; |
Brian Osman | d9bde07 | 2020-04-15 14:18:13 -0400 | [diff] [blame] | 178 | SkTLazy<SkRuntimeShaderBuilder> fBuilder; |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 179 | }; |
| 180 | |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 181 | // Produces a 2x2 bitmap shader, with opaque colors: |
| 182 | // [ Red, Green ] |
| 183 | // [ Blue, White ] |
| 184 | static sk_sp<SkShader> make_RGBW_shader() { |
| 185 | SkBitmap bmp; |
| 186 | bmp.allocPixels(SkImageInfo::Make(2, 2, kRGBA_8888_SkColorType, kPremul_SkAlphaType)); |
| 187 | SkIRect topLeft = SkIRect::MakeWH(1, 1); |
| 188 | bmp.pixmap().erase(SK_ColorRED, topLeft); |
| 189 | bmp.pixmap().erase(SK_ColorGREEN, topLeft.makeOffset(1, 0)); |
| 190 | bmp.pixmap().erase(SK_ColorBLUE, topLeft.makeOffset(0, 1)); |
| 191 | bmp.pixmap().erase(SK_ColorWHITE, topLeft.makeOffset(1, 1)); |
| 192 | return bmp.makeShader(); |
| 193 | } |
| 194 | |
Robert Phillips | e94b4e1 | 2020-07-23 13:54:35 -0400 | [diff] [blame] | 195 | static void test_RuntimeEffect_Shaders(skiatest::Reporter* r, GrRecordingContext* rContext) { |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 196 | SkImageInfo info = SkImageInfo::Make(2, 2, kRGBA_8888_SkColorType, kPremul_SkAlphaType); |
Robert Phillips | e94b4e1 | 2020-07-23 13:54:35 -0400 | [diff] [blame] | 197 | sk_sp<SkSurface> surface = rContext |
| 198 | ? SkSurface::MakeRenderTarget(rContext, SkBudgeted::kNo, info) |
| 199 | : SkSurface::MakeRaster(info); |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 200 | REPORTER_ASSERT(r, surface); |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 201 | TestEffect effect(r, surface); |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 202 | |
Brian Osman | 504032e | 2020-01-10 10:05:24 -0500 | [diff] [blame] | 203 | using float4 = std::array<float, 4>; |
| 204 | |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 205 | // Local coords |
| 206 | effect.build("", "color = half4(half2(p - 0.5), 0, 1);"); |
| 207 | effect.test(0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFF00FFFF); |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 208 | |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 209 | // Use of a simple uniform. (Draw twice with two values to ensure it's updated). |
| 210 | effect.build("uniform float4 gColor;", |
| 211 | "color = half4(gColor);"); |
| 212 | effect.input("gColor") = float4{ 0.0f, 0.25f, 0.75f, 1.0f }; |
| 213 | effect.test(0xFFBF4000); |
| 214 | effect.input("gColor") = float4{ 0.75f, 0.25f, 0.0f, 1.0f }; |
| 215 | effect.test(0xFF0040BF); |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 216 | |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 217 | // Indexing a uniform array with an 'in' integer |
| 218 | effect.build("in int flag; uniform half4 gColors[2];", |
| 219 | "color = gColors[flag];"); |
| 220 | effect.input("gColors") = std::array<float4, 2>{float4{1.0f, 0.0f, 0.0f, 0.498f}, |
| 221 | float4{0.0f, 1.0f, 0.0f, 1.0f }}; |
| 222 | effect.input("flag") = 0; |
| 223 | effect.test(0x7F00007F); // Tests that we clamp to valid premul |
| 224 | effect.input("flag") = 1; |
| 225 | effect.test(0xFF00FF00); |
Brian Osman | 504032e | 2020-01-10 10:05:24 -0500 | [diff] [blame] | 226 | |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 227 | // 'in' half (functionally a uniform, but handled very differently internally) |
| 228 | effect.build("in half c;", |
| 229 | "color = half4(c, c, c, 1);"); |
| 230 | effect.input("c") = 0.498f; |
| 231 | effect.test(0xFF7F7F7F); |
Michael Ludwig | 5e6b3cd | 2020-05-27 17:02:37 -0400 | [diff] [blame] | 232 | |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 233 | // Test sk_FragCoord (device coords). Rotate the canvas to be sure we're seeing device coords. |
| 234 | // Since the surface is 2x2, we should see (0,0), (1,0), (0,1), (1,1). Multiply by 0.498 to |
| 235 | // make sure we're not saturating unexpectedly. |
| 236 | effect.build("", "color = half4(0.498 * (half2(sk_FragCoord.xy) - 0.5), 0, 1);"); |
| 237 | effect.test(0xFF000000, 0xFF00007F, 0xFF007F00, 0xFF007F7F, |
| 238 | [](SkCanvas* canvas, SkPaint*) { canvas->rotate(45.0f); }); |
Michael Ludwig | 22534f2 | 2020-05-27 17:25:33 -0400 | [diff] [blame] | 239 | |
Brian Osman | b5f0f52 | 2020-07-23 13:28:14 -0400 | [diff] [blame] | 240 | // |
| 241 | // Sampling children |
| 242 | // |
| 243 | |
Brian Osman | 6241961 | 2020-07-22 10:19:02 -0400 | [diff] [blame] | 244 | // Sampling a null child should return the paint color |
| 245 | effect.build("in shader child;", |
| 246 | "color = sample(child);"); |
| 247 | effect.child("child") = nullptr; |
| 248 | effect.test(0xFF00FFFF, |
| 249 | [](SkCanvas*, SkPaint* paint) { paint->setColor4f({1.0f, 1.0f, 0.0f, 1.0f}); }); |
| 250 | |
| 251 | sk_sp<SkShader> rgbwShader = make_RGBW_shader(); |
| 252 | |
| 253 | // Sampling a simple child at our coordinates (implicitly) |
| 254 | effect.build("in shader child;", |
| 255 | "color = sample(child);"); |
| 256 | effect.child("child") = rgbwShader; |
| 257 | effect.test(0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFFFFFFFF); |
| 258 | |
| 259 | // Sampling with explicit coordinates (reflecting about the diagonal) |
| 260 | effect.build("in shader child;", |
| 261 | "color = sample(child, p.yx);"); |
| 262 | effect.child("child") = rgbwShader; |
| 263 | effect.test(0xFF0000FF, 0xFFFF0000, 0xFF00FF00, 0xFFFFFFFF); |
| 264 | |
| 265 | // Sampling with a matrix (again, reflecting about the diagonal) |
| 266 | effect.build("in shader child;", |
| 267 | "color = sample(child, float3x3(0, 1, 0, 1, 0, 0, 0, 0, 1));"); |
| 268 | effect.child("child") = rgbwShader; |
| 269 | effect.test(0xFF0000FF, 0xFFFF0000, 0xFF00FF00, 0xFFFFFFFF); |
Brian Osman | b5f0f52 | 2020-07-23 13:28:14 -0400 | [diff] [blame] | 270 | |
| 271 | // |
| 272 | // Helper functions |
| 273 | // |
| 274 | |
| 275 | // Test case for inlining in the pipeline-stage and fragment-shader passes (skbug.com/10526): |
| 276 | effect.build("float2 helper(float2 x) { return x + 1; }", |
| 277 | "float2 v = helper(p);" |
| 278 | "color = half4(half2(v), 0, 1);"); |
| 279 | effect.test(0xFF00FFFF); |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 280 | } |
| 281 | |
| 282 | DEF_TEST(SkRuntimeEffectSimple, r) { |
| 283 | test_RuntimeEffect_Shaders(r, nullptr); |
| 284 | } |
| 285 | |
| 286 | DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SkRuntimeEffectSimple_GPU, r, ctxInfo) { |
Robert Phillips | 6d344c3 | 2020-07-06 10:56:46 -0400 | [diff] [blame] | 287 | test_RuntimeEffect_Shaders(r, ctxInfo.directContext()); |
Brian Osman | f72dedd | 2020-01-08 13:19:58 -0500 | [diff] [blame] | 288 | } |