OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 GrGLXferProcessor_DEFINED | 8 #ifndef GrGLXferProcessor_DEFINED |
9 #define GrGLXferProcessor_DEFINED | 9 #define GrGLXferProcessor_DEFINED |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 /** A GrGLXferProcessor instance can be reused with any GrGLXferProcessor th at produces | 52 /** A GrGLXferProcessor instance can be reused with any GrGLXferProcessor th at produces |
53 the same stage key; this function reads data from a GrGLXferProcessor an d uploads any | 53 the same stage key; this function reads data from a GrGLXferProcessor an d uploads any |
54 uniform variables required by the shaders created in emitCode(). The Gr XferProcessor | 54 uniform variables required by the shaders created in emitCode(). The Gr XferProcessor |
55 parameter is guaranteed to be of the same type that created this GrGLXfe rProcessor and | 55 parameter is guaranteed to be of the same type that created this GrGLXfe rProcessor and |
56 to have an identical processor key as the one that created this GrGLXfer Processor. This | 56 to have an identical processor key as the one that created this GrGLXfer Processor. This |
57 function calls onSetData on the subclass of GrGLXferProcessor | 57 function calls onSetData on the subclass of GrGLXferProcessor |
58 */ | 58 */ |
59 void setData(const GrGLProgramDataManager& pdm, const GrXferProcessor& xp); | 59 void setData(const GrGLProgramDataManager& pdm, const GrXferProcessor& xp); |
60 | 60 |
61 private: | 61 private: |
62 virtual void onEmitCode(const EmitArgs&) = 0; | 62 /** |
63 * Called by emitCode() when the XP will not be performing a dst read. This method is | |
64 * responsible for both blending and coverage. A subclass only needs to impl ement this method if | |
65 * it can construct a GrXferProcessor that will not read the dst color. | |
66 */ | |
67 virtual void onEmitCode(const EmitArgs&) { SkFAIL("onEmitCode not implemente d."); } | |
egdaniel
2015/06/05 16:44:01
So some pretty unhelpful feed back here...but some
Chris Dalton
2015/06/05 17:41:36
I've thought about it some and have come up with s
| |
68 | |
69 /** | |
70 * Called by emitCode() when the XP will perform a dst read. This method onl y needs to supply | |
71 * the blending logic. The base class applies coverage. A subclass only need s to implement this | |
72 * method if it can construct a GrXferProcessor that reads the dst color. | |
73 */ | |
74 virtual void onEmitShaderBlend(GrGLXPBuilder*, const char* srcColor, const c har* dstColor, | |
75 const char* outColor, const GrXferProcessor&) { | |
76 SkFAIL("onEmitShaderBlend not implemented."); | |
77 } | |
63 | 78 |
64 virtual void onSetData(const GrGLProgramDataManager&, const GrXferProcessor& ) = 0; | 79 virtual void onSetData(const GrGLProgramDataManager&, const GrXferProcessor& ) = 0; |
65 | 80 |
66 GrGLProgramDataManager::UniformHandle fDstTopLeftUni; | 81 GrGLProgramDataManager::UniformHandle fDstTopLeftUni; |
67 GrGLProgramDataManager::UniformHandle fDstScaleUni; | 82 GrGLProgramDataManager::UniformHandle fDstScaleUni; |
68 | 83 |
69 typedef GrGLProcessor INHERITED; | 84 typedef GrGLProcessor INHERITED; |
70 }; | 85 }; |
71 #endif | 86 #endif |
OLD | NEW |