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

Unified Diff: cc/quads/texture_draw_quad.cc

Issue 18432002: Blend TextureLayer background-color at draw time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: resolved conflicts with TOT 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/quads/texture_draw_quad.h ('k') | cc/test/render_pass_test_common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/quads/texture_draw_quad.cc
diff --git a/cc/quads/texture_draw_quad.cc b/cc/quads/texture_draw_quad.cc
index 04c9511ab1e1a7efbb217484d7c6475f30e58510..c894985717eb2ed027e443279e999947c9e76a2f 100644
--- a/cc/quads/texture_draw_quad.cc
+++ b/cc/quads/texture_draw_quad.cc
@@ -12,6 +12,7 @@ namespace cc {
TextureDrawQuad::TextureDrawQuad()
: resource_id(0),
premultiplied_alpha(false),
+ background_color(SK_ColorTRANSPARENT),
flipped(false) {
this->vertex_opacity[0] = 0.f;
this->vertex_opacity[1] = 0.f;
@@ -28,7 +29,9 @@ void TextureDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
unsigned resource_id, bool premultiplied_alpha,
gfx::PointF uv_top_left,
gfx::PointF uv_bottom_right,
- const float vertex_opacity[4], bool flipped) {
+ SkColor background_color,
+ const float vertex_opacity[4],
+ bool flipped) {
gfx::Rect visible_rect = rect;
bool needs_blending = vertex_opacity[0] != 1.0f || vertex_opacity[1] != 1.0f
|| vertex_opacity[2] != 1.0f || vertex_opacity[3] != 1.0f;
@@ -38,6 +41,7 @@ void TextureDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
this->premultiplied_alpha = premultiplied_alpha;
this->uv_top_left = uv_top_left;
this->uv_bottom_right = uv_bottom_right;
+ this->background_color = background_color;
this->vertex_opacity[0] = vertex_opacity[0];
this->vertex_opacity[1] = vertex_opacity[1];
this->vertex_opacity[2] = vertex_opacity[2];
@@ -51,13 +55,16 @@ void TextureDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
unsigned resource_id, bool premultiplied_alpha,
gfx::PointF uv_top_left,
gfx::PointF uv_bottom_right,
- const float vertex_opacity[4], bool flipped) {
+ SkColor background_color,
+ const float vertex_opacity[4],
+ bool flipped) {
DrawQuad::SetAll(shared_quad_state, DrawQuad::TEXTURE_CONTENT, rect,
opaque_rect, visible_rect, needs_blending);
this->resource_id = resource_id;
this->premultiplied_alpha = premultiplied_alpha;
this->uv_top_left = uv_top_left;
this->uv_bottom_right = uv_bottom_right;
+ this->background_color = background_color;
this->vertex_opacity[0] = vertex_opacity[0];
this->vertex_opacity[1] = vertex_opacity[1];
this->vertex_opacity[2] = vertex_opacity[2];
« no previous file with comments | « cc/quads/texture_draw_quad.h ('k') | cc/test/render_pass_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698