| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 GrEffect_DEFINED | 8 #ifndef GrEffect_DEFINED |
| 9 #define GrEffect_DEFINED | 9 #define GrEffect_DEFINED |
| 10 | 10 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 /** Shortcut for textureAccess(index).texture(); */ | 106 /** Shortcut for textureAccess(index).texture(); */ |
| 107 GrTexture* texture(int index) const { return this->textureAccess(index).getT
exture(); } | 107 GrTexture* texture(int index) const { return this->textureAccess(index).getT
exture(); } |
| 108 | 108 |
| 109 /** Will this effect read the destination pixel value? */ | 109 /** Will this effect read the destination pixel value? */ |
| 110 bool willReadDstColor() const { return fWillReadDstColor; } | 110 bool willReadDstColor() const { return fWillReadDstColor; } |
| 111 | 111 |
| 112 /** Will this effect read the fragment position? */ | 112 /** Will this effect read the fragment position? */ |
| 113 bool willReadFragmentPosition() const { return fWillReadFragmentPosition; } | 113 bool willReadFragmentPosition() const { return fWillReadFragmentPosition; } |
| 114 | 114 |
| 115 /** Will this effect emit custom vertex shader code? | 115 /** Will this effect emit custom vertex shader code? |
| 116 (To set this value the effect must inherit from GrVertexEffect.) */ | 116 (To set this value the effect must inherit from GrEffect.) */ |
| 117 bool hasVertexCode() const { return fHasVertexCode; } | 117 bool hasVertexCode() const { return fHasVertexCode; } |
| 118 | 118 |
| 119 int numVertexAttribs() const { | 119 int numVertexAttribs() const { |
| 120 SkASSERT(0 == fVertexAttribTypes.count() || fHasVertexCode); | 120 SkASSERT(0 == fVertexAttribTypes.count() || fHasVertexCode); |
| 121 return fVertexAttribTypes.count(); | 121 return fVertexAttribTypes.count(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 GrSLType vertexAttribType(int index) const { return fVertexAttribTypes[index
]; } | 124 GrSLType vertexAttribType(int index) const { return fVertexAttribTypes[index
]; } |
| 125 | 125 |
| 126 static const int kMaxVertexAttribs = 2; | 126 static const int kMaxVertexAttribs = 2; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 * This creates an effect outside of the effect memory pool. The effect's destru
ctor will be called | 221 * This creates an effect outside of the effect memory pool. The effect's destru
ctor will be called |
| 222 * at global destruction time. NAME will be the name of the created GrEffect. | 222 * at global destruction time. NAME will be the name of the created GrEffect. |
| 223 */ | 223 */ |
| 224 #define GR_CREATE_STATIC_EFFECT(NAME, EFFECT_CLASS, ARGS)
\ | 224 #define GR_CREATE_STATIC_EFFECT(NAME, EFFECT_CLASS, ARGS)
\ |
| 225 static SkAlignedSStorage<sizeof(EFFECT_CLASS)> g_##NAME##_Storage;
\ | 225 static SkAlignedSStorage<sizeof(EFFECT_CLASS)> g_##NAME##_Storage;
\ |
| 226 static GrEffect* NAME SkNEW_PLACEMENT_ARGS(g_##NAME##_Storage.get(), EFFECT_CLAS
S, ARGS); \ | 226 static GrEffect* NAME SkNEW_PLACEMENT_ARGS(g_##NAME##_Storage.get(), EFFECT_CLAS
S, ARGS); \ |
| 227 static SkAutoTDestroy<GrEffect> NAME##_ad(NAME); | 227 static SkAutoTDestroy<GrEffect> NAME##_ad(NAME); |
| 228 | 228 |
| 229 | 229 |
| 230 #endif | 230 #endif |
| OLD | NEW |