| 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 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "cc/base/cc_export.h" |
| 11 #include "third_party/skia/include/core/SkColorPriv.h" | 12 #include "third_party/skia/include/core/SkColorPriv.h" |
| 12 | 13 |
| 14 namespace gfx { |
| 15 class Point; |
| 16 class Size; |
| 17 } |
| 18 |
| 13 namespace WebKit { | 19 namespace WebKit { |
| 14 class WebGraphicsContext3D; | 20 class WebGraphicsContext3D; |
| 15 } | 21 } |
| 16 | 22 |
| 17 namespace cc { | 23 namespace cc { |
| 18 | 24 |
| 25 enum TexCoordPrecision { |
| 26 TexCoordPrecisionNA, |
| 27 TexCoordPrecisionMedium, |
| 28 TexCoordPrecisionHigh, |
| 29 }; |
| 30 |
| 31 CC_EXPORT TexCoordPrecision TexCoordPrecisionRequired( |
| 32 WebKit::WebGraphicsContext3D* context, |
| 33 int highp_threshold_min, |
| 34 const gfx::Point& max_coordinate); |
| 35 |
| 36 CC_EXPORT TexCoordPrecision TexCoordPrecisionRequired( |
| 37 WebKit::WebGraphicsContext3D* context, |
| 38 int highp_threshold_min, |
| 39 const gfx::Size& max_size); |
| 40 |
| 19 class VertexShaderPosTex { | 41 class VertexShaderPosTex { |
| 20 public: | 42 public: |
| 21 VertexShaderPosTex(); | 43 VertexShaderPosTex(); |
| 22 | 44 |
| 23 void Init(WebKit::WebGraphicsContext3D*, | 45 void Init(WebKit::WebGraphicsContext3D*, |
| 24 unsigned program, | 46 unsigned program, |
| 25 bool using_bind_uniform, | 47 bool using_bind_uniform, |
| 26 int* base_uniform_index); | 48 int* base_uniform_index); |
| 27 std::string GetShaderString() const; | 49 std::string GetShaderString() const; |
| 28 | 50 |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 int sampler_location() const { return sampler_location_; } | 252 int sampler_location() const { return sampler_location_; } |
| 231 | 253 |
| 232 private: | 254 private: |
| 233 int sampler_location_; | 255 int sampler_location_; |
| 234 | 256 |
| 235 DISALLOW_COPY_AND_ASSIGN(FragmentTexOpaqueBinding); | 257 DISALLOW_COPY_AND_ASSIGN(FragmentTexOpaqueBinding); |
| 236 }; | 258 }; |
| 237 | 259 |
| 238 class FragmentShaderRGBATexVaryingAlpha : public FragmentTexOpaqueBinding { | 260 class FragmentShaderRGBATexVaryingAlpha : public FragmentTexOpaqueBinding { |
| 239 public: | 261 public: |
| 240 std::string GetShaderString() const; | 262 std::string GetShaderString(TexCoordPrecision precision) const; |
| 241 }; | 263 }; |
| 242 | 264 |
| 243 class FragmentShaderRGBATexAlpha : public FragmentTexAlphaBinding { | 265 class FragmentShaderRGBATexAlpha : public FragmentTexAlphaBinding { |
| 244 public: | 266 public: |
| 245 std::string GetShaderString() const; | 267 std::string GetShaderString(TexCoordPrecision precision) const; |
| 246 }; | 268 }; |
| 247 | 269 |
| 248 class FragmentShaderRGBATexColorMatrixAlpha | 270 class FragmentShaderRGBATexColorMatrixAlpha |
| 249 : public FragmentTexColorMatrixAlphaBinding { | 271 : public FragmentTexColorMatrixAlphaBinding { |
| 250 public: | 272 public: |
| 251 std::string GetShaderString() const; | 273 std::string GetShaderString(TexCoordPrecision precision) const; |
| 252 }; | 274 }; |
| 253 | 275 |
| 254 class FragmentShaderRGBATexRectVaryingAlpha : public FragmentTexAlphaBinding { | 276 class FragmentShaderRGBATexRectVaryingAlpha : public FragmentTexAlphaBinding { |
| 255 public: | 277 public: |
| 256 std::string GetShaderString() const; | 278 std::string GetShaderString(TexCoordPrecision precision) const; |
| 257 }; | 279 }; |
| 258 | 280 |
| 259 class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding { | 281 class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding { |
| 260 public: | 282 public: |
| 261 std::string GetShaderString() const; | 283 std::string GetShaderString(TexCoordPrecision precision) const; |
| 262 }; | 284 }; |
| 263 | 285 |
| 264 class FragmentShaderRGBATex : public FragmentTexOpaqueBinding { | 286 class FragmentShaderRGBATex : public FragmentTexOpaqueBinding { |
| 265 public: | 287 public: |
| 266 std::string GetShaderString() const; | 288 std::string GetShaderString(TexCoordPrecision precision) const; |
| 267 }; | 289 }; |
| 268 | 290 |
| 269 // Swizzles the red and blue component of sampled texel with alpha. | 291 // Swizzles the red and blue component of sampled texel with alpha. |
| 270 class FragmentShaderRGBATexSwizzleAlpha : public FragmentTexAlphaBinding { | 292 class FragmentShaderRGBATexSwizzleAlpha : public FragmentTexAlphaBinding { |
| 271 public: | 293 public: |
| 272 std::string GetShaderString() const; | 294 std::string GetShaderString(TexCoordPrecision precision) const; |
| 273 }; | 295 }; |
| 274 | 296 |
| 275 // Swizzles the red and blue component of sampled texel without alpha. | 297 // Swizzles the red and blue component of sampled texel without alpha. |
| 276 class FragmentShaderRGBATexSwizzleOpaque : public FragmentTexOpaqueBinding { | 298 class FragmentShaderRGBATexSwizzleOpaque : public FragmentTexOpaqueBinding { |
| 277 public: | 299 public: |
| 278 std::string GetShaderString() const; | 300 std::string GetShaderString(TexCoordPrecision precision) const; |
| 279 }; | 301 }; |
| 280 | 302 |
| 281 // Fragment shader for external textures. | 303 // Fragment shader for external textures. |
| 282 class FragmentShaderOESImageExternal : public FragmentTexAlphaBinding { | 304 class FragmentShaderOESImageExternal : public FragmentTexAlphaBinding { |
| 283 public: | 305 public: |
| 284 FragmentShaderOESImageExternal(); | 306 FragmentShaderOESImageExternal(); |
| 285 | 307 |
| 286 std::string GetShaderString() const; | 308 std::string GetShaderString(TexCoordPrecision precision) const; |
| 287 bool Init(WebKit::WebGraphicsContext3D*, | 309 bool Init(WebKit::WebGraphicsContext3D*, |
| 288 unsigned program, | 310 unsigned program, |
| 289 bool using_bind_uniform, | 311 bool using_bind_uniform, |
| 290 int* base_uniform_index); | 312 int* base_uniform_index); |
| 291 private: | 313 private: |
| 292 int sampler_location_; | 314 int sampler_location_; |
| 293 | 315 |
| 294 DISALLOW_COPY_AND_ASSIGN(FragmentShaderOESImageExternal); | 316 DISALLOW_COPY_AND_ASSIGN(FragmentShaderOESImageExternal); |
| 295 }; | 317 }; |
| 296 | 318 |
| 297 class FragmentShaderRGBATexAlphaAA { | 319 class FragmentShaderRGBATexAlphaAA { |
| 298 public: | 320 public: |
| 299 FragmentShaderRGBATexAlphaAA(); | 321 FragmentShaderRGBATexAlphaAA(); |
| 300 | 322 |
| 301 void Init(WebKit::WebGraphicsContext3D*, | 323 void Init(WebKit::WebGraphicsContext3D*, |
| 302 unsigned program, | 324 unsigned program, |
| 303 bool using_bind_uniform, | 325 bool using_bind_uniform, |
| 304 int* base_uniform_index); | 326 int* base_uniform_index); |
| 305 std::string GetShaderString() const; | 327 std::string GetShaderString(TexCoordPrecision precision) const; |
| 306 | 328 |
| 307 int alpha_location() const { return alpha_location_; } | 329 int alpha_location() const { return alpha_location_; } |
| 308 int sampler_location() const { return sampler_location_; } | 330 int sampler_location() const { return sampler_location_; } |
| 309 int edge_location() const { return edge_location_; } | 331 int edge_location() const { return edge_location_; } |
| 310 | 332 |
| 311 private: | 333 private: |
| 312 int sampler_location_; | 334 int sampler_location_; |
| 313 int alpha_location_; | 335 int alpha_location_; |
| 314 int edge_location_; | 336 int edge_location_; |
| 315 | 337 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 336 int alpha_location_; | 358 int alpha_location_; |
| 337 int fragment_tex_transform_location_; | 359 int fragment_tex_transform_location_; |
| 338 int edge_location_; | 360 int edge_location_; |
| 339 | 361 |
| 340 DISALLOW_COPY_AND_ASSIGN(FragmentTexClampAlphaAABinding); | 362 DISALLOW_COPY_AND_ASSIGN(FragmentTexClampAlphaAABinding); |
| 341 }; | 363 }; |
| 342 | 364 |
| 343 class FragmentShaderRGBATexClampAlphaAA | 365 class FragmentShaderRGBATexClampAlphaAA |
| 344 : public FragmentTexClampAlphaAABinding { | 366 : public FragmentTexClampAlphaAABinding { |
| 345 public: | 367 public: |
| 346 std::string GetShaderString() const; | 368 std::string GetShaderString(TexCoordPrecision precision) const; |
| 347 }; | 369 }; |
| 348 | 370 |
| 349 // Swizzles the red and blue component of sampled texel. | 371 // Swizzles the red and blue component of sampled texel. |
| 350 class FragmentShaderRGBATexClampSwizzleAlphaAA | 372 class FragmentShaderRGBATexClampSwizzleAlphaAA |
| 351 : public FragmentTexClampAlphaAABinding { | 373 : public FragmentTexClampAlphaAABinding { |
| 352 public: | 374 public: |
| 353 std::string GetShaderString() const; | 375 std::string GetShaderString(TexCoordPrecision precision) const; |
| 354 }; | 376 }; |
| 355 | 377 |
| 356 class FragmentShaderRGBATexAlphaMask { | 378 class FragmentShaderRGBATexAlphaMask { |
| 357 public: | 379 public: |
| 358 FragmentShaderRGBATexAlphaMask(); | 380 FragmentShaderRGBATexAlphaMask(); |
| 359 std::string GetShaderString() const; | 381 std::string GetShaderString(TexCoordPrecision precision) const; |
| 360 | 382 |
| 361 void Init(WebKit::WebGraphicsContext3D*, | 383 void Init(WebKit::WebGraphicsContext3D*, |
| 362 unsigned program, | 384 unsigned program, |
| 363 bool using_bind_uniform, | 385 bool using_bind_uniform, |
| 364 int* base_uniform_index); | 386 int* base_uniform_index); |
| 365 int alpha_location() const { return alpha_location_; } | 387 int alpha_location() const { return alpha_location_; } |
| 366 int sampler_location() const { return sampler_location_; } | 388 int sampler_location() const { return sampler_location_; } |
| 367 int mask_sampler_location() const { return mask_sampler_location_; } | 389 int mask_sampler_location() const { return mask_sampler_location_; } |
| 368 int mask_tex_coord_scale_location() const { | 390 int mask_tex_coord_scale_location() const { |
| 369 return mask_tex_coord_scale_location_; | 391 return mask_tex_coord_scale_location_; |
| 370 } | 392 } |
| 371 int mask_tex_coord_offset_location() const { | 393 int mask_tex_coord_offset_location() const { |
| 372 return mask_tex_coord_offset_location_; | 394 return mask_tex_coord_offset_location_; |
| 373 } | 395 } |
| 374 | 396 |
| 375 private: | 397 private: |
| 376 int sampler_location_; | 398 int sampler_location_; |
| 377 int mask_sampler_location_; | 399 int mask_sampler_location_; |
| 378 int alpha_location_; | 400 int alpha_location_; |
| 379 int mask_tex_coord_scale_location_; | 401 int mask_tex_coord_scale_location_; |
| 380 int mask_tex_coord_offset_location_; | 402 int mask_tex_coord_offset_location_; |
| 381 | 403 |
| 382 DISALLOW_COPY_AND_ASSIGN(FragmentShaderRGBATexAlphaMask); | 404 DISALLOW_COPY_AND_ASSIGN(FragmentShaderRGBATexAlphaMask); |
| 383 }; | 405 }; |
| 384 | 406 |
| 385 class FragmentShaderRGBATexAlphaMaskAA { | 407 class FragmentShaderRGBATexAlphaMaskAA { |
| 386 public: | 408 public: |
| 387 FragmentShaderRGBATexAlphaMaskAA(); | 409 FragmentShaderRGBATexAlphaMaskAA(); |
| 388 std::string GetShaderString() const; | 410 std::string GetShaderString(TexCoordPrecision precision) const; |
| 389 | 411 |
| 390 void Init(WebKit::WebGraphicsContext3D*, | 412 void Init(WebKit::WebGraphicsContext3D*, |
| 391 unsigned program, | 413 unsigned program, |
| 392 bool using_bind_uniform, | 414 bool using_bind_uniform, |
| 393 int* base_uniform_index); | 415 int* base_uniform_index); |
| 394 int alpha_location() const { return alpha_location_; } | 416 int alpha_location() const { return alpha_location_; } |
| 395 int sampler_location() const { return sampler_location_; } | 417 int sampler_location() const { return sampler_location_; } |
| 396 int mask_sampler_location() const { return mask_sampler_location_; } | 418 int mask_sampler_location() const { return mask_sampler_location_; } |
| 397 int edge_location() const { return edge_location_; } | 419 int edge_location() const { return edge_location_; } |
| 398 int mask_tex_coord_scale_location() const { | 420 int mask_tex_coord_scale_location() const { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 409 int edge_location_; | 431 int edge_location_; |
| 410 int mask_tex_coord_scale_location_; | 432 int mask_tex_coord_scale_location_; |
| 411 int mask_tex_coord_offset_location_; | 433 int mask_tex_coord_offset_location_; |
| 412 | 434 |
| 413 DISALLOW_COPY_AND_ASSIGN(FragmentShaderRGBATexAlphaMaskAA); | 435 DISALLOW_COPY_AND_ASSIGN(FragmentShaderRGBATexAlphaMaskAA); |
| 414 }; | 436 }; |
| 415 | 437 |
| 416 class FragmentShaderRGBATexAlphaMaskColorMatrixAA { | 438 class FragmentShaderRGBATexAlphaMaskColorMatrixAA { |
| 417 public: | 439 public: |
| 418 FragmentShaderRGBATexAlphaMaskColorMatrixAA(); | 440 FragmentShaderRGBATexAlphaMaskColorMatrixAA(); |
| 419 std::string GetShaderString() const; | 441 std::string GetShaderString(TexCoordPrecision precision) const; |
| 420 | 442 |
| 421 void Init(WebKit::WebGraphicsContext3D*, | 443 void Init(WebKit::WebGraphicsContext3D*, |
| 422 unsigned program, | 444 unsigned program, |
| 423 bool usingBindUniform, | 445 bool usingBindUniform, |
| 424 int* baseUniformIndex); | 446 int* baseUniformIndex); |
| 425 int alpha_location() const { return alpha_location_; } | 447 int alpha_location() const { return alpha_location_; } |
| 426 int sampler_location() const { return sampler_location_; } | 448 int sampler_location() const { return sampler_location_; } |
| 427 int mask_sampler_location() const { return mask_sampler_location_; } | 449 int mask_sampler_location() const { return mask_sampler_location_; } |
| 428 int edge_location() const { return edge_location_; } | 450 int edge_location() const { return edge_location_; } |
| 429 int mask_tex_coord_scale_location() const { | 451 int mask_tex_coord_scale_location() const { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 442 int edge_location_; | 464 int edge_location_; |
| 443 int mask_tex_coord_scale_location_; | 465 int mask_tex_coord_scale_location_; |
| 444 int mask_tex_coord_offset_location_; | 466 int mask_tex_coord_offset_location_; |
| 445 int color_matrix_location_; | 467 int color_matrix_location_; |
| 446 int color_offset_location_; | 468 int color_offset_location_; |
| 447 }; | 469 }; |
| 448 | 470 |
| 449 class FragmentShaderRGBATexAlphaColorMatrixAA { | 471 class FragmentShaderRGBATexAlphaColorMatrixAA { |
| 450 public: | 472 public: |
| 451 FragmentShaderRGBATexAlphaColorMatrixAA(); | 473 FragmentShaderRGBATexAlphaColorMatrixAA(); |
| 452 std::string GetShaderString() const; | 474 std::string GetShaderString(TexCoordPrecision precision) const; |
| 453 | 475 |
| 454 void Init(WebKit::WebGraphicsContext3D*, | 476 void Init(WebKit::WebGraphicsContext3D*, |
| 455 unsigned program, | 477 unsigned program, |
| 456 bool usingBindUniform, | 478 bool usingBindUniform, |
| 457 int* baseUniformIndex); | 479 int* baseUniformIndex); |
| 458 int alpha_location() const { return alpha_location_; } | 480 int alpha_location() const { return alpha_location_; } |
| 459 int sampler_location() const { return sampler_location_; } | 481 int sampler_location() const { return sampler_location_; } |
| 460 int edge_location() const { return edge_location_; } | 482 int edge_location() const { return edge_location_; } |
| 461 int color_matrix_location() const { return color_matrix_location_; } | 483 int color_matrix_location() const { return color_matrix_location_; } |
| 462 int color_offset_location() const { return color_offset_location_; } | 484 int color_offset_location() const { return color_offset_location_; } |
| 463 | 485 |
| 464 private: | 486 private: |
| 465 int sampler_location_; | 487 int sampler_location_; |
| 466 int alpha_location_; | 488 int alpha_location_; |
| 467 int edge_location_; | 489 int edge_location_; |
| 468 int color_matrix_location_; | 490 int color_matrix_location_; |
| 469 int color_offset_location_; | 491 int color_offset_location_; |
| 470 }; | 492 }; |
| 471 | 493 |
| 472 class FragmentShaderRGBATexAlphaMaskColorMatrix { | 494 class FragmentShaderRGBATexAlphaMaskColorMatrix { |
| 473 public: | 495 public: |
| 474 FragmentShaderRGBATexAlphaMaskColorMatrix(); | 496 FragmentShaderRGBATexAlphaMaskColorMatrix(); |
| 475 std::string GetShaderString() const; | 497 std::string GetShaderString(TexCoordPrecision precision) const; |
| 476 | 498 |
| 477 void Init(WebKit::WebGraphicsContext3D*, | 499 void Init(WebKit::WebGraphicsContext3D*, |
| 478 unsigned program, | 500 unsigned program, |
| 479 bool usingBindUniform, | 501 bool usingBindUniform, |
| 480 int* baseUniformIndex); | 502 int* baseUniformIndex); |
| 481 int alpha_location() const { return alpha_location_; } | 503 int alpha_location() const { return alpha_location_; } |
| 482 int sampler_location() const { return sampler_location_; } | 504 int sampler_location() const { return sampler_location_; } |
| 483 int mask_sampler_location() const { return mask_sampler_location_; } | 505 int mask_sampler_location() const { return mask_sampler_location_; } |
| 484 int mask_tex_coord_scale_location() const { | 506 int mask_tex_coord_scale_location() const { |
| 485 return mask_tex_coord_scale_location_; | 507 return mask_tex_coord_scale_location_; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 496 int alpha_location_; | 518 int alpha_location_; |
| 497 int mask_tex_coord_scale_location_; | 519 int mask_tex_coord_scale_location_; |
| 498 int mask_tex_coord_offset_location_; | 520 int mask_tex_coord_offset_location_; |
| 499 int color_matrix_location_; | 521 int color_matrix_location_; |
| 500 int color_offset_location_; | 522 int color_offset_location_; |
| 501 }; | 523 }; |
| 502 | 524 |
| 503 class FragmentShaderYUVVideo { | 525 class FragmentShaderYUVVideo { |
| 504 public: | 526 public: |
| 505 FragmentShaderYUVVideo(); | 527 FragmentShaderYUVVideo(); |
| 506 std::string GetShaderString() const; | 528 std::string GetShaderString(TexCoordPrecision precision) const; |
| 507 | 529 |
| 508 void Init(WebKit::WebGraphicsContext3D*, | 530 void Init(WebKit::WebGraphicsContext3D*, |
| 509 unsigned program, | 531 unsigned program, |
| 510 bool using_bind_uniform, | 532 bool using_bind_uniform, |
| 511 int* base_uniform_index); | 533 int* base_uniform_index); |
| 512 int y_texture_location() const { return y_texture_location_; } | 534 int y_texture_location() const { return y_texture_location_; } |
| 513 int u_texture_location() const { return u_texture_location_; } | 535 int u_texture_location() const { return u_texture_location_; } |
| 514 int v_texture_location() const { return v_texture_location_; } | 536 int v_texture_location() const { return v_texture_location_; } |
| 515 int alpha_location() const { return alpha_location_; } | 537 int alpha_location() const { return alpha_location_; } |
| 516 int yuv_matrix_location() const { return yuv_matrix_location_; } | 538 int yuv_matrix_location() const { return yuv_matrix_location_; } |
| 517 int yuv_adj_location() const { return yuv_adj_location_; } | 539 int yuv_adj_location() const { return yuv_adj_location_; } |
| 518 | 540 |
| 519 private: | 541 private: |
| 520 int y_texture_location_; | 542 int y_texture_location_; |
| 521 int u_texture_location_; | 543 int u_texture_location_; |
| 522 int v_texture_location_; | 544 int v_texture_location_; |
| 523 int alpha_location_; | 545 int alpha_location_; |
| 524 int yuv_matrix_location_; | 546 int yuv_matrix_location_; |
| 525 int yuv_adj_location_; | 547 int yuv_adj_location_; |
| 526 | 548 |
| 527 DISALLOW_COPY_AND_ASSIGN(FragmentShaderYUVVideo); | 549 DISALLOW_COPY_AND_ASSIGN(FragmentShaderYUVVideo); |
| 528 }; | 550 }; |
| 529 | 551 |
| 530 class FragmentShaderColor { | 552 class FragmentShaderColor { |
| 531 public: | 553 public: |
| 532 FragmentShaderColor(); | 554 FragmentShaderColor(); |
| 533 std::string GetShaderString() const; | 555 std::string GetShaderString(TexCoordPrecision precision) const; |
| 534 | 556 |
| 535 void Init(WebKit::WebGraphicsContext3D*, | 557 void Init(WebKit::WebGraphicsContext3D*, |
| 536 unsigned program, | 558 unsigned program, |
| 537 bool using_bind_uniform, | 559 bool using_bind_uniform, |
| 538 int* base_uniform_index); | 560 int* base_uniform_index); |
| 539 int edge_location() const { return -1; } | 561 int edge_location() const { return -1; } |
| 540 int color_location() const { return color_location_; } | 562 int color_location() const { return color_location_; } |
| 541 | 563 |
| 542 private: | 564 private: |
| 543 int color_location_; | 565 int color_location_; |
| 544 | 566 |
| 545 DISALLOW_COPY_AND_ASSIGN(FragmentShaderColor); | 567 DISALLOW_COPY_AND_ASSIGN(FragmentShaderColor); |
| 546 }; | 568 }; |
| 547 | 569 |
| 548 class FragmentShaderColorAA { | 570 class FragmentShaderColorAA { |
| 549 public: | 571 public: |
| 550 FragmentShaderColorAA(); | 572 FragmentShaderColorAA(); |
| 551 std::string GetShaderString() const; | 573 std::string GetShaderString(TexCoordPrecision precision) const; |
| 552 | 574 |
| 553 void Init(WebKit::WebGraphicsContext3D*, | 575 void Init(WebKit::WebGraphicsContext3D*, |
| 554 unsigned program, | 576 unsigned program, |
| 555 bool using_bind_uniform, | 577 bool using_bind_uniform, |
| 556 int* base_uniform_index); | 578 int* base_uniform_index); |
| 557 int edge_location() const { return edge_location_; } | 579 int edge_location() const { return edge_location_; } |
| 558 int color_location() const { return color_location_; } | 580 int color_location() const { return color_location_; } |
| 559 | 581 |
| 560 private: | 582 private: |
| 561 int edge_location_; | 583 int edge_location_; |
| 562 int color_location_; | 584 int color_location_; |
| 563 | 585 |
| 564 DISALLOW_COPY_AND_ASSIGN(FragmentShaderColorAA); | 586 DISALLOW_COPY_AND_ASSIGN(FragmentShaderColorAA); |
| 565 }; | 587 }; |
| 566 | 588 |
| 567 class FragmentShaderCheckerboard { | 589 class FragmentShaderCheckerboard { |
| 568 public: | 590 public: |
| 569 FragmentShaderCheckerboard(); | 591 FragmentShaderCheckerboard(); |
| 570 std::string GetShaderString() const; | 592 std::string GetShaderString(TexCoordPrecision precision) const; |
| 571 | 593 |
| 572 void Init(WebKit::WebGraphicsContext3D*, | 594 void Init(WebKit::WebGraphicsContext3D*, |
| 573 unsigned program, | 595 unsigned program, |
| 574 bool using_bind_uniform, | 596 bool using_bind_uniform, |
| 575 int* base_uniform_index); | 597 int* base_uniform_index); |
| 576 int alpha_location() const { return alpha_location_; } | 598 int alpha_location() const { return alpha_location_; } |
| 577 int tex_transform_location() const { return tex_transform_location_; } | 599 int tex_transform_location() const { return tex_transform_location_; } |
| 578 int frequency_location() const { return frequency_location_; } | 600 int frequency_location() const { return frequency_location_; } |
| 579 int color_location() const { return color_location_; } | 601 int color_location() const { return color_location_; } |
| 580 | 602 |
| 581 private: | 603 private: |
| 582 int alpha_location_; | 604 int alpha_location_; |
| 583 int tex_transform_location_; | 605 int tex_transform_location_; |
| 584 int frequency_location_; | 606 int frequency_location_; |
| 585 int color_location_; | 607 int color_location_; |
| 586 | 608 |
| 587 DISALLOW_COPY_AND_ASSIGN(FragmentShaderCheckerboard); | 609 DISALLOW_COPY_AND_ASSIGN(FragmentShaderCheckerboard); |
| 588 }; | 610 }; |
| 589 | 611 |
| 590 } // namespace cc | 612 } // namespace cc |
| 591 | 613 |
| 592 #endif // CC_OUTPUT_SHADER_H_ | 614 #endif // CC_OUTPUT_SHADER_H_ |
| OLD | NEW |