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 14 matching lines...) Loading... |
25 #include "Test.h" | 25 #include "Test.h" |
26 | 26 |
27 #include "batches/GrDrawBatch.h" | 27 #include "batches/GrDrawBatch.h" |
28 | 28 |
29 #include "effects/GrConfigConversionEffect.h" | 29 #include "effects/GrConfigConversionEffect.h" |
30 #include "effects/GrPorterDuffXferProcessor.h" | 30 #include "effects/GrPorterDuffXferProcessor.h" |
31 #include "effects/GrXfermodeFragmentProcessor.h" | 31 #include "effects/GrXfermodeFragmentProcessor.h" |
32 | 32 |
33 #include "gl/GrGLFragmentProcessor.h" | 33 #include "gl/GrGLFragmentProcessor.h" |
34 #include "gl/GrGLGpu.h" | 34 #include "gl/GrGLGpu.h" |
35 #include "gl/GrGLPathRendering.h" | 35 #include "glsl/GrGLSLFragmentShaderBuilder.h" |
36 #include "gl/builders/GrGLProgramBuilder.h" | 36 #include "glsl/GrGLSLProgramBuilder.h" |
37 | 37 |
38 /* | 38 /* |
39 * A dummy processor which just tries to insert a massive key and verify that it
can retrieve the | 39 * A dummy processor which just tries to insert a massive key and verify that it
can retrieve the |
40 * whole thing correctly | 40 * whole thing correctly |
41 */ | 41 */ |
42 static const uint32_t kMaxKeySize = 1024; | 42 static const uint32_t kMaxKeySize = 1024; |
43 | 43 |
44 class GLBigKeyProcessor : public GrGLFragmentProcessor { | 44 class GLBigKeyProcessor : public GrGLFragmentProcessor { |
45 public: | 45 public: |
46 GLBigKeyProcessor(const GrProcessor&) {} | 46 GLBigKeyProcessor(const GrProcessor&) {} |
47 | 47 |
48 virtual void emitCode(EmitArgs& args) override { | 48 virtual void emitCode(EmitArgs& args) override { |
49 // pass through | 49 // pass through |
50 GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder
(); | 50 GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuild
er(); |
51 if (args.fInputColor) { | 51 if (args.fInputColor) { |
52 fsBuilder->codeAppendf("%s = %s;\n", args.fOutputColor, args.fInputC
olor); | 52 fsBuilder->codeAppendf("%s = %s;\n", args.fOutputColor, args.fInputC
olor); |
53 } else { | 53 } else { |
54 fsBuilder->codeAppendf("%s = vec4(1.0);\n", args.fOutputColor); | 54 fsBuilder->codeAppendf("%s = vec4(1.0);\n", args.fOutputColor); |
55 } | 55 } |
56 } | 56 } |
57 | 57 |
58 static void GenKey(const GrProcessor& processor, const GrGLSLCaps&, GrProces
sorKeyBuilder* b) { | 58 static void GenKey(const GrProcessor& processor, const GrGLSLCaps&, GrProces
sorKeyBuilder* b) { |
59 for (uint32_t i = 0; i < kMaxKeySize; i++) { | 59 for (uint32_t i = 0; i < kMaxKeySize; i++) { |
60 b->add32(i); | 60 b->add32(i); |
(...skipping 378 matching lines...) Loading... |
439 } | 439 } |
440 #endif | 440 #endif |
441 GrTestTarget target; | 441 GrTestTarget target; |
442 context->getTestTarget(&target); | 442 context->getTestTarget(&target); |
443 REPORTER_ASSERT(reporter, target.target()->programUnitTest(context,
maxStages)); | 443 REPORTER_ASSERT(reporter, target.target()->programUnitTest(context,
maxStages)); |
444 } | 444 } |
445 } | 445 } |
446 } | 446 } |
447 | 447 |
448 #endif | 448 #endif |
OLD | NEW |