| 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_OUTPUT_SHADER_H_ | 5 #ifndef CC_OUTPUT_SHADER_H_ |
| 6 #define CC_OUTPUT_SHADER_H_ | 6 #define CC_OUTPUT_SHADER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include "third_party/skia/include/core/SkColorPriv.h" | 9 #include "third_party/skia/include/core/SkColorPriv.h" |
| 10 | 10 |
| 11 namespace gfx { |
| 12 class Point; |
| 13 } |
| 14 |
| 11 namespace WebKit { | 15 namespace WebKit { |
| 12 class WebGraphicsContext3D; | 16 class WebGraphicsContext3D; |
| 13 } | 17 } |
| 14 | 18 |
| 15 namespace cc { | 19 namespace cc { |
| 16 | 20 |
| 21 enum TexCoordPrecision { |
| 22 TexCoordPrecisionNA, |
| 23 TexCoordPrecisionMedium, |
| 24 TexCoordPrecisionHigh, |
| 25 }; |
| 26 |
| 27 // This currently only considers the source size because it can be slow |
| 28 // for the caller to also provide the destination size on screen. |
| 29 TexCoordPrecision TexCoordPrecisionRequired(const gfx::Point &max_coordinate); |
| 30 |
| 17 class VertexShaderPosTex { | 31 class VertexShaderPosTex { |
| 18 public: | 32 public: |
| 19 VertexShaderPosTex(); | 33 VertexShaderPosTex(); |
| 20 | 34 |
| 21 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 35 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 22 std::string getShaderString() const; | 36 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 23 | 37 |
| 24 int matrixLocation() const { return m_matrixLocation; } | 38 int matrixLocation() const { return m_matrixLocation; } |
| 25 | 39 |
| 26 private: | 40 private: |
| 27 int m_matrixLocation; | 41 int m_matrixLocation; |
| 28 }; | 42 }; |
| 29 | 43 |
| 30 class VertexShaderPosTexYUVStretch { | 44 class VertexShaderPosTexYUVStretch { |
| 31 public: | 45 public: |
| 32 VertexShaderPosTexYUVStretch(); | 46 VertexShaderPosTexYUVStretch(); |
| 33 | 47 |
| 34 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 48 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 35 std::string getShaderString() const; | 49 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 36 | 50 |
| 37 int matrixLocation() const { return m_matrixLocation; } | 51 int matrixLocation() const { return m_matrixLocation; } |
| 38 int texScaleLocation() const { return m_texScaleLocation; } | 52 int texScaleLocation() const { return m_texScaleLocation; } |
| 39 | 53 |
| 40 private: | 54 private: |
| 41 int m_matrixLocation; | 55 int m_matrixLocation; |
| 42 int m_texScaleLocation; | 56 int m_texScaleLocation; |
| 43 }; | 57 }; |
| 44 | 58 |
| 45 class VertexShaderPos { | 59 class VertexShaderPos { |
| 46 public: | 60 public: |
| 47 VertexShaderPos(); | 61 VertexShaderPos(); |
| 48 | 62 |
| 49 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 63 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 50 std::string getShaderString() const; | 64 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 51 | 65 |
| 52 int matrixLocation() const { return m_matrixLocation; } | 66 int matrixLocation() const { return m_matrixLocation; } |
| 53 | 67 |
| 54 private: | 68 private: |
| 55 int m_matrixLocation; | 69 int m_matrixLocation; |
| 56 }; | 70 }; |
| 57 | 71 |
| 58 class VertexShaderPosTexIdentity { | 72 class VertexShaderPosTexIdentity { |
| 59 public: | 73 public: |
| 60 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex) { } | 74 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex) { } |
| 61 std::string getShaderString() const; | 75 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 62 }; | 76 }; |
| 63 | 77 |
| 64 class VertexShaderPosTexTransform { | 78 class VertexShaderPosTexTransform { |
| 65 public: | 79 public: |
| 66 VertexShaderPosTexTransform(); | 80 VertexShaderPosTexTransform(); |
| 67 | 81 |
| 68 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 82 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 69 std::string getShaderString() const; | 83 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 70 | 84 |
| 71 int matrixLocation() const { return m_matrixLocation; } | 85 int matrixLocation() const { return m_matrixLocation; } |
| 72 int texTransformLocation() const { return m_texTransformLocation; } | 86 int texTransformLocation() const { return m_texTransformLocation; } |
| 73 int vertexOpacityLocation() const { return m_vertexOpacityLocation; } | 87 int vertexOpacityLocation() const { return m_vertexOpacityLocation; } |
| 74 | 88 |
| 75 private: | 89 private: |
| 76 int m_matrixLocation; | 90 int m_matrixLocation; |
| 77 int m_texTransformLocation; | 91 int m_texTransformLocation; |
| 78 int m_vertexOpacityLocation; | 92 int m_vertexOpacityLocation; |
| 79 }; | 93 }; |
| 80 | 94 |
| 81 class VertexShaderPosTexTransformFlip : public VertexShaderPosTexTransform { | 95 class VertexShaderPosTexTransformFlip : public VertexShaderPosTexTransform { |
| 82 public: | 96 public: |
| 83 std::string getShaderString() const; | 97 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 84 }; | 98 }; |
| 85 | 99 |
| 86 class VertexShaderQuad { | 100 class VertexShaderQuad { |
| 87 public: | 101 public: |
| 88 VertexShaderQuad(); | 102 VertexShaderQuad(); |
| 89 | 103 |
| 90 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 104 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 91 std::string getShaderString() const; | 105 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 92 | 106 |
| 93 int matrixLocation() const { return m_matrixLocation; } | 107 int matrixLocation() const { return m_matrixLocation; } |
| 94 int pointLocation() const { return m_pointLocation; } | 108 int pointLocation() const { return m_pointLocation; } |
| 95 int texScaleLocation() const { return m_texScaleLocation; } | 109 int texScaleLocation() const { return m_texScaleLocation; } |
| 96 | 110 |
| 97 private: | 111 private: |
| 98 int m_matrixLocation; | 112 int m_matrixLocation; |
| 99 int m_pointLocation; | 113 int m_pointLocation; |
| 100 int m_texScaleLocation; | 114 int m_texScaleLocation; |
| 101 }; | 115 }; |
| 102 | 116 |
| 103 class VertexShaderTile { | 117 class VertexShaderTile { |
| 104 public: | 118 public: |
| 105 VertexShaderTile(); | 119 VertexShaderTile(); |
| 106 | 120 |
| 107 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 121 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 108 std::string getShaderString() const; | 122 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 109 | 123 |
| 110 int matrixLocation() const { return m_matrixLocation; } | 124 int matrixLocation() const { return m_matrixLocation; } |
| 111 int pointLocation() const { return m_pointLocation; } | 125 int pointLocation() const { return m_pointLocation; } |
| 112 int vertexTexTransformLocation() const { return m_vertexTexTransformLocation
; } | 126 int vertexTexTransformLocation() const { return m_vertexTexTransformLocation
; } |
| 113 | 127 |
| 114 private: | 128 private: |
| 115 int m_matrixLocation; | 129 int m_matrixLocation; |
| 116 int m_pointLocation; | 130 int m_pointLocation; |
| 117 int m_vertexTexTransformLocation; | 131 int m_vertexTexTransformLocation; |
| 118 }; | 132 }; |
| 119 | 133 |
| 120 class VertexShaderVideoTransform { | 134 class VertexShaderVideoTransform { |
| 121 public: | 135 public: |
| 122 VertexShaderVideoTransform(); | 136 VertexShaderVideoTransform(); |
| 123 | 137 |
| 124 bool init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 138 bool init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 125 std::string getShaderString() const; | 139 std::string getShaderString(WebKit::WebGraphicsContext3D* context) const; |
| 126 | 140 |
| 127 int matrixLocation() const { return m_matrixLocation; } | 141 int matrixLocation() const { return m_matrixLocation; } |
| 128 int texMatrixLocation() const { return m_texMatrixLocation; } | 142 int texMatrixLocation() const { return m_texMatrixLocation; } |
| 129 | 143 |
| 130 private: | 144 private: |
| 131 int m_matrixLocation; | 145 int m_matrixLocation; |
| 132 int m_texMatrixLocation; | 146 int m_texMatrixLocation; |
| 133 }; | 147 }; |
| 134 | 148 |
| 135 class FragmentTexAlphaBinding { | 149 class FragmentTexAlphaBinding { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 156 int edgeLocation() const { return -1; } | 170 int edgeLocation() const { return -1; } |
| 157 int fragmentTexTransformLocation() const { return -1; } | 171 int fragmentTexTransformLocation() const { return -1; } |
| 158 int samplerLocation() const { return m_samplerLocation; } | 172 int samplerLocation() const { return m_samplerLocation; } |
| 159 | 173 |
| 160 private: | 174 private: |
| 161 int m_samplerLocation; | 175 int m_samplerLocation; |
| 162 }; | 176 }; |
| 163 | 177 |
| 164 class FragmentShaderRGBATexVaryingAlpha : public FragmentTexOpaqueBinding { | 178 class FragmentShaderRGBATexVaryingAlpha : public FragmentTexOpaqueBinding { |
| 165 public: | 179 public: |
| 166 std::string getShaderString() const; | 180 std::string getShaderString(WebKit::WebGraphicsContext3D* context, |
| 181 TexCoordPrecision precision) const; |
| 167 }; | 182 }; |
| 168 | 183 |
| 169 class FragmentShaderRGBATexAlpha : public FragmentTexAlphaBinding { | 184 class FragmentShaderRGBATexAlpha : public FragmentTexAlphaBinding { |
| 170 public: | 185 public: |
| 171 std::string getShaderString() const; | 186 std::string getShaderString(WebKit::WebGraphicsContext3D* context, |
| 187 TexCoordPrecision precision) const; |
| 172 }; | 188 }; |
| 173 | 189 |
| 174 class FragmentShaderRGBATexRectVaryingAlpha : public FragmentTexAlphaBinding { | 190 class FragmentShaderRGBATexRectVaryingAlpha : public FragmentTexAlphaBinding { |
| 175 public: | 191 public: |
| 176 std::string getShaderString() const; | 192 std::string getShaderString(WebKit::WebGraphicsContext3D* context, |
| 193 TexCoordPrecision precision) const; |
| 177 }; | 194 }; |
| 178 | 195 |
| 179 class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding { | 196 class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding { |
| 180 public: | 197 public: |
| 181 std::string getShaderString() const; | 198 std::string getShaderString(WebKit::WebGraphicsContext3D* context, |
| 199 TexCoordPrecision precision) const; |
| 182 }; | 200 }; |
| 183 | 201 |
| 184 class FragmentShaderRGBATex : public FragmentTexOpaqueBinding { | 202 class FragmentShaderRGBATex : public FragmentTexOpaqueBinding { |
| 185 public: | 203 public: |
| 186 std::string getShaderString() const; | 204 std::string getShaderString(WebKit::WebGraphicsContext3D* context, |
| 205 TexCoordPrecision precision) const; |
| 187 }; | 206 }; |
| 188 | 207 |
| 189 // Swizzles the red and blue component of sampled texel with alpha. | 208 // Swizzles the red and blue component of sampled texel with alpha. |
| 190 class FragmentShaderRGBATexSwizzleAlpha : public FragmentTexAlphaBinding { | 209 class FragmentShaderRGBATexSwizzleAlpha : public FragmentTexAlphaBinding { |
| 191 public: | 210 public: |
| 192 std::string getShaderString() const; | 211 std::string getShaderString(WebKit::WebGraphicsContext3D* context, |
| 212 TexCoordPrecision precision) const; |
| 193 }; | 213 }; |
| 194 | 214 |
| 195 // Swizzles the red and blue component of sampled texel without alpha. | 215 // Swizzles the red and blue component of sampled texel without alpha. |
| 196 class FragmentShaderRGBATexSwizzleOpaque : public FragmentTexOpaqueBinding { | 216 class FragmentShaderRGBATexSwizzleOpaque : public FragmentTexOpaqueBinding { |
| 197 public: | 217 public: |
| 198 std::string getShaderString() const; | 218 std::string getShaderString(WebKit::WebGraphicsContext3D* context, |
| 219 TexCoordPrecision precision) const; |
| 199 }; | 220 }; |
| 200 | 221 |
| 201 // Fragment shader for external textures. | 222 // Fragment shader for external textures. |
| 202 class FragmentShaderOESImageExternal : public FragmentTexAlphaBinding { | 223 class FragmentShaderOESImageExternal : public FragmentTexAlphaBinding { |
| 203 public: | 224 public: |
| 204 std::string getShaderString() const; | 225 std::string getShaderString(WebKit::WebGraphicsContext3D* context, |
| 226 TexCoordPrecision precision) const; |
| 205 bool init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 227 bool init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 206 private: | 228 private: |
| 207 int m_samplerLocation; | 229 int m_samplerLocation; |
| 208 }; | 230 }; |
| 209 | 231 |
| 210 class FragmentShaderRGBATexAlphaAA { | 232 class FragmentShaderRGBATexAlphaAA { |
| 211 public: | 233 public: |
| 212 FragmentShaderRGBATexAlphaAA(); | 234 FragmentShaderRGBATexAlphaAA(); |
| 213 | 235 |
| 214 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 236 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 215 std::string getShaderString() const; | 237 std::string getShaderString(WebKit::WebGraphicsContext3D* context, |
| 238 TexCoordPrecision precision) const; |
| 216 | 239 |
| 217 int alphaLocation() const { return m_alphaLocation; } | 240 int alphaLocation() const { return m_alphaLocation; } |
| 218 int samplerLocation() const { return m_samplerLocation; } | 241 int samplerLocation() const { return m_samplerLocation; } |
| 219 int edgeLocation() const { return m_edgeLocation; } | 242 int edgeLocation() const { return m_edgeLocation; } |
| 220 | 243 |
| 221 private: | 244 private: |
| 222 int m_samplerLocation; | 245 int m_samplerLocation; |
| 223 int m_alphaLocation; | 246 int m_alphaLocation; |
| 224 int m_edgeLocation; | 247 int m_edgeLocation; |
| 225 }; | 248 }; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 236 | 259 |
| 237 private: | 260 private: |
| 238 int m_samplerLocation; | 261 int m_samplerLocation; |
| 239 int m_alphaLocation; | 262 int m_alphaLocation; |
| 240 int m_fragmentTexTransformLocation; | 263 int m_fragmentTexTransformLocation; |
| 241 int m_edgeLocation; | 264 int m_edgeLocation; |
| 242 }; | 265 }; |
| 243 | 266 |
| 244 class FragmentShaderRGBATexClampAlphaAA : public FragmentTexClampAlphaAABinding
{ | 267 class FragmentShaderRGBATexClampAlphaAA : public FragmentTexClampAlphaAABinding
{ |
| 245 public: | 268 public: |
| 246 std::string getShaderString() const; | 269 std::string getShaderString(WebKit::WebGraphicsContext3D* context, |
| 270 TexCoordPrecision precision) const; |
| 247 }; | 271 }; |
| 248 | 272 |
| 249 // Swizzles the red and blue component of sampled texel. | 273 // Swizzles the red and blue component of sampled texel. |
| 250 class FragmentShaderRGBATexClampSwizzleAlphaAA : public FragmentTexClampAlphaAAB
inding { | 274 class FragmentShaderRGBATexClampSwizzleAlphaAA : public FragmentTexClampAlphaAAB
inding { |
| 251 public: | 275 public: |
| 252 std::string getShaderString() const; | 276 std::string getShaderString(WebKit::WebGraphicsContext3D* context, |
| 277 TexCoordPrecision precision) const; |
| 253 }; | 278 }; |
| 254 | 279 |
| 255 class FragmentShaderRGBATexAlphaMask { | 280 class FragmentShaderRGBATexAlphaMask { |
| 256 public: | 281 public: |
| 257 FragmentShaderRGBATexAlphaMask(); | 282 FragmentShaderRGBATexAlphaMask(); |
| 258 std::string getShaderString() const; | 283 std::string getShaderString(WebKit::WebGraphicsContext3D* context, |
| 284 TexCoordPrecision precision) const; |
| 259 | 285 |
| 260 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 286 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 261 int alphaLocation() const { return m_alphaLocation; } | 287 int alphaLocation() const { return m_alphaLocation; } |
| 262 int samplerLocation() const { return m_samplerLocation; } | 288 int samplerLocation() const { return m_samplerLocation; } |
| 263 int maskSamplerLocation() const { return m_maskSamplerLocation; } | 289 int maskSamplerLocation() const { return m_maskSamplerLocation; } |
| 264 int maskTexCoordScaleLocation() const { return m_maskTexCoordScaleLocation;
} | 290 int maskTexCoordScaleLocation() const { return m_maskTexCoordScaleLocation;
} |
| 265 int maskTexCoordOffsetLocation() const { return m_maskTexCoordOffsetLocation
; } | 291 int maskTexCoordOffsetLocation() const { return m_maskTexCoordOffsetLocation
; } |
| 266 | 292 |
| 267 private: | 293 private: |
| 268 int m_samplerLocation; | 294 int m_samplerLocation; |
| 269 int m_maskSamplerLocation; | 295 int m_maskSamplerLocation; |
| 270 int m_alphaLocation; | 296 int m_alphaLocation; |
| 271 int m_maskTexCoordScaleLocation; | 297 int m_maskTexCoordScaleLocation; |
| 272 int m_maskTexCoordOffsetLocation; | 298 int m_maskTexCoordOffsetLocation; |
| 273 }; | 299 }; |
| 274 | 300 |
| 275 class FragmentShaderRGBATexAlphaMaskAA { | 301 class FragmentShaderRGBATexAlphaMaskAA { |
| 276 public: | 302 public: |
| 277 FragmentShaderRGBATexAlphaMaskAA(); | 303 FragmentShaderRGBATexAlphaMaskAA(); |
| 278 std::string getShaderString() const; | 304 std::string getShaderString(WebKit::WebGraphicsContext3D* context, |
| 305 TexCoordPrecision precision) const; |
| 279 | 306 |
| 280 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 307 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 281 int alphaLocation() const { return m_alphaLocation; } | 308 int alphaLocation() const { return m_alphaLocation; } |
| 282 int samplerLocation() const { return m_samplerLocation; } | 309 int samplerLocation() const { return m_samplerLocation; } |
| 283 int maskSamplerLocation() const { return m_maskSamplerLocation; } | 310 int maskSamplerLocation() const { return m_maskSamplerLocation; } |
| 284 int edgeLocation() const { return m_edgeLocation; } | 311 int edgeLocation() const { return m_edgeLocation; } |
| 285 int maskTexCoordScaleLocation() const { return m_maskTexCoordScaleLocation;
} | 312 int maskTexCoordScaleLocation() const { return m_maskTexCoordScaleLocation;
} |
| 286 int maskTexCoordOffsetLocation() const { return m_maskTexCoordOffsetLocation
; } | 313 int maskTexCoordOffsetLocation() const { return m_maskTexCoordOffsetLocation
; } |
| 287 | 314 |
| 288 private: | 315 private: |
| 289 int m_samplerLocation; | 316 int m_samplerLocation; |
| 290 int m_maskSamplerLocation; | 317 int m_maskSamplerLocation; |
| 291 int m_alphaLocation; | 318 int m_alphaLocation; |
| 292 int m_edgeLocation; | 319 int m_edgeLocation; |
| 293 int m_maskTexCoordScaleLocation; | 320 int m_maskTexCoordScaleLocation; |
| 294 int m_maskTexCoordOffsetLocation; | 321 int m_maskTexCoordOffsetLocation; |
| 295 }; | 322 }; |
| 296 | 323 |
| 297 class FragmentShaderYUVVideo { | 324 class FragmentShaderYUVVideo { |
| 298 public: | 325 public: |
| 299 FragmentShaderYUVVideo(); | 326 FragmentShaderYUVVideo(); |
| 300 std::string getShaderString() const; | 327 std::string getShaderString(WebKit::WebGraphicsContext3D* context, |
| 328 TexCoordPrecision precision) const; |
| 301 | 329 |
| 302 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 330 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 303 | 331 |
| 304 int yTextureLocation() const { return m_yTextureLocation; } | 332 int yTextureLocation() const { return m_yTextureLocation; } |
| 305 int uTextureLocation() const { return m_uTextureLocation; } | 333 int uTextureLocation() const { return m_uTextureLocation; } |
| 306 int vTextureLocation() const { return m_vTextureLocation; } | 334 int vTextureLocation() const { return m_vTextureLocation; } |
| 307 int alphaLocation() const { return m_alphaLocation; } | 335 int alphaLocation() const { return m_alphaLocation; } |
| 308 int yuvMatrixLocation() const { return m_yuvMatrixLocation; } | 336 int yuvMatrixLocation() const { return m_yuvMatrixLocation; } |
| 309 int yuvAdjLocation() const { return m_yuvAdjLocation; } | 337 int yuvAdjLocation() const { return m_yuvAdjLocation; } |
| 310 | 338 |
| 311 private: | 339 private: |
| 312 int m_yTextureLocation; | 340 int m_yTextureLocation; |
| 313 int m_uTextureLocation; | 341 int m_uTextureLocation; |
| 314 int m_vTextureLocation; | 342 int m_vTextureLocation; |
| 315 int m_alphaLocation; | 343 int m_alphaLocation; |
| 316 int m_yuvMatrixLocation; | 344 int m_yuvMatrixLocation; |
| 317 int m_yuvAdjLocation; | 345 int m_yuvAdjLocation; |
| 318 }; | 346 }; |
| 319 | 347 |
| 320 class FragmentShaderColor { | 348 class FragmentShaderColor { |
| 321 public: | 349 public: |
| 322 FragmentShaderColor(); | 350 FragmentShaderColor(); |
| 323 std::string getShaderString() const; | 351 std::string getShaderString(WebKit::WebGraphicsContext3D* context, |
| 352 TexCoordPrecision precision) const; |
| 324 | 353 |
| 325 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 354 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 326 int edgeLocation() const { return -1; } | 355 int edgeLocation() const { return -1; } |
| 327 int colorLocation() const { return m_colorLocation; } | 356 int colorLocation() const { return m_colorLocation; } |
| 328 | 357 |
| 329 private: | 358 private: |
| 330 int m_colorLocation; | 359 int m_colorLocation; |
| 331 }; | 360 }; |
| 332 | 361 |
| 333 class FragmentShaderColorAA { | 362 class FragmentShaderColorAA { |
| 334 public: | 363 public: |
| 335 FragmentShaderColorAA(); | 364 FragmentShaderColorAA(); |
| 336 std::string getShaderString() const; | 365 std::string getShaderString(WebKit::WebGraphicsContext3D* context, |
| 366 TexCoordPrecision precision) const; |
| 337 | 367 |
| 338 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 368 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 339 int edgeLocation() const { return m_edgeLocation; } | 369 int edgeLocation() const { return m_edgeLocation; } |
| 340 int colorLocation() const { return m_colorLocation; } | 370 int colorLocation() const { return m_colorLocation; } |
| 341 | 371 |
| 342 private: | 372 private: |
| 343 int m_edgeLocation; | 373 int m_edgeLocation; |
| 344 int m_colorLocation; | 374 int m_colorLocation; |
| 345 }; | 375 }; |
| 346 | 376 |
| 347 class FragmentShaderCheckerboard { | 377 class FragmentShaderCheckerboard { |
| 348 public: | 378 public: |
| 349 FragmentShaderCheckerboard(); | 379 FragmentShaderCheckerboard(); |
| 350 std::string getShaderString() const; | 380 std::string getShaderString(WebKit::WebGraphicsContext3D* context, |
| 381 TexCoordPrecision precision) const; |
| 351 | 382 |
| 352 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 383 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); |
| 353 int alphaLocation() const { return m_alphaLocation; } | 384 int alphaLocation() const { return m_alphaLocation; } |
| 354 int texTransformLocation() const { return m_texTransformLocation; } | 385 int texTransformLocation() const { return m_texTransformLocation; } |
| 355 int frequencyLocation() const { return m_frequencyLocation; } | 386 int frequencyLocation() const { return m_frequencyLocation; } |
| 356 int colorLocation() const { return m_colorLocation; } | 387 int colorLocation() const { return m_colorLocation; } |
| 357 private: | 388 private: |
| 358 int m_alphaLocation; | 389 int m_alphaLocation; |
| 359 int m_texTransformLocation; | 390 int m_texTransformLocation; |
| 360 int m_frequencyLocation; | 391 int m_frequencyLocation; |
| 361 int m_colorLocation; | 392 int m_colorLocation; |
| 362 }; | 393 }; |
| 363 | 394 |
| 364 } // namespace cc | 395 } // namespace cc |
| 365 | 396 |
| 366 #endif // CC_OUTPUT_SHADER_H_ | 397 #endif // CC_OUTPUT_SHADER_H_ |
| OLD | NEW |