| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 typedef GrGLFragmentProcessor INHERITED; | 53 typedef GrGLFragmentProcessor INHERITED; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 class BigKeyProcessor : public GrFragmentProcessor { | 56 class BigKeyProcessor : public GrFragmentProcessor { |
| 57 public: | 57 public: |
| 58 static GrFragmentProcessor* Create() { | 58 static GrFragmentProcessor* Create() { |
| 59 GR_CREATE_STATIC_PROCESSOR(gBigKeyProcessor, BigKeyProcessor, ()) | 59 GR_CREATE_STATIC_PROCESSOR(gBigKeyProcessor, BigKeyProcessor, ()) |
| 60 return SkRef(gBigKeyProcessor); | 60 return SkRef(gBigKeyProcessor); |
| 61 } | 61 } |
| 62 | 62 |
| 63 virtual const char* name() const SK_OVERRIDE { return "Big Ole Key"; } | 63 const char* name() const SK_OVERRIDE { return "Big Ole Key"; } |
| 64 | 64 |
| 65 virtual void getGLProcessorKey(const GrGLCaps& caps, | 65 virtual void getGLProcessorKey(const GrGLCaps& caps, |
| 66 GrProcessorKeyBuilder* b) const SK_OVERRIDE { | 66 GrProcessorKeyBuilder* b) const SK_OVERRIDE { |
| 67 GLBigKeyProcessor::GenKey(*this, caps, b); | 67 GLBigKeyProcessor::GenKey(*this, caps, b); |
| 68 } | 68 } |
| 69 | 69 |
| 70 virtual GrGLFragmentProcessor* createGLInstance() const SK_OVERRIDE { | 70 GrGLFragmentProcessor* createGLInstance() const SK_OVERRIDE { |
| 71 return SkNEW_ARGS(GLBigKeyProcessor, (*this)); | 71 return SkNEW_ARGS(GLBigKeyProcessor, (*this)); |
| 72 } | 72 } |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 BigKeyProcessor() { | 75 BigKeyProcessor() { |
| 76 this->initClassID<BigKeyProcessor>(); | 76 this->initClassID<BigKeyProcessor>(); |
| 77 } | 77 } |
| 78 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE { retur
n true; } | 78 bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE { return true;
} |
| 79 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE
RRIDE { } | 79 void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVERRIDE {
} |
| 80 | 80 |
| 81 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 81 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
| 82 | 82 |
| 83 typedef GrFragmentProcessor INHERITED; | 83 typedef GrFragmentProcessor INHERITED; |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(BigKeyProcessor); | 86 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(BigKeyProcessor); |
| 87 | 87 |
| 88 GrFragmentProcessor* BigKeyProcessor::TestCreate(SkRandom*, | 88 GrFragmentProcessor* BigKeyProcessor::TestCreate(SkRandom*, |
| 89 GrContext*, | 89 GrContext*, |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 } | 363 } |
| 364 #endif | 364 #endif |
| 365 GrTestTarget target; | 365 GrTestTarget target; |
| 366 context->getTestTarget(&target); | 366 context->getTestTarget(&target); |
| 367 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); | 367 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); |
| 368 } | 368 } |
| 369 } | 369 } |
| 370 } | 370 } |
| 371 | 371 |
| 372 #endif | 372 #endif |
| OLD | NEW |