OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 // This is a GPU-backend specific test. It relies on static intializers to work | 9 // This is a GPU-backend specific test. It relies on static intializers to work |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 /* | 33 /* |
34 * A dummy processor which just tries to insert a massive key and verify that it
can retrieve the | 34 * A dummy processor which just tries to insert a massive key and verify that it
can retrieve the |
35 * whole thing correctly | 35 * whole thing correctly |
36 */ | 36 */ |
37 static const uint32_t kMaxKeySize = 1024; | 37 static const uint32_t kMaxKeySize = 1024; |
38 | 38 |
39 class GLBigKeyProcessor : public GrGLFragmentProcessor { | 39 class GLBigKeyProcessor : public GrGLFragmentProcessor { |
40 public: | 40 public: |
41 GLBigKeyProcessor(const GrProcessor&) {} | 41 GLBigKeyProcessor(const GrProcessor&) {} |
42 | 42 |
43 virtual void emitCode(GrGLFPBuilder* builder, | 43 virtual void emitCode(EmitArgs& args) override { |
44 const GrFragmentProcessor& fp, | |
45 const char* outputColor, | |
46 const char* inputColor, | |
47 const TransformedCoordsArray&, | |
48 const TextureSamplerArray&) { | |
49 // pass through | 44 // pass through |
50 GrGLFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder(); | 45 GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder
(); |
51 fsBuilder->codeAppendf("%s = %s;\n", outputColor, inputColor); | 46 fsBuilder->codeAppendf("%s = %s;\n", args.fOutputColor, args.fInputColor
); |
52 } | 47 } |
53 | 48 |
54 static void GenKey(const GrProcessor& processor, const GrGLSLCaps&, GrProces
sorKeyBuilder* b) { | 49 static void GenKey(const GrProcessor& processor, const GrGLSLCaps&, GrProces
sorKeyBuilder* b) { |
55 for (uint32_t i = 0; i < kMaxKeySize; i++) { | 50 for (uint32_t i = 0; i < kMaxKeySize; i++) { |
56 b->add32(i); | 51 b->add32(i); |
57 } | 52 } |
58 } | 53 } |
59 | 54 |
60 private: | 55 private: |
61 typedef GrGLFragmentProcessor INHERITED; | 56 typedef GrGLFragmentProcessor INHERITED; |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 } | 294 } |
300 #endif | 295 #endif |
301 GrTestTarget target; | 296 GrTestTarget target; |
302 context->getTestTarget(&target); | 297 context->getTestTarget(&target); |
303 REPORTER_ASSERT(reporter, target.target()->programUnitTest(context,
maxStages)); | 298 REPORTER_ASSERT(reporter, target.target()->programUnitTest(context,
maxStages)); |
304 } | 299 } |
305 } | 300 } |
306 } | 301 } |
307 | 302 |
308 #endif | 303 #endif |
OLD | NEW |