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" |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 class FragmentTexOpaqueBinding { | 319 class FragmentTexOpaqueBinding { |
320 public: | 320 public: |
321 FragmentTexOpaqueBinding(); | 321 FragmentTexOpaqueBinding(); |
322 | 322 |
323 void Init(WebKit::WebGraphicsContext3D* context, | 323 void Init(WebKit::WebGraphicsContext3D* context, |
324 unsigned program, | 324 unsigned program, |
325 bool using_bind_uniform, | 325 bool using_bind_uniform, |
326 int* base_uniform_index); | 326 int* base_uniform_index); |
327 int alpha_location() const { return -1; } | 327 int alpha_location() const { return -1; } |
328 int fragment_tex_transform_location() const { return -1; } | 328 int fragment_tex_transform_location() const { return -1; } |
| 329 int background_color_location() const { return -1; } |
329 int sampler_location() const { return sampler_location_; } | 330 int sampler_location() const { return sampler_location_; } |
330 | 331 |
331 private: | 332 private: |
332 int sampler_location_; | 333 int sampler_location_; |
333 | 334 |
334 DISALLOW_COPY_AND_ASSIGN(FragmentTexOpaqueBinding); | 335 DISALLOW_COPY_AND_ASSIGN(FragmentTexOpaqueBinding); |
335 }; | 336 }; |
336 | 337 |
| 338 class FragmentTexBackgroundBinding { |
| 339 public: |
| 340 FragmentTexBackgroundBinding(); |
| 341 |
| 342 void Init(WebKit::WebGraphicsContext3D* context, |
| 343 unsigned program, |
| 344 bool using_bind_uniform, |
| 345 int* base_uniform_index); |
| 346 int background_color_location() const { return background_color_location_; } |
| 347 int sampler_location() const { return sampler_location_; } |
| 348 |
| 349 private: |
| 350 int background_color_location_; |
| 351 int sampler_location_; |
| 352 |
| 353 DISALLOW_COPY_AND_ASSIGN(FragmentTexBackgroundBinding); |
| 354 }; |
| 355 |
337 class FragmentShaderRGBATexVaryingAlpha : public FragmentTexOpaqueBinding { | 356 class FragmentShaderRGBATexVaryingAlpha : public FragmentTexOpaqueBinding { |
338 public: | 357 public: |
339 std::string GetShaderString(TexCoordPrecision precision) const; | 358 std::string GetShaderString(TexCoordPrecision precision) const; |
340 }; | 359 }; |
341 | 360 |
342 class FragmentShaderRGBATexPremultiplyAlpha : public FragmentTexOpaqueBinding { | 361 class FragmentShaderRGBATexPremultiplyAlpha : public FragmentTexOpaqueBinding { |
343 public: | 362 public: |
344 std::string GetShaderString(TexCoordPrecision precision) const; | 363 std::string GetShaderString(TexCoordPrecision precision) const; |
345 }; | 364 }; |
346 | 365 |
| 366 class FragmentShaderTexBackgroundVaryingAlpha |
| 367 : public FragmentTexBackgroundBinding { |
| 368 public: |
| 369 std::string GetShaderString(TexCoordPrecision precision) const; |
| 370 }; |
| 371 |
| 372 class FragmentShaderTexBackgroundPremultiplyAlpha |
| 373 : public FragmentTexBackgroundBinding { |
| 374 public: |
| 375 std::string GetShaderString(TexCoordPrecision precision) const; |
| 376 }; |
| 377 |
347 class FragmentShaderRGBATexAlpha : public FragmentTexAlphaBinding { | 378 class FragmentShaderRGBATexAlpha : public FragmentTexAlphaBinding { |
348 public: | 379 public: |
349 std::string GetShaderString(TexCoordPrecision precision) const; | 380 std::string GetShaderString(TexCoordPrecision precision) const; |
350 }; | 381 }; |
351 | 382 |
352 class FragmentShaderRGBATexColorMatrixAlpha | 383 class FragmentShaderRGBATexColorMatrixAlpha |
353 : public FragmentTexColorMatrixAlphaBinding { | 384 : public FragmentTexColorMatrixAlphaBinding { |
354 public: | 385 public: |
355 std::string GetShaderString(TexCoordPrecision precision) const; | 386 std::string GetShaderString(TexCoordPrecision precision) const; |
356 }; | 387 }; |
357 | 388 |
358 class FragmentShaderRGBATexRectVaryingAlpha : public FragmentTexAlphaBinding { | 389 class FragmentShaderRGBATexRectVaryingAlpha : public FragmentTexOpaqueBinding { |
359 public: | 390 public: |
360 std::string GetShaderString(TexCoordPrecision precision) const; | 391 std::string GetShaderString(TexCoordPrecision precision) const; |
361 }; | 392 }; |
362 | 393 |
363 class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding { | 394 class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding { |
364 public: | 395 public: |
365 std::string GetShaderString(TexCoordPrecision precision) const; | 396 std::string GetShaderString(TexCoordPrecision precision) const; |
366 }; | 397 }; |
367 | 398 |
368 class FragmentShaderRGBATex : public FragmentTexOpaqueBinding { | 399 class FragmentShaderRGBATex : public FragmentTexOpaqueBinding { |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 int tex_transform_location_; | 736 int tex_transform_location_; |
706 int frequency_location_; | 737 int frequency_location_; |
707 int color_location_; | 738 int color_location_; |
708 | 739 |
709 DISALLOW_COPY_AND_ASSIGN(FragmentShaderCheckerboard); | 740 DISALLOW_COPY_AND_ASSIGN(FragmentShaderCheckerboard); |
710 }; | 741 }; |
711 | 742 |
712 } // namespace cc | 743 } // namespace cc |
713 | 744 |
714 #endif // CC_OUTPUT_SHADER_H_ | 745 #endif // CC_OUTPUT_SHADER_H_ |
OLD | NEW |