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

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 1457543003: Add ShaderBuilders to EmitArgs and remove gettings from ProgBuilder. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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/glsl/GrGLSLXferProcessor.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 30 matching lines...) Expand all
41 * whole thing correctly 41 * whole thing correctly
42 */ 42 */
43 static const uint32_t kMaxKeySize = 1024; 43 static const uint32_t kMaxKeySize = 1024;
44 44
45 class GLBigKeyProcessor : public GrGLSLFragmentProcessor { 45 class GLBigKeyProcessor : public GrGLSLFragmentProcessor {
46 public: 46 public:
47 GLBigKeyProcessor(const GrProcessor&) {} 47 GLBigKeyProcessor(const GrProcessor&) {}
48 48
49 virtual void emitCode(EmitArgs& args) override { 49 virtual void emitCode(EmitArgs& args) override {
50 // pass through 50 // pass through
51 GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuild er(); 51 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
52 if (args.fInputColor) { 52 if (args.fInputColor) {
53 fsBuilder->codeAppendf("%s = %s;\n", args.fOutputColor, args.fInputC olor); 53 fragBuilder->codeAppendf("%s = %s;\n", args.fOutputColor, args.fInpu tColor);
54 } else { 54 } else {
55 fsBuilder->codeAppendf("%s = vec4(1.0);\n", args.fOutputColor); 55 fragBuilder->codeAppendf("%s = vec4(1.0);\n", args.fOutputColor);
56 } 56 }
57 } 57 }
58 58
59 static void GenKey(const GrProcessor& processor, const GrGLSLCaps&, GrProces sorKeyBuilder* b) { 59 static void GenKey(const GrProcessor& processor, const GrGLSLCaps&, GrProces sorKeyBuilder* b) {
60 for (uint32_t i = 0; i < kMaxKeySize; i++) { 60 for (uint32_t i = 0; i < kMaxKeySize; i++) {
61 b->add32(i); 61 b->add32(i);
62 } 62 }
63 } 63 }
64 64
65 private: 65 private:
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 if (type == GrContextFactory::kCommandBuffer_GLContextType) { 446 if (type == GrContextFactory::kCommandBuffer_GLContextType) {
447 maxStages = 2; 447 maxStages = 2;
448 } 448 }
449 #endif 449 #endif
450 REPORTER_ASSERT(reporter, GrDrawingManager::ProgramUnitTest(context, maxStages)); 450 REPORTER_ASSERT(reporter, GrDrawingManager::ProgramUnitTest(context, maxStages));
451 } 451 }
452 } 452 }
453 } 453 }
454 454
455 #endif 455 #endif
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLXferProcessor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698