| 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 30 matching lines...) Expand all Loading... |
| 41 * whole thing correctly | 41 * whole thing correctly |
| 42 */ | 42 */ |
| 43 static const uint32_t kMaxKeySize = 1024; | 43 static const uint32_t kMaxKeySize = 1024; |
| 44 | 44 |
| 45 class GLBigKeyProcessor : public GrGLSLFragmentProcessor { | 45 class GLBigKeyProcessor : public GrGLSLFragmentProcessor { |
| 46 public: | 46 public: |
| 47 GLBigKeyProcessor(const GrProcessor&) {} | 47 GLBigKeyProcessor(const GrProcessor&) {} |
| 48 | 48 |
| 49 virtual void emitCode(EmitArgs& args) override { | 49 virtual void emitCode(EmitArgs& args) override { |
| 50 // pass through | 50 // pass through |
| 51 GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuild
er(); | 51 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; |
| 52 if (args.fInputColor) { | 52 if (args.fInputColor) { |
| 53 fsBuilder->codeAppendf("%s = %s;\n", args.fOutputColor, args.fInputC
olor); | 53 fragBuilder->codeAppendf("%s = %s;\n", args.fOutputColor, args.fInpu
tColor); |
| 54 } else { | 54 } else { |
| 55 fsBuilder->codeAppendf("%s = vec4(1.0);\n", args.fOutputColor); | 55 fragBuilder->codeAppendf("%s = vec4(1.0);\n", args.fOutputColor); |
| 56 } | 56 } |
| 57 } | 57 } |
| 58 | 58 |
| 59 static void GenKey(const GrProcessor& processor, const GrGLSLCaps&, GrProces
sorKeyBuilder* b) { | 59 static void GenKey(const GrProcessor& processor, const GrGLSLCaps&, GrProces
sorKeyBuilder* b) { |
| 60 for (uint32_t i = 0; i < kMaxKeySize; i++) { | 60 for (uint32_t i = 0; i < kMaxKeySize; i++) { |
| 61 b->add32(i); | 61 b->add32(i); |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 | 64 |
| 65 private: | 65 private: |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 if (type == GrContextFactory::kCommandBuffer_GLContextType) { | 446 if (type == GrContextFactory::kCommandBuffer_GLContextType) { |
| 447 maxStages = 2; | 447 maxStages = 2; |
| 448 } | 448 } |
| 449 #endif | 449 #endif |
| 450 REPORTER_ASSERT(reporter, GrDrawingManager::ProgramUnitTest(context,
maxStages)); | 450 REPORTER_ASSERT(reporter, GrDrawingManager::ProgramUnitTest(context,
maxStages)); |
| 451 } | 451 } |
| 452 } | 452 } |
| 453 } | 453 } |
| 454 | 454 |
| 455 #endif | 455 #endif |
| OLD | NEW |