Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 1266633003: Added registerChild; transforms, textures, glKey automatically handled. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: refactored to onGetGLProcessorKey; removed emitSamplers specialized template; fixed nits Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/gl/builders/GrGLProgramBuilder.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 class BigKeyProcessor : public GrFragmentProcessor { 59 class BigKeyProcessor : public GrFragmentProcessor {
60 public: 60 public:
61 static GrFragmentProcessor* Create() { 61 static GrFragmentProcessor* Create() {
62 GR_CREATE_STATIC_PROCESSOR(gBigKeyProcessor, BigKeyProcessor, ()) 62 GR_CREATE_STATIC_PROCESSOR(gBigKeyProcessor, BigKeyProcessor, ())
63 return SkRef(gBigKeyProcessor); 63 return SkRef(gBigKeyProcessor);
64 } 64 }
65 65
66 const char* name() const override { return "Big Ole Key"; } 66 const char* name() const override { return "Big Ole Key"; }
67 67
68 virtual void getGLProcessorKey(const GrGLSLCaps& caps,
69 GrProcessorKeyBuilder* b) const override {
70 GLBigKeyProcessor::GenKey(*this, caps, b);
71 }
72
73 GrGLFragmentProcessor* createGLInstance() const override { 68 GrGLFragmentProcessor* createGLInstance() const override {
74 return SkNEW_ARGS(GLBigKeyProcessor, (*this)); 69 return SkNEW_ARGS(GLBigKeyProcessor, (*this));
75 } 70 }
76 71
77 private: 72 private:
78 BigKeyProcessor() { 73 BigKeyProcessor() {
79 this->initClassID<BigKeyProcessor>(); 74 this->initClassID<BigKeyProcessor>();
80 } 75 }
76 virtual void onGetGLProcessorKey(const GrGLSLCaps& caps,
77 GrProcessorKeyBuilder* b) const override {
78 GLBigKeyProcessor::GenKey(*this, caps, b);
79 }
81 bool onIsEqual(const GrFragmentProcessor&) const override { return true; } 80 bool onIsEqual(const GrFragmentProcessor&) const override { return true; }
82 void onComputeInvariantOutput(GrInvariantOutput* inout) const override { } 81 void onComputeInvariantOutput(GrInvariantOutput* inout) const override { }
83 82
84 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; 83 GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
85 84
86 typedef GrFragmentProcessor INHERITED; 85 typedef GrFragmentProcessor INHERITED;
87 }; 86 };
88 87
89 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(BigKeyProcessor); 88 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(BigKeyProcessor);
90 89
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 } 293 }
295 #endif 294 #endif
296 GrTestTarget target; 295 GrTestTarget target;
297 context->getTestTarget(&target); 296 context->getTestTarget(&target);
298 REPORTER_ASSERT(reporter, target.target()->programUnitTest(context, maxStages)); 297 REPORTER_ASSERT(reporter, target.target()->programUnitTest(context, maxStages));
299 } 298 }
300 } 299 }
301 } 300 }
302 301
303 #endif 302 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/builders/GrGLProgramBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698