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