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

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 1251173002: Added GrGLFragmentProcessor::EmitArgs struct for use with emitCode() (Closed) Base URL: https://skia.googlesource.com/skia@composeshader_gpu
Patch Set: Created 5 years, 5 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 22 matching lines...) Expand all
33 /* 33 /*
34 * A dummy processor which just tries to insert a massive key and verify that it can retrieve the 34 * A dummy processor which just tries to insert a massive key and verify that it can retrieve the
35 * whole thing correctly 35 * whole thing correctly
36 */ 36 */
37 static const uint32_t kMaxKeySize = 1024; 37 static const uint32_t kMaxKeySize = 1024;
38 38
39 class GLBigKeyProcessor : public GrGLFragmentProcessor { 39 class GLBigKeyProcessor : public GrGLFragmentProcessor {
40 public: 40 public:
41 GLBigKeyProcessor(const GrProcessor&) {} 41 GLBigKeyProcessor(const GrProcessor&) {}
42 42
43 virtual void emitCode(GrGLFPBuilder* builder, 43 virtual void emitCode(EmitArgs& args) override {
44 const GrFragmentProcessor& fp,
45 const char* outputColor,
46 const char* inputColor,
47 const TransformedCoordsArray&,
48 const TextureSamplerArray&) {
49 // pass through 44 // pass through
50 GrGLFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder(); 45 GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder ();
51 fsBuilder->codeAppendf("%s = %s;\n", outputColor, inputColor); 46 fsBuilder->codeAppendf("%s = %s;\n", args.fOutputColor, args.fInputColor );
52 } 47 }
53 48
54 static void GenKey(const GrProcessor& processor, const GrGLSLCaps&, GrProces sorKeyBuilder* b) { 49 static void GenKey(const GrProcessor& processor, const GrGLSLCaps&, GrProces sorKeyBuilder* b) {
55 for (uint32_t i = 0; i < kMaxKeySize; i++) { 50 for (uint32_t i = 0; i < kMaxKeySize; i++) {
56 b->add32(i); 51 b->add32(i);
57 } 52 }
58 } 53 }
59 54
60 private: 55 private:
61 typedef GrGLFragmentProcessor INHERITED; 56 typedef GrGLFragmentProcessor INHERITED;
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 } 294 }
300 #endif 295 #endif
301 GrTestTarget target; 296 GrTestTarget target;
302 context->getTestTarget(&target); 297 context->getTestTarget(&target);
303 REPORTER_ASSERT(reporter, target.target()->programUnitTest(context, maxStages)); 298 REPORTER_ASSERT(reporter, target.target()->programUnitTest(context, maxStages));
304 } 299 }
305 } 300 }
306 } 301 }
307 302
308 #endif 303 #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