| 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 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*, |
| 22 std::string getShaderString() const; | 22 unsigned program, |
| 23 | 23 bool using_bind_uniform, |
| 24 int matrixLocation() const { return m_matrixLocation; } | 24 int* base_uniform_index); |
| 25 | 25 std::string GetShaderString() const; |
| 26 private: | 26 |
| 27 int m_matrixLocation; | 27 int matrix_location() const { return matrix_location_; } |
| 28 |
| 29 private: |
| 30 int matrix_location_; |
| 28 }; | 31 }; |
| 29 | 32 |
| 30 class VertexShaderPosTexYUVStretch { | 33 class VertexShaderPosTexYUVStretch { |
| 31 public: | 34 public: |
| 32 VertexShaderPosTexYUVStretch(); | 35 VertexShaderPosTexYUVStretch(); |
| 33 | 36 |
| 34 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 37 void Init(WebKit::WebGraphicsContext3D*, |
| 35 std::string getShaderString() const; | 38 unsigned program, |
| 36 | 39 bool using_bind_uniform, |
| 37 int matrixLocation() const { return m_matrixLocation; } | 40 int* base_uniform_index); |
| 38 int texScaleLocation() const { return m_texScaleLocation; } | 41 std::string GetShaderString() const; |
| 39 | 42 |
| 40 private: | 43 int matrix_location() const { return matrix_location_; } |
| 41 int m_matrixLocation; | 44 int tex_scale_location() const { return tex_scale_location_; } |
| 42 int m_texScaleLocation; | 45 |
| 46 private: |
| 47 int matrix_location_; |
| 48 int tex_scale_location_; |
| 43 }; | 49 }; |
| 44 | 50 |
| 45 class VertexShaderPos { | 51 class VertexShaderPos { |
| 46 public: | 52 public: |
| 47 VertexShaderPos(); | 53 VertexShaderPos(); |
| 48 | 54 |
| 49 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 55 void Init(WebKit::WebGraphicsContext3D*, |
| 50 std::string getShaderString() const; | 56 unsigned program, |
| 51 | 57 bool using_bind_uniform, |
| 52 int matrixLocation() const { return m_matrixLocation; } | 58 int* base_uniform_index); |
| 53 | 59 std::string GetShaderString() const; |
| 54 private: | 60 |
| 55 int m_matrixLocation; | 61 int matrix_location() const { return matrix_location_; } |
| 62 |
| 63 private: |
| 64 int matrix_location_; |
| 56 }; | 65 }; |
| 57 | 66 |
| 58 class VertexShaderPosTexIdentity { | 67 class VertexShaderPosTexIdentity { |
| 59 public: | 68 public: |
| 60 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex) { } | 69 void Init(WebKit::WebGraphicsContext3D*, |
| 61 std::string getShaderString() const; | 70 unsigned program, |
| 71 bool using_bind_uniform, |
| 72 int* base_uniform_index) { } |
| 73 std::string GetShaderString() const; |
| 62 }; | 74 }; |
| 63 | 75 |
| 64 class VertexShaderPosTexTransform { | 76 class VertexShaderPosTexTransform { |
| 65 public: | 77 public: |
| 66 VertexShaderPosTexTransform(); | 78 VertexShaderPosTexTransform(); |
| 67 | 79 |
| 68 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 80 void Init(WebKit::WebGraphicsContext3D*, |
| 69 std::string getShaderString() const; | 81 unsigned program, |
| 70 | 82 bool using_bind_uniform, |
| 71 int matrixLocation() const { return m_matrixLocation; } | 83 int* base_uniform_index); |
| 72 int texTransformLocation() const { return m_texTransformLocation; } | 84 std::string GetShaderString() const; |
| 73 int vertexOpacityLocation() const { return m_vertexOpacityLocation; } | 85 |
| 74 | 86 int matrix_location() const { return matrix_location_; } |
| 75 private: | 87 int tex_transform_location() const { return tex_transform_location_; } |
| 76 int m_matrixLocation; | 88 int vertex_opacity_location() const { return vertex_opacity_location_; } |
| 77 int m_texTransformLocation; | 89 |
| 78 int m_vertexOpacityLocation; | 90 private: |
| 91 int matrix_location_; |
| 92 int tex_transform_location_; |
| 93 int vertex_opacity_location_; |
| 79 }; | 94 }; |
| 80 | 95 |
| 81 class VertexShaderPosTexTransformFlip : public VertexShaderPosTexTransform { | 96 class VertexShaderPosTexTransformFlip : public VertexShaderPosTexTransform { |
| 82 public: | 97 public: |
| 83 std::string getShaderString() const; | 98 std::string GetShaderString() const; |
| 84 }; | 99 }; |
| 85 | 100 |
| 86 class VertexShaderQuad { | 101 class VertexShaderQuad { |
| 87 public: | 102 public: |
| 88 VertexShaderQuad(); | 103 VertexShaderQuad(); |
| 89 | 104 |
| 90 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 105 void Init(WebKit::WebGraphicsContext3D*, |
| 91 std::string getShaderString() const; | 106 unsigned program, |
| 92 | 107 bool using_bind_uniform, |
| 93 int matrixLocation() const { return m_matrixLocation; } | 108 int* base_uniform_index); |
| 94 int pointLocation() const { return m_pointLocation; } | 109 std::string GetShaderString() const; |
| 95 int texScaleLocation() const { return m_texScaleLocation; } | 110 |
| 96 | 111 int matrix_location() const { return matrix_location_; } |
| 97 private: | 112 int point_location() const { return point_location_; } |
| 98 int m_matrixLocation; | 113 int tex_scale_location() const { return tex_scale_location_; } |
| 99 int m_pointLocation; | 114 |
| 100 int m_texScaleLocation; | 115 private: |
| 116 int matrix_location_; |
| 117 int point_location_; |
| 118 int tex_scale_location_; |
| 101 }; | 119 }; |
| 102 | 120 |
| 103 class VertexShaderTile { | 121 class VertexShaderTile { |
| 104 public: | 122 public: |
| 105 VertexShaderTile(); | 123 VertexShaderTile(); |
| 106 | 124 |
| 107 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 125 void Init(WebKit::WebGraphicsContext3D*, |
| 108 std::string getShaderString() const; | 126 unsigned program, |
| 109 | 127 bool using_bind_uniform, |
| 110 int matrixLocation() const { return m_matrixLocation; } | 128 int* base_uniform_index); |
| 111 int pointLocation() const { return m_pointLocation; } | 129 std::string GetShaderString() const; |
| 112 int vertexTexTransformLocation() const { return m_vertexTexTransformLocation
; } | 130 |
| 113 | 131 int matrix_location() const { return matrix_location_; } |
| 114 private: | 132 int point_location() const { return point_location_; } |
| 115 int m_matrixLocation; | 133 int vertex_tex_transform_location() const { |
| 116 int m_pointLocation; | 134 return vertex_tex_transform_location_; |
| 117 int m_vertexTexTransformLocation; | 135 } |
| 136 |
| 137 private: |
| 138 int matrix_location_; |
| 139 int point_location_; |
| 140 int vertex_tex_transform_location_; |
| 118 }; | 141 }; |
| 119 | 142 |
| 120 class VertexShaderVideoTransform { | 143 class VertexShaderVideoTransform { |
| 121 public: | 144 public: |
| 122 VertexShaderVideoTransform(); | 145 VertexShaderVideoTransform(); |
| 123 | 146 |
| 124 bool init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 147 bool Init(WebKit::WebGraphicsContext3D*, |
| 125 std::string getShaderString() const; | 148 unsigned program, |
| 126 | 149 bool using_bind_uniform, |
| 127 int matrixLocation() const { return m_matrixLocation; } | 150 int* base_uniform_index); |
| 128 int texMatrixLocation() const { return m_texMatrixLocation; } | 151 std::string GetShaderString() const; |
| 129 | 152 |
| 130 private: | 153 int matrix_location() const { return matrix_location_; } |
| 131 int m_matrixLocation; | 154 int tex_matrix_location() const { return tex_matrix_location_; } |
| 132 int m_texMatrixLocation; | 155 |
| 156 private: |
| 157 int matrix_location_; |
| 158 int tex_matrix_location_; |
| 133 }; | 159 }; |
| 134 | 160 |
| 135 class FragmentTexAlphaBinding { | 161 class FragmentTexAlphaBinding { |
| 136 public: | 162 public: |
| 137 FragmentTexAlphaBinding(); | 163 FragmentTexAlphaBinding(); |
| 138 | 164 |
| 139 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 165 void Init(WebKit::WebGraphicsContext3D*, |
| 140 int alphaLocation() const { return m_alphaLocation; } | 166 unsigned program, |
| 141 int edgeLocation() const { return -1; } | 167 bool using_bind_uniform, |
| 142 int fragmentTexTransformLocation() const { return -1; } | 168 int* base_uniform_index); |
| 143 int samplerLocation() const { return m_samplerLocation; } | 169 int alpha_location() const { return alpha_location_; } |
| 144 | 170 int edge_location() const { return -1; } |
| 145 private: | 171 int fragment_tex_transform_location() const { return -1; } |
| 146 int m_samplerLocation; | 172 int sampler_location() const { return sampler_location_; } |
| 147 int m_alphaLocation; | 173 |
| 174 private: |
| 175 int sampler_location_; |
| 176 int alpha_location_; |
| 148 }; | 177 }; |
| 149 | 178 |
| 150 class FragmentTexOpaqueBinding { | 179 class FragmentTexOpaqueBinding { |
| 151 public: | 180 public: |
| 152 FragmentTexOpaqueBinding(); | 181 FragmentTexOpaqueBinding(); |
| 153 | 182 |
| 154 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 183 void Init(WebKit::WebGraphicsContext3D*, |
| 155 int alphaLocation() const { return -1; } | 184 unsigned program, |
| 156 int edgeLocation() const { return -1; } | 185 bool using_bind_uniform, |
| 157 int fragmentTexTransformLocation() const { return -1; } | 186 int* base_uniform_index); |
| 158 int samplerLocation() const { return m_samplerLocation; } | 187 int alpha_location() const { return -1; } |
| 159 | 188 int edge_location() const { return -1; } |
| 160 private: | 189 int fragment_tex_transform_location() const { return -1; } |
| 161 int m_samplerLocation; | 190 int sampler_location() const { return sampler_location_; } |
| 191 |
| 192 private: |
| 193 int sampler_location_; |
| 162 }; | 194 }; |
| 163 | 195 |
| 164 class FragmentShaderRGBATexVaryingAlpha : public FragmentTexOpaqueBinding { | 196 class FragmentShaderRGBATexVaryingAlpha : public FragmentTexOpaqueBinding { |
| 165 public: | 197 public: |
| 166 std::string getShaderString() const; | 198 std::string GetShaderString() const; |
| 167 }; | 199 }; |
| 168 | 200 |
| 169 class FragmentShaderRGBATexAlpha : public FragmentTexAlphaBinding { | 201 class FragmentShaderRGBATexAlpha : public FragmentTexAlphaBinding { |
| 170 public: | 202 public: |
| 171 std::string getShaderString() const; | 203 std::string GetShaderString() const; |
| 172 }; | 204 }; |
| 173 | 205 |
| 174 class FragmentShaderRGBATexRectVaryingAlpha : public FragmentTexAlphaBinding { | 206 class FragmentShaderRGBATexRectVaryingAlpha : public FragmentTexAlphaBinding { |
| 175 public: | 207 public: |
| 176 std::string getShaderString() const; | 208 std::string GetShaderString() const; |
| 177 }; | 209 }; |
| 178 | 210 |
| 179 class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding { | 211 class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding { |
| 180 public: | 212 public: |
| 181 std::string getShaderString() const; | 213 std::string GetShaderString() const; |
| 182 }; | 214 }; |
| 183 | 215 |
| 184 class FragmentShaderRGBATex : public FragmentTexOpaqueBinding { | 216 class FragmentShaderRGBATex : public FragmentTexOpaqueBinding { |
| 185 public: | 217 public: |
| 186 std::string getShaderString() const; | 218 std::string GetShaderString() const; |
| 187 }; | 219 }; |
| 188 | 220 |
| 189 // Swizzles the red and blue component of sampled texel with alpha. | 221 // Swizzles the red and blue component of sampled texel with alpha. |
| 190 class FragmentShaderRGBATexSwizzleAlpha : public FragmentTexAlphaBinding { | 222 class FragmentShaderRGBATexSwizzleAlpha : public FragmentTexAlphaBinding { |
| 191 public: | 223 public: |
| 192 std::string getShaderString() const; | 224 std::string GetShaderString() const; |
| 193 }; | 225 }; |
| 194 | 226 |
| 195 // Swizzles the red and blue component of sampled texel without alpha. | 227 // Swizzles the red and blue component of sampled texel without alpha. |
| 196 class FragmentShaderRGBATexSwizzleOpaque : public FragmentTexOpaqueBinding { | 228 class FragmentShaderRGBATexSwizzleOpaque : public FragmentTexOpaqueBinding { |
| 197 public: | 229 public: |
| 198 std::string getShaderString() const; | 230 std::string GetShaderString() const; |
| 199 }; | 231 }; |
| 200 | 232 |
| 201 // Fragment shader for external textures. | 233 // Fragment shader for external textures. |
| 202 class FragmentShaderOESImageExternal : public FragmentTexAlphaBinding { | 234 class FragmentShaderOESImageExternal : public FragmentTexAlphaBinding { |
| 203 public: | 235 public: |
| 204 std::string getShaderString() const; | 236 std::string GetShaderString() const; |
| 205 bool init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 237 bool Init(WebKit::WebGraphicsContext3D*, |
| 206 private: | 238 unsigned program, |
| 207 int m_samplerLocation; | 239 bool using_bind_uniform, |
| 240 int* base_uniform_index); |
| 241 private: |
| 242 int sampler_location_; |
| 208 }; | 243 }; |
| 209 | 244 |
| 210 class FragmentShaderRGBATexAlphaAA { | 245 class FragmentShaderRGBATexAlphaAA { |
| 211 public: | 246 public: |
| 212 FragmentShaderRGBATexAlphaAA(); | 247 FragmentShaderRGBATexAlphaAA(); |
| 213 | 248 |
| 214 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 249 void Init(WebKit::WebGraphicsContext3D*, |
| 215 std::string getShaderString() const; | 250 unsigned program, |
| 216 | 251 bool using_bind_uniform, |
| 217 int alphaLocation() const { return m_alphaLocation; } | 252 int* base_uniform_index); |
| 218 int samplerLocation() const { return m_samplerLocation; } | 253 std::string GetShaderString() const; |
| 219 int edgeLocation() const { return m_edgeLocation; } | 254 |
| 220 | 255 int alpha_location() const { return alpha_location_; } |
| 221 private: | 256 int sampler_location() const { return sampler_location_; } |
| 222 int m_samplerLocation; | 257 int edge_location() const { return edge_location_; } |
| 223 int m_alphaLocation; | 258 |
| 224 int m_edgeLocation; | 259 private: |
| 260 int sampler_location_; |
| 261 int alpha_location_; |
| 262 int edge_location_; |
| 225 }; | 263 }; |
| 226 | 264 |
| 227 class FragmentTexClampAlphaAABinding { | 265 class FragmentTexClampAlphaAABinding { |
| 228 public: | 266 public: |
| 229 FragmentTexClampAlphaAABinding(); | 267 FragmentTexClampAlphaAABinding(); |
| 230 | 268 |
| 231 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 269 void Init(WebKit::WebGraphicsContext3D*, |
| 232 int alphaLocation() const { return m_alphaLocation; } | 270 unsigned program, |
| 233 int samplerLocation() const { return m_samplerLocation; } | 271 bool using_bind_uniform, |
| 234 int fragmentTexTransformLocation() const { return m_fragmentTexTransformLoca
tion; } | 272 int* base_uniform_index); |
| 235 int edgeLocation() const { return m_edgeLocation; } | 273 int alpha_location() const { return alpha_location_; } |
| 236 | 274 int sampler_location() const { return sampler_location_; } |
| 237 private: | 275 int fragment_tex_transform_location() const { |
| 238 int m_samplerLocation; | 276 return fragment_tex_transform_location_; |
| 239 int m_alphaLocation; | 277 } |
| 240 int m_fragmentTexTransformLocation; | 278 int edge_location() const { return edge_location_; } |
| 241 int m_edgeLocation; | 279 |
| 242 }; | 280 private: |
| 243 | 281 int sampler_location_; |
| 244 class FragmentShaderRGBATexClampAlphaAA : public FragmentTexClampAlphaAABinding
{ | 282 int alpha_location_; |
| 245 public: | 283 int fragment_tex_transform_location_; |
| 246 std::string getShaderString() const; | 284 int edge_location_; |
| 285 }; |
| 286 |
| 287 class FragmentShaderRGBATexClampAlphaAA : |
| 288 public FragmentTexClampAlphaAABinding { |
| 289 public: |
| 290 std::string GetShaderString() const; |
| 247 }; | 291 }; |
| 248 | 292 |
| 249 // Swizzles the red and blue component of sampled texel. | 293 // Swizzles the red and blue component of sampled texel. |
| 250 class FragmentShaderRGBATexClampSwizzleAlphaAA : public FragmentTexClampAlphaAAB
inding { | 294 class FragmentShaderRGBATexClampSwizzleAlphaAA : |
| 251 public: | 295 public FragmentTexClampAlphaAABinding { |
| 252 std::string getShaderString() const; | 296 public: |
| 297 std::string GetShaderString() const; |
| 253 }; | 298 }; |
| 254 | 299 |
| 255 class FragmentShaderRGBATexAlphaMask { | 300 class FragmentShaderRGBATexAlphaMask { |
| 256 public: | 301 public: |
| 257 FragmentShaderRGBATexAlphaMask(); | 302 FragmentShaderRGBATexAlphaMask(); |
| 258 std::string getShaderString() const; | 303 std::string GetShaderString() const; |
| 259 | 304 |
| 260 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 305 void Init(WebKit::WebGraphicsContext3D*, |
| 261 int alphaLocation() const { return m_alphaLocation; } | 306 unsigned program, |
| 262 int samplerLocation() const { return m_samplerLocation; } | 307 bool using_bind_uniform, |
| 263 int maskSamplerLocation() const { return m_maskSamplerLocation; } | 308 int* base_uniform_index); |
| 264 int maskTexCoordScaleLocation() const { return m_maskTexCoordScaleLocation;
} | 309 int alpha_location() const { return alpha_location_; } |
| 265 int maskTexCoordOffsetLocation() const { return m_maskTexCoordOffsetLocation
; } | 310 int sampler_location() const { return sampler_location_; } |
| 266 | 311 int mask_sampler_location() const { return mask_sampler_location_; } |
| 267 private: | 312 int mask_tex_coord_scale_location() const { |
| 268 int m_samplerLocation; | 313 return mask_tex_coord_scale_location_; |
| 269 int m_maskSamplerLocation; | 314 } |
| 270 int m_alphaLocation; | 315 int mask_tex_coord_offset_location() const { |
| 271 int m_maskTexCoordScaleLocation; | 316 return mask_tex_coord_offset_location_; |
| 272 int m_maskTexCoordOffsetLocation; | 317 } |
| 318 |
| 319 private: |
| 320 int sampler_location_; |
| 321 int mask_sampler_location_; |
| 322 int alpha_location_; |
| 323 int mask_tex_coord_scale_location_; |
| 324 int mask_tex_coord_offset_location_; |
| 273 }; | 325 }; |
| 274 | 326 |
| 275 class FragmentShaderRGBATexAlphaMaskAA { | 327 class FragmentShaderRGBATexAlphaMaskAA { |
| 276 public: | 328 public: |
| 277 FragmentShaderRGBATexAlphaMaskAA(); | 329 FragmentShaderRGBATexAlphaMaskAA(); |
| 278 std::string getShaderString() const; | 330 std::string GetShaderString() const; |
| 279 | 331 |
| 280 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 332 void Init(WebKit::WebGraphicsContext3D*, |
| 281 int alphaLocation() const { return m_alphaLocation; } | 333 unsigned program, |
| 282 int samplerLocation() const { return m_samplerLocation; } | 334 bool using_bind_uniform, |
| 283 int maskSamplerLocation() const { return m_maskSamplerLocation; } | 335 int* base_uniform_index); |
| 284 int edgeLocation() const { return m_edgeLocation; } | 336 int alpha_location() const { return alpha_location_; } |
| 285 int maskTexCoordScaleLocation() const { return m_maskTexCoordScaleLocation;
} | 337 int sampler_location() const { return sampler_location_; } |
| 286 int maskTexCoordOffsetLocation() const { return m_maskTexCoordOffsetLocation
; } | 338 int mask_sampler_location() const { return mask_sampler_location_; } |
| 287 | 339 int edge_location() const { return edge_location_; } |
| 288 private: | 340 int mask_tex_coord_scale_location() const { |
| 289 int m_samplerLocation; | 341 return mask_tex_coord_scale_location_; |
| 290 int m_maskSamplerLocation; | 342 } |
| 291 int m_alphaLocation; | 343 int mask_tex_coord_offset_location() const { |
| 292 int m_edgeLocation; | 344 return mask_tex_coord_offset_location_; |
| 293 int m_maskTexCoordScaleLocation; | 345 } |
| 294 int m_maskTexCoordOffsetLocation; | 346 |
| 347 private: |
| 348 int sampler_location_; |
| 349 int mask_sampler_location_; |
| 350 int alpha_location_; |
| 351 int edge_location_; |
| 352 int mask_tex_coord_scale_location_; |
| 353 int mask_tex_coord_offset_location_; |
| 295 }; | 354 }; |
| 296 | 355 |
| 297 class FragmentShaderYUVVideo { | 356 class FragmentShaderYUVVideo { |
| 298 public: | 357 public: |
| 299 FragmentShaderYUVVideo(); | 358 FragmentShaderYUVVideo(); |
| 300 std::string getShaderString() const; | 359 std::string GetShaderString() const; |
| 301 | 360 |
| 302 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 361 void Init(WebKit::WebGraphicsContext3D*, |
| 303 | 362 unsigned program, |
| 304 int yTextureLocation() const { return m_yTextureLocation; } | 363 bool using_bind_uniform, |
| 305 int uTextureLocation() const { return m_uTextureLocation; } | 364 int* base_uniform_index); |
| 306 int vTextureLocation() const { return m_vTextureLocation; } | 365 int y_texture_location() const { return y_texture_location_; } |
| 307 int alphaLocation() const { return m_alphaLocation; } | 366 int u_texture_location() const { return u_texture_location_; } |
| 308 int yuvMatrixLocation() const { return m_yuvMatrixLocation; } | 367 int v_texture_location() const { return v_texture_location_; } |
| 309 int yuvAdjLocation() const { return m_yuvAdjLocation; } | 368 int alpha_location() const { return alpha_location_; } |
| 310 | 369 int yuv_matrix_location() const { return yuv_matrix_location_; } |
| 311 private: | 370 int yuv_adj_location() const { return yuv_adj_location_; } |
| 312 int m_yTextureLocation; | 371 |
| 313 int m_uTextureLocation; | 372 private: |
| 314 int m_vTextureLocation; | 373 int y_texture_location_; |
| 315 int m_alphaLocation; | 374 int u_texture_location_; |
| 316 int m_yuvMatrixLocation; | 375 int v_texture_location_; |
| 317 int m_yuvAdjLocation; | 376 int alpha_location_; |
| 377 int yuv_matrix_location_; |
| 378 int yuv_adj_location_; |
| 318 }; | 379 }; |
| 319 | 380 |
| 320 class FragmentShaderColor { | 381 class FragmentShaderColor { |
| 321 public: | 382 public: |
| 322 FragmentShaderColor(); | 383 FragmentShaderColor(); |
| 323 std::string getShaderString() const; | 384 std::string GetShaderString() const; |
| 324 | 385 |
| 325 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 386 void Init(WebKit::WebGraphicsContext3D*, |
| 326 int edgeLocation() const { return -1; } | 387 unsigned program, |
| 327 int colorLocation() const { return m_colorLocation; } | 388 bool using_bind_uniform, |
| 328 | 389 int* base_uniform_index); |
| 329 private: | 390 int edge_location() const { return -1; } |
| 330 int m_colorLocation; | 391 int color_location() const { return color_location_; } |
| 392 |
| 393 private: |
| 394 int color_location_; |
| 331 }; | 395 }; |
| 332 | 396 |
| 333 class FragmentShaderColorAA { | 397 class FragmentShaderColorAA { |
| 334 public: | 398 public: |
| 335 FragmentShaderColorAA(); | 399 FragmentShaderColorAA(); |
| 336 std::string getShaderString() const; | 400 std::string GetShaderString() const; |
| 337 | 401 |
| 338 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 402 void Init(WebKit::WebGraphicsContext3D*, |
| 339 int edgeLocation() const { return m_edgeLocation; } | 403 unsigned program, |
| 340 int colorLocation() const { return m_colorLocation; } | 404 bool using_bind_uniform, |
| 341 | 405 int* base_uniform_index); |
| 342 private: | 406 int edge_location() const { return edge_location_; } |
| 343 int m_edgeLocation; | 407 int color_location() const { return color_location_; } |
| 344 int m_colorLocation; | 408 |
| 409 private: |
| 410 int edge_location_; |
| 411 int color_location_; |
| 345 }; | 412 }; |
| 346 | 413 |
| 347 class FragmentShaderCheckerboard { | 414 class FragmentShaderCheckerboard { |
| 348 public: | 415 public: |
| 349 FragmentShaderCheckerboard(); | 416 FragmentShaderCheckerboard(); |
| 350 std::string getShaderString() const; | 417 std::string GetShaderString() const; |
| 351 | 418 |
| 352 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni
form, int* baseUniformIndex); | 419 void Init(WebKit::WebGraphicsContext3D*, |
| 353 int alphaLocation() const { return m_alphaLocation; } | 420 unsigned program, |
| 354 int texTransformLocation() const { return m_texTransformLocation; } | 421 bool using_bind_uniform, |
| 355 int frequencyLocation() const { return m_frequencyLocation; } | 422 int* base_uniform_index); |
| 356 int colorLocation() const { return m_colorLocation; } | 423 int alpha_location() const { return alpha_location_; } |
| 357 private: | 424 int tex_transform_location() const { return tex_transform_location_; } |
| 358 int m_alphaLocation; | 425 int frequency_location() const { return frequency_location_; } |
| 359 int m_texTransformLocation; | 426 int color_location() const { return color_location_; } |
| 360 int m_frequencyLocation; | 427 |
| 361 int m_colorLocation; | 428 private: |
| 429 int alpha_location_; |
| 430 int tex_transform_location_; |
| 431 int frequency_location_; |
| 432 int color_location_; |
| 362 }; | 433 }; |
| 363 | 434 |
| 364 } // namespace cc | 435 } // namespace cc |
| 365 | 436 |
| 366 #endif // CC_OUTPUT_SHADER_H_ | 437 #endif // CC_OUTPUT_SHADER_H_ |
| OLD | NEW |