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

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 1109863004: Use GLSLCaps for creating processor keys and GLSL-specific programs (Closed) Base URL: https://chromium.googlesource.com/skia@master
Patch Set: Created 5 years, 8 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/GrGLProgramDesc.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 26 matching lines...) Expand all
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
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
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698