Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: cc/output/shader.h

Issue 18432002: Blend TextureLayer background-color at draw time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 sampler_location() const { return sampler_location_; } 273 int sampler_location() const { return sampler_location_; }
274 274
275 private: 275 private:
276 int sampler_location_; 276 int sampler_location_;
277 277
278 DISALLOW_COPY_AND_ASSIGN(FragmentTexOpaqueBinding); 278 DISALLOW_COPY_AND_ASSIGN(FragmentTexOpaqueBinding);
279 }; 279 };
280 280
281 class FragmentShaderRGBATexVaryingAlpha : public FragmentTexOpaqueBinding { 281 class FragmentTexBackgroundBinding {
282 public:
283 FragmentTexBackgroundBinding();
284
285 void Init(WebKit::WebGraphicsContext3D* context,
286 unsigned program,
287 bool using_bind_uniform,
288 int* base_uniform_index);
289 int background_color_location() const { return background_color_location_; }
290 int sampler_location() const { return sampler_location_; }
291
292 private:
293 int background_color_location_;
294 int sampler_location_;
295
296 DISALLOW_COPY_AND_ASSIGN(FragmentTexBackgroundBinding);
297 };
298
299 class FragmentShaderTexture : public FragmentTexBackgroundBinding {
282 public: 300 public:
283 std::string GetShaderString(TexCoordPrecision precision) const; 301 std::string GetShaderString(TexCoordPrecision precision) const;
284 }; 302 };
285 303
286 class FragmentShaderRGBATexPremultiplyAlpha : public FragmentTexOpaqueBinding { 304 class FragmentShaderNonPremulTexture : public FragmentTexBackgroundBinding {
287 public: 305 public:
288 std::string GetShaderString(TexCoordPrecision precision) const; 306 std::string GetShaderString(TexCoordPrecision precision) const;
289 }; 307 };
290 308
291 class FragmentShaderRGBATexAlpha : public FragmentTexAlphaBinding { 309 class FragmentShaderRGBATexAlpha : public FragmentTexAlphaBinding {
292 public: 310 public:
293 std::string GetShaderString(TexCoordPrecision precision) const; 311 std::string GetShaderString(TexCoordPrecision precision) const;
294 }; 312 };
295 313
296 class FragmentShaderRGBATexColorMatrixAlpha 314 class FragmentShaderRGBATexColorMatrixAlpha
297 : public FragmentTexColorMatrixAlphaBinding { 315 : public FragmentTexColorMatrixAlphaBinding {
298 public: 316 public:
299 std::string GetShaderString(TexCoordPrecision precision) const; 317 std::string GetShaderString(TexCoordPrecision precision) const;
300 }; 318 };
301 319
302 class FragmentShaderRGBATexRectVaryingAlpha : public FragmentTexAlphaBinding { 320 class FragmentShaderRGBATexRectVaryingAlpha : public FragmentTexAlphaBinding {
303 public: 321 public:
322 int background_color_location() const { return -1; }
304 std::string GetShaderString(TexCoordPrecision precision) const; 323 std::string GetShaderString(TexCoordPrecision precision) const;
305 }; 324 };
306 325
307 class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding { 326 class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding {
308 public: 327 public:
309 std::string GetShaderString(TexCoordPrecision precision) const; 328 std::string GetShaderString(TexCoordPrecision precision) const;
310 }; 329 };
311 330
312 class FragmentShaderRGBATex : public FragmentTexOpaqueBinding { 331 class FragmentShaderRGBATex : public FragmentTexOpaqueBinding {
313 public: 332 public:
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 int tex_transform_location_; 681 int tex_transform_location_;
663 int frequency_location_; 682 int frequency_location_;
664 int color_location_; 683 int color_location_;
665 684
666 DISALLOW_COPY_AND_ASSIGN(FragmentShaderCheckerboard); 685 DISALLOW_COPY_AND_ASSIGN(FragmentShaderCheckerboard);
667 }; 686 };
668 687
669 } // namespace cc 688 } // namespace cc
670 689
671 #endif // CC_OUTPUT_SHADER_H_ 690 #endif // CC_OUTPUT_SHADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698