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

Unified Diff: cc/layers/texture_layer.cc

Issue 18432002: Blend TextureLayer background-color at draw time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added non-premultiplied test 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/layers/texture_layer.cc
diff --git a/cc/layers/texture_layer.cc b/cc/layers/texture_layer.cc
index f2900e6b6f63c77b014fd19e4a3eab29dc5cb460..5a1a45877d042d969cbc03157bbf69e1c7f279b2 100644
--- a/cc/layers/texture_layer.cc
+++ b/cc/layers/texture_layer.cc
@@ -31,6 +31,7 @@ TextureLayer::TextureLayer(TextureLayerClient* client, bool uses_mailbox)
uv_top_left_(0.f, 0.f),
uv_bottom_right_(1.f, 1.f),
premultiplied_alpha_(true),
+ blend_background_color_(false),
rate_limit_context_(false),
content_committed_(false),
texture_id_(0),
@@ -105,6 +106,13 @@ void TextureLayer::SetPremultipliedAlpha(bool premultiplied_alpha) {
SetNeedsCommit();
}
+void TextureLayer::SetBlendBackgroundColor(bool blend) {
+ if (blend_background_color_ == blend)
+ return;
+ blend_background_color_ = blend;
+ SetNeedsCommit();
+}
+
void TextureLayer::SetRateLimitContext(bool rate_limit) {
if (!rate_limit && rate_limit_context_ && client_ && layer_tree_host())
layer_tree_host()->StopRateLimiter(client_->Context3d());
@@ -202,6 +210,7 @@ void TextureLayer::PushPropertiesTo(LayerImpl* layer) {
texture_layer->set_uv_bottom_right(uv_bottom_right_);
texture_layer->set_vertex_opacity(vertex_opacity_);
texture_layer->set_premultiplied_alpha(premultiplied_alpha_);
+ texture_layer->set_blend_background_color(blend_background_color_);
if (uses_mailbox_ && needs_set_mailbox_) {
TextureMailbox texture_mailbox;
if (holder_ref_) {

Powered by Google App Engine
This is Rietveld 408576698