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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 public: | 263 public: |
264 FragmentTexOpaqueBinding(); | 264 FragmentTexOpaqueBinding(); |
265 | 265 |
266 void Init(WebKit::WebGraphicsContext3D* context, | 266 void Init(WebKit::WebGraphicsContext3D* context, |
267 unsigned program, | 267 unsigned program, |
268 bool using_bind_uniform, | 268 bool using_bind_uniform, |
269 int* base_uniform_index); | 269 int* base_uniform_index); |
270 int alpha_location() const { return -1; } | 270 int alpha_location() const { return -1; } |
271 int edge_location() const { return -1; } | 271 int edge_location() const { return -1; } |
272 int fragment_tex_transform_location() const { return -1; } | 272 int fragment_tex_transform_location() const { return -1; } |
| 273 int background_color_location() const { return -1; } |
273 int sampler_location() const { return sampler_location_; } | 274 int sampler_location() const { return sampler_location_; } |
274 | 275 |
275 private: | 276 private: |
276 int sampler_location_; | 277 int sampler_location_; |
277 | 278 |
278 DISALLOW_COPY_AND_ASSIGN(FragmentTexOpaqueBinding); | 279 DISALLOW_COPY_AND_ASSIGN(FragmentTexOpaqueBinding); |
279 }; | 280 }; |
280 | 281 |
| 282 class FragmentTexBackgroundBinding { |
| 283 public: |
| 284 FragmentTexBackgroundBinding(); |
| 285 |
| 286 void Init(WebKit::WebGraphicsContext3D* context, |
| 287 unsigned program, |
| 288 bool using_bind_uniform, |
| 289 int* base_uniform_index); |
| 290 int background_color_location() const { return background_color_location_; } |
| 291 int sampler_location() const { return sampler_location_; } |
| 292 |
| 293 private: |
| 294 int background_color_location_; |
| 295 int sampler_location_; |
| 296 |
| 297 DISALLOW_COPY_AND_ASSIGN(FragmentTexBackgroundBinding); |
| 298 }; |
| 299 |
281 class FragmentShaderRGBATexVaryingAlpha : public FragmentTexOpaqueBinding { | 300 class FragmentShaderRGBATexVaryingAlpha : public FragmentTexOpaqueBinding { |
282 public: | 301 public: |
283 std::string GetShaderString(TexCoordPrecision precision) const; | 302 std::string GetShaderString(TexCoordPrecision precision) const; |
284 }; | 303 }; |
285 | 304 |
286 class FragmentShaderRGBATexPremultiplyAlpha : public FragmentTexOpaqueBinding { | 305 class FragmentShaderRGBATexPremultiplyAlpha : public FragmentTexOpaqueBinding { |
287 public: | 306 public: |
288 std::string GetShaderString(TexCoordPrecision precision) const; | 307 std::string GetShaderString(TexCoordPrecision precision) const; |
289 }; | 308 }; |
290 | 309 |
| 310 class FragmentShaderTexBackgroundVaryingAlpha |
| 311 : public FragmentTexBackgroundBinding { |
| 312 public: |
| 313 std::string GetShaderString(TexCoordPrecision precision) const; |
| 314 }; |
| 315 |
| 316 class FragmentShaderTexBackgroundPremultiplyAlpha |
| 317 : public FragmentTexBackgroundBinding { |
| 318 public: |
| 319 std::string GetShaderString(TexCoordPrecision precision) const; |
| 320 }; |
| 321 |
291 class FragmentShaderRGBATexAlpha : public FragmentTexAlphaBinding { | 322 class FragmentShaderRGBATexAlpha : public FragmentTexAlphaBinding { |
292 public: | 323 public: |
293 std::string GetShaderString(TexCoordPrecision precision) const; | 324 std::string GetShaderString(TexCoordPrecision precision) const; |
294 }; | 325 }; |
295 | 326 |
296 class FragmentShaderRGBATexColorMatrixAlpha | 327 class FragmentShaderRGBATexColorMatrixAlpha |
297 : public FragmentTexColorMatrixAlphaBinding { | 328 : public FragmentTexColorMatrixAlphaBinding { |
298 public: | 329 public: |
299 std::string GetShaderString(TexCoordPrecision precision) const; | 330 std::string GetShaderString(TexCoordPrecision precision) const; |
300 }; | 331 }; |
301 | 332 |
302 class FragmentShaderRGBATexRectVaryingAlpha : public FragmentTexAlphaBinding { | 333 class FragmentShaderRGBATexRectVaryingAlpha : public FragmentTexOpaqueBinding { |
303 public: | 334 public: |
304 std::string GetShaderString(TexCoordPrecision precision) const; | 335 std::string GetShaderString(TexCoordPrecision precision) const; |
305 }; | 336 }; |
306 | 337 |
307 class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding { | 338 class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding { |
308 public: | 339 public: |
309 std::string GetShaderString(TexCoordPrecision precision) const; | 340 std::string GetShaderString(TexCoordPrecision precision) const; |
310 }; | 341 }; |
311 | 342 |
312 class FragmentShaderRGBATex : public FragmentTexOpaqueBinding { | 343 class FragmentShaderRGBATex : public FragmentTexOpaqueBinding { |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 int tex_transform_location_; | 693 int tex_transform_location_; |
663 int frequency_location_; | 694 int frequency_location_; |
664 int color_location_; | 695 int color_location_; |
665 | 696 |
666 DISALLOW_COPY_AND_ASSIGN(FragmentShaderCheckerboard); | 697 DISALLOW_COPY_AND_ASSIGN(FragmentShaderCheckerboard); |
667 }; | 698 }; |
668 | 699 |
669 } // namespace cc | 700 } // namespace cc |
670 | 701 |
671 #endif // CC_OUTPUT_SHADER_H_ | 702 #endif // CC_OUTPUT_SHADER_H_ |
OLD | NEW |