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

Side by Side Diff: src/gpu/gl/GrGLVertexEffect.h

Issue 491673002: Initial refactor of shaderbuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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/GrGLShaderBuilder.cpp ('k') | src/gpu/gl/GrGpuGL.cpp » ('j') | 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 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrGLVertexEffect_DEFINED 8 #ifndef GrGLVertexEffect_DEFINED
9 #define GrGLVertexEffect_DEFINED 9 #define GrGLVertexEffect_DEFINED
10 10
11 #include "GrGLEffect.h" 11 #include "GrGLEffect.h"
12 12
13 /** 13 /**
14 * If a GL effect needs a GrGLFullShaderBuilder* object to emit vertex code, the n it must inherit 14 * If a GL effect needs a GrGLFullShaderBuilder* object to emit vertex code, the n it must inherit
15 * from this class. Since paths don't have vertices, this class is only meant to be used internally 15 * from this class. Since paths don't have vertices, this class is only meant to be used internally
16 * by skia, for special cases. 16 * by skia, for special cases.
17 */ 17 */
18 class GrGLVertexEffect : public GrGLEffect { 18 class GrGLVertexEffect : public GrGLEffect {
19 public: 19 public:
20 GrGLVertexEffect(const GrBackendEffectFactory& factory) 20 GrGLVertexEffect(const GrBackendEffectFactory& factory)
21 : INHERITED(factory) { fIsVertexEffect = true; } 21 : INHERITED(factory) { fIsVertexEffect = true; }
22 22
23 /** 23 /**
24 * This is similar to emitCode() in the base class, except it takes a full s hader builder. 24 * This is similar to emitCode() in the base class, except it takes a full s hader builder.
25 * This allows the effect subclass to emit vertex code. 25 * This allows the effect subclass to emit vertex code.
26 */ 26 */
27 virtual void emitCode(GrGLFullShaderBuilder* builder, 27 virtual void emitCode(GrGLFullProgramBuilder* builder,
28 const GrDrawEffect& drawEffect, 28 const GrDrawEffect& drawEffect,
29 const GrEffectKey& key, 29 const GrEffectKey& key,
30 const char* outputColor, 30 const char* outputColor,
31 const char* inputColor, 31 const char* inputColor,
32 const TransformedCoordsArray& coords, 32 const TransformedCoordsArray& coords,
33 const TextureSamplerArray& samplers) = 0; 33 const TextureSamplerArray& samplers) = 0;
34
35 /** 34 /**
36 * Provide a default override for base class's emitCode() function. 35 * Provide a default override for base class's emitCode() function.
37 */ 36 */
38 virtual void emitCode(GrGLShaderBuilder* builder, 37 virtual void emitCode(GrGLProgramBuilder* builder,
39 const GrDrawEffect& drawEffect, 38 const GrDrawEffect& drawEffect,
40 const GrEffectKey& key, 39 const GrEffectKey& key,
41 const char* outputColor, 40 const char* outputColor,
42 const char* inputColor, 41 const char* inputColor,
43 const TransformedCoordsArray& coords, 42 const TransformedCoordsArray& coords,
44 const TextureSamplerArray& samplers) SK_OVERRIDE { 43 const TextureSamplerArray& samplers) SK_OVERRIDE {
45 SkFAIL("GrGLVertexEffect requires GrGLFullShaderBuilder* overload for em itCode()."); 44 SkFAIL("GrGLVertexEffect requires GrGLFullProgramBuilder* overload for e mitCode().");
46 } 45 }
47 46
47
48 private: 48 private:
49 typedef GrGLEffect INHERITED; 49 typedef GrGLEffect INHERITED;
50 }; 50 };
51 51
52 #endif 52 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLShaderBuilder.cpp ('k') | src/gpu/gl/GrGpuGL.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698