| 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 VertexShaderQuad { | 81 class VertexShaderQuad { |
| 82 public: | 82 public: |
| 83 VertexShaderQuad(); | 83 VertexShaderQuad(); |
| 84 | 84 |
| 85 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 85 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 86 std::string getShaderString() const; | 86 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 87 | 87 |
| 88 int matrixLocation() const { return m_matrixLocation; } | 88 int matrixLocation() const { return m_matrixLocation; } |
| 89 int pointLocation() const { return m_pointLocation; } | 89 int pointLocation() const { return m_pointLocation; } |
| 90 int texScaleLocation() const { return m_texScaleLocation; } | 90 int texScaleLocation() const { return m_texScaleLocation; } |
| 91 | 91 |
| 92 private: | 92 private: |
| 93 int m_matrixLocation; | 93 int m_matrixLocation; |
| 94 int m_pointLocation; | 94 int m_pointLocation; |
| 95 int m_texScaleLocation; | 95 int m_texScaleLocation; |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 class VertexShaderTile { | 98 class VertexShaderTile { |
| 99 public: | 99 public: |
| 100 VertexShaderTile(); | 100 VertexShaderTile(); |
| 101 | 101 |
| 102 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 102 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 103 std::string getShaderString() const; | 103 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 104 | 104 |
| 105 int matrixLocation() const { return m_matrixLocation; } | 105 int matrixLocation() const { return m_matrixLocation; } |
| 106 int pointLocation() const { return m_pointLocation; } | 106 int pointLocation() const { return m_pointLocation; } |
| 107 int vertexTexTransformLocation() const { return m_vertexTexTransformLocation
; } | 107 int vertexTexTransformLocation() const { return m_vertexTexTransformLocation
; } |
| 108 | 108 |
| 109 private: | 109 private: |
| 110 int m_matrixLocation; | 110 int m_matrixLocation; |
| 111 int m_pointLocation; | 111 int m_pointLocation; |
| 112 int m_vertexTexTransformLocation; | 112 int m_vertexTexTransformLocation; |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 class VertexShaderVideoTransform { | 115 class VertexShaderVideoTransform { |
| 116 public: | 116 public: |
| 117 VertexShaderVideoTransform(); | 117 VertexShaderVideoTransform(); |
| 118 | 118 |
| 119 bool init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 119 bool init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 120 std::string getShaderString() const; | 120 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 121 | 121 |
| 122 int matrixLocation() const { return m_matrixLocation; } | 122 int matrixLocation() const { return m_matrixLocation; } |
| 123 int texMatrixLocation() const { return m_texMatrixLocation; } | 123 int texMatrixLocation() const { return m_texMatrixLocation; } |
| 124 | 124 |
| 125 private: | 125 private: |
| 126 int m_matrixLocation; | 126 int m_matrixLocation; |
| 127 int m_texMatrixLocation; | 127 int m_texMatrixLocation; |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 class FragmentTexAlphaBinding { | 130 class FragmentTexAlphaBinding { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 151 int edgeLocation() const { return -1; } | 151 int edgeLocation() const { return -1; } |
| 152 int fragmentTexTransformLocation() const { return -1; } | 152 int fragmentTexTransformLocation() const { return -1; } |
| 153 int samplerLocation() const { return m_samplerLocation; } | 153 int samplerLocation() const { return m_samplerLocation; } |
| 154 | 154 |
| 155 private: | 155 private: |
| 156 int m_samplerLocation; | 156 int m_samplerLocation; |
| 157 }; | 157 }; |
| 158 | 158 |
| 159 class FragmentShaderRGBATexFlipVaryingAlpha : public FragmentTexOpaqueBinding { | 159 class FragmentShaderRGBATexFlipVaryingAlpha : public FragmentTexOpaqueBinding { |
| 160 public: | 160 public: |
| 161 std::string getShaderString() const; | 161 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 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 FragmentShaderRGBATexRectFlipVaryingAlpha : public FragmentTexAlphaBinding
{ | 174 class FragmentShaderRGBATexRectFlipVaryingAlpha : 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 FragmentShaderRGBATexRectVaryingAlpha : public FragmentTexAlphaBinding { | 179 class FragmentShaderRGBATexRectVaryingAlpha : public FragmentTexAlphaBinding { |
| 180 public: | 180 public: |
| 181 std::string getShaderString() const; | 181 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 182 }; | 182 }; |
| 183 | 183 |
| 184 class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding { | 184 class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding { |
| 185 public: | 185 public: |
| 186 std::string getShaderString() const; | 186 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 class FragmentShaderRGBATex : public FragmentTexOpaqueBinding { | 189 class FragmentShaderRGBATex : public FragmentTexOpaqueBinding { |
| 190 public: | 190 public: |
| 191 std::string getShaderString() const; | 191 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 192 }; | 192 }; |
| 193 | 193 |
| 194 // Swizzles the red and blue component of sampled texel with alpha. | 194 // Swizzles the red and blue component of sampled texel with alpha. |
| 195 class FragmentShaderRGBATexSwizzleAlpha : public FragmentTexAlphaBinding { | 195 class FragmentShaderRGBATexSwizzleAlpha : public FragmentTexAlphaBinding { |
| 196 public: | 196 public: |
| 197 std::string getShaderString() const; | 197 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 198 }; | 198 }; |
| 199 | 199 |
| 200 // Swizzles the red and blue component of sampled texel without alpha. | 200 // Swizzles the red and blue component of sampled texel without alpha. |
| 201 class FragmentShaderRGBATexSwizzleOpaque : public FragmentTexOpaqueBinding { | 201 class FragmentShaderRGBATexSwizzleOpaque : public FragmentTexOpaqueBinding { |
| 202 public: | 202 public: |
| 203 std::string getShaderString() const; | 203 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 204 }; | 204 }; |
| 205 | 205 |
| 206 // Fragment shader for external textures. | 206 // Fragment shader for external textures. |
| 207 class FragmentShaderOESImageExternal : public FragmentTexAlphaBinding { | 207 class FragmentShaderOESImageExternal : public FragmentTexAlphaBinding { |
| 208 public: | 208 public: |
| 209 std::string getShaderString() const; | 209 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 210 bool init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 210 bool init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 211 private: | 211 private: |
| 212 int m_samplerLocation; | 212 int m_samplerLocation; |
| 213 }; | 213 }; |
| 214 | 214 |
| 215 class FragmentShaderRGBATexAlphaAA { | 215 class FragmentShaderRGBATexAlphaAA { |
| 216 public: | 216 public: |
| 217 FragmentShaderRGBATexAlphaAA(); | 217 FragmentShaderRGBATexAlphaAA(); |
| 218 | 218 |
| 219 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 219 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 220 std::string getShaderString() const; | 220 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 221 | 221 |
| 222 int alphaLocation() const { return m_alphaLocation; } | 222 int alphaLocation() const { return m_alphaLocation; } |
| 223 int samplerLocation() const { return m_samplerLocation; } | 223 int samplerLocation() const { return m_samplerLocation; } |
| 224 int edgeLocation() const { return m_edgeLocation; } | 224 int edgeLocation() const { return m_edgeLocation; } |
| 225 | 225 |
| 226 private: | 226 private: |
| 227 int m_samplerLocation; | 227 int m_samplerLocation; |
| 228 int m_alphaLocation; | 228 int m_alphaLocation; |
| 229 int m_edgeLocation; | 229 int m_edgeLocation; |
| 230 }; | 230 }; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 241 | 241 |
| 242 private: | 242 private: |
| 243 int m_samplerLocation; | 243 int m_samplerLocation; |
| 244 int m_alphaLocation; | 244 int m_alphaLocation; |
| 245 int m_fragmentTexTransformLocation; | 245 int m_fragmentTexTransformLocation; |
| 246 int m_edgeLocation; | 246 int m_edgeLocation; |
| 247 }; | 247 }; |
| 248 | 248 |
| 249 class FragmentShaderRGBATexClampAlphaAA : public FragmentTexClampAlphaAABinding
{ | 249 class FragmentShaderRGBATexClampAlphaAA : public FragmentTexClampAlphaAABinding
{ |
| 250 public: | 250 public: |
| 251 std::string getShaderString() const; | 251 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 252 }; | 252 }; |
| 253 | 253 |
| 254 // Swizzles the red and blue component of sampled texel. | 254 // Swizzles the red and blue component of sampled texel. |
| 255 class FragmentShaderRGBATexClampSwizzleAlphaAA : public FragmentTexClampAlphaAAB
inding { | 255 class FragmentShaderRGBATexClampSwizzleAlphaAA : public FragmentTexClampAlphaAAB
inding { |
| 256 public: | 256 public: |
| 257 std::string getShaderString() const; | 257 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 258 }; | 258 }; |
| 259 | 259 |
| 260 class FragmentShaderRGBATexAlphaMask { | 260 class FragmentShaderRGBATexAlphaMask { |
| 261 public: | 261 public: |
| 262 FragmentShaderRGBATexAlphaMask(); | 262 FragmentShaderRGBATexAlphaMask(); |
| 263 std::string getShaderString() const; | 263 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 264 | 264 |
| 265 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 265 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 266 int alphaLocation() const { return m_alphaLocation; } | 266 int alphaLocation() const { return m_alphaLocation; } |
| 267 int samplerLocation() const { return m_samplerLocation; } | 267 int samplerLocation() const { return m_samplerLocation; } |
| 268 int maskSamplerLocation() const { return m_maskSamplerLocation; } | 268 int maskSamplerLocation() const { return m_maskSamplerLocation; } |
| 269 int maskTexCoordScaleLocation() const { return m_maskTexCoordScaleLocation;
} | 269 int maskTexCoordScaleLocation() const { return m_maskTexCoordScaleLocation;
} |
| 270 int maskTexCoordOffsetLocation() const { return m_maskTexCoordOffsetLocation
; } | 270 int maskTexCoordOffsetLocation() const { return m_maskTexCoordOffsetLocation
; } |
| 271 | 271 |
| 272 private: | 272 private: |
| 273 int m_samplerLocation; | 273 int m_samplerLocation; |
| 274 int m_maskSamplerLocation; | 274 int m_maskSamplerLocation; |
| 275 int m_alphaLocation; | 275 int m_alphaLocation; |
| 276 int m_maskTexCoordScaleLocation; | 276 int m_maskTexCoordScaleLocation; |
| 277 int m_maskTexCoordOffsetLocation; | 277 int m_maskTexCoordOffsetLocation; |
| 278 }; | 278 }; |
| 279 | 279 |
| 280 class FragmentShaderRGBATexAlphaMaskAA { | 280 class FragmentShaderRGBATexAlphaMaskAA { |
| 281 public: | 281 public: |
| 282 FragmentShaderRGBATexAlphaMaskAA(); | 282 FragmentShaderRGBATexAlphaMaskAA(); |
| 283 std::string getShaderString() const; | 283 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 284 | 284 |
| 285 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 285 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 286 int alphaLocation() const { return m_alphaLocation; } | 286 int alphaLocation() const { return m_alphaLocation; } |
| 287 int samplerLocation() const { return m_samplerLocation; } | 287 int samplerLocation() const { return m_samplerLocation; } |
| 288 int maskSamplerLocation() const { return m_maskSamplerLocation; } | 288 int maskSamplerLocation() const { return m_maskSamplerLocation; } |
| 289 int edgeLocation() const { return m_edgeLocation; } | 289 int edgeLocation() const { return m_edgeLocation; } |
| 290 int maskTexCoordScaleLocation() const { return m_maskTexCoordScaleLocation;
} | 290 int maskTexCoordScaleLocation() const { return m_maskTexCoordScaleLocation;
} |
| 291 int maskTexCoordOffsetLocation() const { return m_maskTexCoordOffsetLocation
; } | 291 int maskTexCoordOffsetLocation() const { return m_maskTexCoordOffsetLocation
; } |
| 292 | 292 |
| 293 private: | 293 private: |
| 294 int m_samplerLocation; | 294 int m_samplerLocation; |
| 295 int m_maskSamplerLocation; | 295 int m_maskSamplerLocation; |
| 296 int m_alphaLocation; | 296 int m_alphaLocation; |
| 297 int m_edgeLocation; | 297 int m_edgeLocation; |
| 298 int m_maskTexCoordScaleLocation; | 298 int m_maskTexCoordScaleLocation; |
| 299 int m_maskTexCoordOffsetLocation; | 299 int m_maskTexCoordOffsetLocation; |
| 300 }; | 300 }; |
| 301 | 301 |
| 302 class FragmentShaderYUVVideo { | 302 class FragmentShaderYUVVideo { |
| 303 public: | 303 public: |
| 304 FragmentShaderYUVVideo(); | 304 FragmentShaderYUVVideo(); |
| 305 std::string getShaderString() const; | 305 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 306 | 306 |
| 307 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 307 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 308 | 308 |
| 309 int yTextureLocation() const { return m_yTextureLocation; } | 309 int yTextureLocation() const { return m_yTextureLocation; } |
| 310 int uTextureLocation() const { return m_uTextureLocation; } | 310 int uTextureLocation() const { return m_uTextureLocation; } |
| 311 int vTextureLocation() const { return m_vTextureLocation; } | 311 int vTextureLocation() const { return m_vTextureLocation; } |
| 312 int alphaLocation() const { return m_alphaLocation; } | 312 int alphaLocation() const { return m_alphaLocation; } |
| 313 int yuvMatrixLocation() const { return m_yuvMatrixLocation; } | 313 int yuvMatrixLocation() const { return m_yuvMatrixLocation; } |
| 314 int yuvAdjLocation() const { return m_yuvAdjLocation; } | 314 int yuvAdjLocation() const { return m_yuvAdjLocation; } |
| 315 | 315 |
| 316 private: | 316 private: |
| 317 int m_yTextureLocation; | 317 int m_yTextureLocation; |
| 318 int m_uTextureLocation; | 318 int m_uTextureLocation; |
| 319 int m_vTextureLocation; | 319 int m_vTextureLocation; |
| 320 int m_alphaLocation; | 320 int m_alphaLocation; |
| 321 int m_yuvMatrixLocation; | 321 int m_yuvMatrixLocation; |
| 322 int m_yuvAdjLocation; | 322 int m_yuvAdjLocation; |
| 323 }; | 323 }; |
| 324 | 324 |
| 325 class FragmentShaderColor { | 325 class FragmentShaderColor { |
| 326 public: | 326 public: |
| 327 FragmentShaderColor(); | 327 FragmentShaderColor(); |
| 328 std::string getShaderString() const; | 328 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 329 | 329 |
| 330 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 330 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 331 int colorLocation() const { return m_colorLocation; } | 331 int colorLocation() const { return m_colorLocation; } |
| 332 | 332 |
| 333 private: | 333 private: |
| 334 int m_colorLocation; | 334 int m_colorLocation; |
| 335 }; | 335 }; |
| 336 | 336 |
| 337 class FragmentShaderCheckerboard { | 337 class FragmentShaderCheckerboard { |
| 338 public: | 338 public: |
| 339 FragmentShaderCheckerboard(); | 339 FragmentShaderCheckerboard(); |
| 340 std::string getShaderString() const; | 340 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 341 | 341 |
| 342 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 342 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 343 int alphaLocation() const { return m_alphaLocation; } | 343 int alphaLocation() const { return m_alphaLocation; } |
| 344 int texTransformLocation() const { return m_texTransformLocation; } | 344 int texTransformLocation() const { return m_texTransformLocation; } |
| 345 int frequencyLocation() const { return m_frequencyLocation; } | 345 int frequencyLocation() const { return m_frequencyLocation; } |
| 346 int colorLocation() const { return m_colorLocation; } | 346 int colorLocation() const { return m_colorLocation; } |
| 347 private: | 347 private: |
| 348 int m_alphaLocation; | 348 int m_alphaLocation; |
| 349 int m_texTransformLocation; | 349 int m_texTransformLocation; |
| 350 int m_frequencyLocation; | 350 int m_frequencyLocation; |
| 351 int m_colorLocation; | 351 int m_colorLocation; |
| 352 }; | 352 }; |
| 353 | 353 |
| 354 } // namespace cc | 354 } // namespace cc |
| 355 | 355 |
| 356 #endif // CC_SHADER_H_ | 356 #endif // CC_SHADER_H_ |
| OLD | NEW |