| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_SHADER_H_ | 5 #ifndef CC_SHADER_H_ |
| 6 #define CC_SHADER_H_ | 6 #define CC_SHADER_H_ |
| 7 | 7 |
| 8 #include "third_party/skia/include/core/SkColorPriv.h" | 8 #include "third_party/skia/include/core/SkColorPriv.h" |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 namespace WebKit { | 11 namespace WebKit { |
| 12 class WebGraphicsContext3D; | 12 class WebGraphicsContext3D; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace cc { | 15 namespace cc { |
| 16 | 16 |
| 17 class VertexShaderPosTex { | 17 class VertexShaderPosTex { |
| 18 public: | 18 public: |
| 19 VertexShaderPosTex(); | 19 VertexShaderPosTex(); |
| 20 | 20 |
| 21 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 21 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 22 std::string getShaderString() const; | 22 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 23 | 23 |
| 24 int matrixLocation() const { return m_matrixLocation; } | 24 int matrixLocation() const { return m_matrixLocation; } |
| 25 | 25 |
| 26 private: | 26 private: |
| 27 int m_matrixLocation; | 27 int m_matrixLocation; |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 class VertexShaderPosTexYUVStretch { | 30 class VertexShaderPosTexYUVStretch { |
| 31 public: | 31 public: |
| 32 VertexShaderPosTexYUVStretch(); | 32 VertexShaderPosTexYUVStretch(); |
| 33 | 33 |
| 34 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 34 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 35 std::string getShaderString() const; | 35 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 36 | 36 |
| 37 int matrixLocation() const { return m_matrixLocation; } | 37 int matrixLocation() const { return m_matrixLocation; } |
| 38 int texScaleLocation() const { return m_texScaleLocation; } | 38 int texScaleLocation() const { return m_texScaleLocation; } |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 int m_matrixLocation; | 41 int m_matrixLocation; |
| 42 int m_texScaleLocation; | 42 int m_texScaleLocation; |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 class VertexShaderPos { | 45 class VertexShaderPos { |
| 46 public: | 46 public: |
| 47 VertexShaderPos(); | 47 VertexShaderPos(); |
| 48 | 48 |
| 49 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 49 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 50 std::string getShaderString() const; | 50 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 51 | 51 |
| 52 int matrixLocation() const { return m_matrixLocation; } | 52 int matrixLocation() const { return m_matrixLocation; } |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 int m_matrixLocation; | 55 int m_matrixLocation; |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 class VertexShaderPosTexIdentity { | 58 class VertexShaderPosTexIdentity { |
| 59 public: | 59 public: |
| 60 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex) { } | 60 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex) { } |
| 61 std::string getShaderString() const; | 61 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 class VertexShaderPosTexTransform { | 64 class VertexShaderPosTexTransform { |
| 65 public: | 65 public: |
| 66 VertexShaderPosTexTransform(); | 66 VertexShaderPosTexTransform(); |
| 67 | 67 |
| 68 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 68 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 69 std::string getShaderString() const; | 69 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 70 | 70 |
| 71 int matrixLocation() const { return m_matrixLocation; } | 71 int matrixLocation() const { return m_matrixLocation; } |
| 72 int texTransformLocation() const { return m_texTransformLocation; } | 72 int texTransformLocation() const { return m_texTransformLocation; } |
| 73 int vertexOpacityLocation() const { return m_vertexOpacityLocation; } | 73 int vertexOpacityLocation() const { return m_vertexOpacityLocation; } |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 int m_matrixLocation; | 76 int m_matrixLocation; |
| 77 int m_texTransformLocation; | 77 int m_texTransformLocation; |
| 78 int m_vertexOpacityLocation; | 78 int m_vertexOpacityLocation; |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 class VertexShaderPosTexTransformFlip : public VertexShaderPosTexTransform { | 81 class VertexShaderPosTexTransformFlip : public VertexShaderPosTexTransform { |
| 82 public: | 82 public: |
| 83 std::string getShaderString() const; | 83 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 class VertexShaderQuad { | 86 class VertexShaderQuad { |
| 87 public: | 87 public: |
| 88 VertexShaderQuad(); | 88 VertexShaderQuad(); |
| 89 | 89 |
| 90 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 90 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 91 std::string getShaderString() const; | 91 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 92 | 92 |
| 93 int matrixLocation() const { return m_matrixLocation; } | 93 int matrixLocation() const { return m_matrixLocation; } |
| 94 int pointLocation() const { return m_pointLocation; } | 94 int pointLocation() const { return m_pointLocation; } |
| 95 int texScaleLocation() const { return m_texScaleLocation; } | 95 int texScaleLocation() const { return m_texScaleLocation; } |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 int m_matrixLocation; | 98 int m_matrixLocation; |
| 99 int m_pointLocation; | 99 int m_pointLocation; |
| 100 int m_texScaleLocation; | 100 int m_texScaleLocation; |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 class VertexShaderTile { | 103 class VertexShaderTile { |
| 104 public: | 104 public: |
| 105 VertexShaderTile(); | 105 VertexShaderTile(); |
| 106 | 106 |
| 107 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 107 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 108 std::string getShaderString() const; | 108 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 109 | 109 |
| 110 int matrixLocation() const { return m_matrixLocation; } | 110 int matrixLocation() const { return m_matrixLocation; } |
| 111 int pointLocation() const { return m_pointLocation; } | 111 int pointLocation() const { return m_pointLocation; } |
| 112 int vertexTexTransformLocation() const { return m_vertexTexTransformLocation
; } | 112 int vertexTexTransformLocation() const { return m_vertexTexTransformLocation
; } |
| 113 | 113 |
| 114 private: | 114 private: |
| 115 int m_matrixLocation; | 115 int m_matrixLocation; |
| 116 int m_pointLocation; | 116 int m_pointLocation; |
| 117 int m_vertexTexTransformLocation; | 117 int m_vertexTexTransformLocation; |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 class VertexShaderVideoTransform { | 120 class VertexShaderVideoTransform { |
| 121 public: | 121 public: |
| 122 VertexShaderVideoTransform(); | 122 VertexShaderVideoTransform(); |
| 123 | 123 |
| 124 bool init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 124 bool init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 125 std::string getShaderString() const; | 125 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 126 | 126 |
| 127 int matrixLocation() const { return m_matrixLocation; } | 127 int matrixLocation() const { return m_matrixLocation; } |
| 128 int texMatrixLocation() const { return m_texMatrixLocation; } | 128 int texMatrixLocation() const { return m_texMatrixLocation; } |
| 129 | 129 |
| 130 private: | 130 private: |
| 131 int m_matrixLocation; | 131 int m_matrixLocation; |
| 132 int m_texMatrixLocation; | 132 int m_texMatrixLocation; |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 class FragmentTexAlphaBinding { | 135 class FragmentTexAlphaBinding { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 156 int edgeLocation() const { return -1; } | 156 int edgeLocation() const { return -1; } |
| 157 int fragmentTexTransformLocation() const { return -1; } | 157 int fragmentTexTransformLocation() const { return -1; } |
| 158 int samplerLocation() const { return m_samplerLocation; } | 158 int samplerLocation() const { return m_samplerLocation; } |
| 159 | 159 |
| 160 private: | 160 private: |
| 161 int m_samplerLocation; | 161 int m_samplerLocation; |
| 162 }; | 162 }; |
| 163 | 163 |
| 164 class FragmentShaderRGBATexVaryingAlpha : public FragmentTexOpaqueBinding { | 164 class FragmentShaderRGBATexVaryingAlpha : public FragmentTexOpaqueBinding { |
| 165 public: | 165 public: |
| 166 std::string getShaderString() const; | 166 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 167 }; | 167 }; |
| 168 | 168 |
| 169 class FragmentShaderRGBATexAlpha : public FragmentTexAlphaBinding { | 169 class FragmentShaderRGBATexAlpha : public FragmentTexAlphaBinding { |
| 170 public: | 170 public: |
| 171 std::string getShaderString() const; | 171 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 172 }; | 172 }; |
| 173 | 173 |
| 174 class FragmentShaderRGBATexRectVaryingAlpha : public FragmentTexAlphaBinding { | 174 class FragmentShaderRGBATexRectVaryingAlpha : public FragmentTexAlphaBinding { |
| 175 public: | 175 public: |
| 176 std::string getShaderString() const; | 176 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 177 }; | 177 }; |
| 178 | 178 |
| 179 class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding { | 179 class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding { |
| 180 public: | 180 public: |
| 181 std::string getShaderString() const; | 181 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 182 }; | 182 }; |
| 183 | 183 |
| 184 class FragmentShaderRGBATex : public FragmentTexOpaqueBinding { | 184 class FragmentShaderRGBATex : public FragmentTexOpaqueBinding { |
| 185 public: | 185 public: |
| 186 std::string getShaderString() const; | 186 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 // Swizzles the red and blue component of sampled texel with alpha. | 189 // Swizzles the red and blue component of sampled texel with alpha. |
| 190 class FragmentShaderRGBATexSwizzleAlpha : public FragmentTexAlphaBinding { | 190 class FragmentShaderRGBATexSwizzleAlpha : public FragmentTexAlphaBinding { |
| 191 public: | 191 public: |
| 192 std::string getShaderString() const; | 192 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 193 }; | 193 }; |
| 194 | 194 |
| 195 // Swizzles the red and blue component of sampled texel without alpha. | 195 // Swizzles the red and blue component of sampled texel without alpha. |
| 196 class FragmentShaderRGBATexSwizzleOpaque : public FragmentTexOpaqueBinding { | 196 class FragmentShaderRGBATexSwizzleOpaque : public FragmentTexOpaqueBinding { |
| 197 public: | 197 public: |
| 198 std::string getShaderString() const; | 198 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 199 }; | 199 }; |
| 200 | 200 |
| 201 // Fragment shader for external textures. | 201 // Fragment shader for external textures. |
| 202 class FragmentShaderOESImageExternal : public FragmentTexAlphaBinding { | 202 class FragmentShaderOESImageExternal : public FragmentTexAlphaBinding { |
| 203 public: | 203 public: |
| 204 std::string getShaderString() const; | 204 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 205 bool init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 205 bool init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 206 private: | 206 private: |
| 207 int m_samplerLocation; | 207 int m_samplerLocation; |
| 208 }; | 208 }; |
| 209 | 209 |
| 210 class FragmentShaderRGBATexAlphaAA { | 210 class FragmentShaderRGBATexAlphaAA { |
| 211 public: | 211 public: |
| 212 FragmentShaderRGBATexAlphaAA(); | 212 FragmentShaderRGBATexAlphaAA(); |
| 213 | 213 |
| 214 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 214 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 215 std::string getShaderString() const; | 215 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 216 | 216 |
| 217 int alphaLocation() const { return m_alphaLocation; } | 217 int alphaLocation() const { return m_alphaLocation; } |
| 218 int samplerLocation() const { return m_samplerLocation; } | 218 int samplerLocation() const { return m_samplerLocation; } |
| 219 int edgeLocation() const { return m_edgeLocation; } | 219 int edgeLocation() const { return m_edgeLocation; } |
| 220 | 220 |
| 221 private: | 221 private: |
| 222 int m_samplerLocation; | 222 int m_samplerLocation; |
| 223 int m_alphaLocation; | 223 int m_alphaLocation; |
| 224 int m_edgeLocation; | 224 int m_edgeLocation; |
| 225 }; | 225 }; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 236 | 236 |
| 237 private: | 237 private: |
| 238 int m_samplerLocation; | 238 int m_samplerLocation; |
| 239 int m_alphaLocation; | 239 int m_alphaLocation; |
| 240 int m_fragmentTexTransformLocation; | 240 int m_fragmentTexTransformLocation; |
| 241 int m_edgeLocation; | 241 int m_edgeLocation; |
| 242 }; | 242 }; |
| 243 | 243 |
| 244 class FragmentShaderRGBATexClampAlphaAA : public FragmentTexClampAlphaAABinding
{ | 244 class FragmentShaderRGBATexClampAlphaAA : public FragmentTexClampAlphaAABinding
{ |
| 245 public: | 245 public: |
| 246 std::string getShaderString() const; | 246 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 247 }; | 247 }; |
| 248 | 248 |
| 249 // Swizzles the red and blue component of sampled texel. | 249 // Swizzles the red and blue component of sampled texel. |
| 250 class FragmentShaderRGBATexClampSwizzleAlphaAA : public FragmentTexClampAlphaAAB
inding { | 250 class FragmentShaderRGBATexClampSwizzleAlphaAA : public FragmentTexClampAlphaAAB
inding { |
| 251 public: | 251 public: |
| 252 std::string getShaderString() const; | 252 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 253 }; | 253 }; |
| 254 | 254 |
| 255 class FragmentShaderRGBATexAlphaMask { | 255 class FragmentShaderRGBATexAlphaMask { |
| 256 public: | 256 public: |
| 257 FragmentShaderRGBATexAlphaMask(); | 257 FragmentShaderRGBATexAlphaMask(); |
| 258 std::string getShaderString() const; | 258 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 259 | 259 |
| 260 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 260 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 261 int alphaLocation() const { return m_alphaLocation; } | 261 int alphaLocation() const { return m_alphaLocation; } |
| 262 int samplerLocation() const { return m_samplerLocation; } | 262 int samplerLocation() const { return m_samplerLocation; } |
| 263 int maskSamplerLocation() const { return m_maskSamplerLocation; } | 263 int maskSamplerLocation() const { return m_maskSamplerLocation; } |
| 264 int maskTexCoordScaleLocation() const { return m_maskTexCoordScaleLocation;
} | 264 int maskTexCoordScaleLocation() const { return m_maskTexCoordScaleLocation;
} |
| 265 int maskTexCoordOffsetLocation() const { return m_maskTexCoordOffsetLocation
; } | 265 int maskTexCoordOffsetLocation() const { return m_maskTexCoordOffsetLocation
; } |
| 266 | 266 |
| 267 private: | 267 private: |
| 268 int m_samplerLocation; | 268 int m_samplerLocation; |
| 269 int m_maskSamplerLocation; | 269 int m_maskSamplerLocation; |
| 270 int m_alphaLocation; | 270 int m_alphaLocation; |
| 271 int m_maskTexCoordScaleLocation; | 271 int m_maskTexCoordScaleLocation; |
| 272 int m_maskTexCoordOffsetLocation; | 272 int m_maskTexCoordOffsetLocation; |
| 273 }; | 273 }; |
| 274 | 274 |
| 275 class FragmentShaderRGBATexAlphaMaskAA { | 275 class FragmentShaderRGBATexAlphaMaskAA { |
| 276 public: | 276 public: |
| 277 FragmentShaderRGBATexAlphaMaskAA(); | 277 FragmentShaderRGBATexAlphaMaskAA(); |
| 278 std::string getShaderString() const; | 278 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 279 | 279 |
| 280 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 280 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 281 int alphaLocation() const { return m_alphaLocation; } | 281 int alphaLocation() const { return m_alphaLocation; } |
| 282 int samplerLocation() const { return m_samplerLocation; } | 282 int samplerLocation() const { return m_samplerLocation; } |
| 283 int maskSamplerLocation() const { return m_maskSamplerLocation; } | 283 int maskSamplerLocation() const { return m_maskSamplerLocation; } |
| 284 int edgeLocation() const { return m_edgeLocation; } | 284 int edgeLocation() const { return m_edgeLocation; } |
| 285 int maskTexCoordScaleLocation() const { return m_maskTexCoordScaleLocation;
} | 285 int maskTexCoordScaleLocation() const { return m_maskTexCoordScaleLocation;
} |
| 286 int maskTexCoordOffsetLocation() const { return m_maskTexCoordOffsetLocation
; } | 286 int maskTexCoordOffsetLocation() const { return m_maskTexCoordOffsetLocation
; } |
| 287 | 287 |
| 288 private: | 288 private: |
| 289 int m_samplerLocation; | 289 int m_samplerLocation; |
| 290 int m_maskSamplerLocation; | 290 int m_maskSamplerLocation; |
| 291 int m_alphaLocation; | 291 int m_alphaLocation; |
| 292 int m_edgeLocation; | 292 int m_edgeLocation; |
| 293 int m_maskTexCoordScaleLocation; | 293 int m_maskTexCoordScaleLocation; |
| 294 int m_maskTexCoordOffsetLocation; | 294 int m_maskTexCoordOffsetLocation; |
| 295 }; | 295 }; |
| 296 | 296 |
| 297 class FragmentShaderYUVVideo { | 297 class FragmentShaderYUVVideo { |
| 298 public: | 298 public: |
| 299 FragmentShaderYUVVideo(); | 299 FragmentShaderYUVVideo(); |
| 300 std::string getShaderString() const; | 300 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 301 | 301 |
| 302 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 302 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 303 | 303 |
| 304 int yTextureLocation() const { return m_yTextureLocation; } | 304 int yTextureLocation() const { return m_yTextureLocation; } |
| 305 int uTextureLocation() const { return m_uTextureLocation; } | 305 int uTextureLocation() const { return m_uTextureLocation; } |
| 306 int vTextureLocation() const { return m_vTextureLocation; } | 306 int vTextureLocation() const { return m_vTextureLocation; } |
| 307 int alphaLocation() const { return m_alphaLocation; } | 307 int alphaLocation() const { return m_alphaLocation; } |
| 308 int yuvMatrixLocation() const { return m_yuvMatrixLocation; } | 308 int yuvMatrixLocation() const { return m_yuvMatrixLocation; } |
| 309 int yuvAdjLocation() const { return m_yuvAdjLocation; } | 309 int yuvAdjLocation() const { return m_yuvAdjLocation; } |
| 310 | 310 |
| 311 private: | 311 private: |
| 312 int m_yTextureLocation; | 312 int m_yTextureLocation; |
| 313 int m_uTextureLocation; | 313 int m_uTextureLocation; |
| 314 int m_vTextureLocation; | 314 int m_vTextureLocation; |
| 315 int m_alphaLocation; | 315 int m_alphaLocation; |
| 316 int m_yuvMatrixLocation; | 316 int m_yuvMatrixLocation; |
| 317 int m_yuvAdjLocation; | 317 int m_yuvAdjLocation; |
| 318 }; | 318 }; |
| 319 | 319 |
| 320 class FragmentShaderColor { | 320 class FragmentShaderColor { |
| 321 public: | 321 public: |
| 322 FragmentShaderColor(); | 322 FragmentShaderColor(); |
| 323 std::string getShaderString() const; | 323 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 324 | 324 |
| 325 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 325 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 326 int colorLocation() const { return m_colorLocation; } | 326 int colorLocation() const { return m_colorLocation; } |
| 327 | 327 |
| 328 private: | 328 private: |
| 329 int m_colorLocation; | 329 int m_colorLocation; |
| 330 }; | 330 }; |
| 331 | 331 |
| 332 class FragmentShaderCheckerboard { | 332 class FragmentShaderCheckerboard { |
| 333 public: | 333 public: |
| 334 FragmentShaderCheckerboard(); | 334 FragmentShaderCheckerboard(); |
| 335 std::string getShaderString() const; | 335 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 336 | 336 |
| 337 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 337 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 338 int alphaLocation() const { return m_alphaLocation; } | 338 int alphaLocation() const { return m_alphaLocation; } |
| 339 int texTransformLocation() const { return m_texTransformLocation; } | 339 int texTransformLocation() const { return m_texTransformLocation; } |
| 340 int frequencyLocation() const { return m_frequencyLocation; } | 340 int frequencyLocation() const { return m_frequencyLocation; } |
| 341 int colorLocation() const { return m_colorLocation; } | 341 int colorLocation() const { return m_colorLocation; } |
| 342 private: | 342 private: |
| 343 int m_alphaLocation; | 343 int m_alphaLocation; |
| 344 int m_texTransformLocation; | 344 int m_texTransformLocation; |
| 345 int m_frequencyLocation; | 345 int m_frequencyLocation; |
| 346 int m_colorLocation; | 346 int m_colorLocation; |
| 347 }; | 347 }; |
| 348 | 348 |
| 349 } // namespace cc | 349 } // namespace cc |
| 350 | 350 |
| 351 #endif // CC_SHADER_H_ | 351 #endif // CC_SHADER_H_ |
| OLD | NEW |