| 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 26 matching lines...) Expand all Loading... |
| 37 public: | 37 public: |
| 38 GLBigKeyProcessor(const GrProcessor&) {} | 38 GLBigKeyProcessor(const GrProcessor&) {} |
| 39 | 39 |
| 40 virtual void emitCode(GrGLFPBuilder* builder, | 40 virtual void emitCode(GrGLFPBuilder* builder, |
| 41 const GrFragmentProcessor& fp, | 41 const GrFragmentProcessor& fp, |
| 42 const char* outputColor, | 42 const char* outputColor, |
| 43 const char* inputColor, | 43 const char* inputColor, |
| 44 const TransformedCoordsArray&, | 44 const TransformedCoordsArray&, |
| 45 const TextureSamplerArray&) {} | 45 const TextureSamplerArray&) {} |
| 46 | 46 |
| 47 static void GenKey(const GrProcessor& processor, const GrGLCaps&, GrProcesso
rKeyBuilder* b) { | 47 static void GenKey(const GrProcessor& processor, const GrGLSLCaps&, GrProces
sorKeyBuilder* b) { |
| 48 for (uint32_t i = 0; i < kMaxKeySize; i++) { | 48 for (uint32_t i = 0; i < kMaxKeySize; i++) { |
| 49 b->add32(i); | 49 b->add32(i); |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 typedef GrGLFragmentProcessor INHERITED; | 54 typedef GrGLFragmentProcessor INHERITED; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 class BigKeyProcessor : public GrFragmentProcessor { | 57 class BigKeyProcessor : public GrFragmentProcessor { |
| 58 public: | 58 public: |
| 59 static GrFragmentProcessor* Create() { | 59 static GrFragmentProcessor* Create() { |
| 60 GR_CREATE_STATIC_PROCESSOR(gBigKeyProcessor, BigKeyProcessor, ()) | 60 GR_CREATE_STATIC_PROCESSOR(gBigKeyProcessor, BigKeyProcessor, ()) |
| 61 return SkRef(gBigKeyProcessor); | 61 return SkRef(gBigKeyProcessor); |
| 62 } | 62 } |
| 63 | 63 |
| 64 const char* name() const override { return "Big Ole Key"; } | 64 const char* name() const override { return "Big Ole Key"; } |
| 65 | 65 |
| 66 virtual void getGLProcessorKey(const GrGLCaps& caps, | 66 virtual void getGLProcessorKey(const GrGLSLCaps& caps, |
| 67 GrProcessorKeyBuilder* b) const override { | 67 GrProcessorKeyBuilder* b) const override { |
| 68 GLBigKeyProcessor::GenKey(*this, caps, b); | 68 GLBigKeyProcessor::GenKey(*this, caps, b); |
| 69 } | 69 } |
| 70 | 70 |
| 71 GrGLFragmentProcessor* createGLInstance() const override { | 71 GrGLFragmentProcessor* createGLInstance() const override { |
| 72 return SkNEW_ARGS(GLBigKeyProcessor, (*this)); | 72 return SkNEW_ARGS(GLBigKeyProcessor, (*this)); |
| 73 } | 73 } |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 BigKeyProcessor() { | 76 BigKeyProcessor() { |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 } | 360 } |
| 361 #endif | 361 #endif |
| 362 GrTestTarget target; | 362 GrTestTarget target; |
| 363 context->getTestTarget(&target); | 363 context->getTestTarget(&target); |
| 364 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); | 364 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); |
| 365 } | 365 } |
| 366 } | 366 } |
| 367 } | 367 } |
| 368 | 368 |
| 369 #endif | 369 #endif |
| OLD | NEW |