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

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: implemented software renderer 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
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..5c9d8c4f172147286c0176eced4553d2eb5a25e6 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) {
+ const float vertex_opacity[4],
+ SkColor background_color,
+ 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;
@@ -42,6 +45,7 @@ void TextureDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
this->vertex_opacity[1] = vertex_opacity[1];
this->vertex_opacity[2] = vertex_opacity[2];
this->vertex_opacity[3] = vertex_opacity[3];
+ this->background_color = background_color;
this->flipped = flipped;
}
@@ -51,7 +55,9 @@ 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) {
+ const float vertex_opacity[4],
+ SkColor background_color,
+ bool flipped) {
DrawQuad::SetAll(shared_quad_state, DrawQuad::TEXTURE_CONTENT, rect,
opaque_rect, visible_rect, needs_blending);
this->resource_id = resource_id;
@@ -62,6 +68,7 @@ void TextureDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
this->vertex_opacity[1] = vertex_opacity[1];
this->vertex_opacity[2] = vertex_opacity[2];
this->vertex_opacity[3] = vertex_opacity[3];
+ this->background_color = background_color;
this->flipped = flipped;
}

Powered by Google App Engine
This is Rietveld 408576698