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

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 TextureLayer unittest Created 7 years, 6 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 9e9dff80584549ff38fd981c222cb9d216691d3c..c4e5cd2b836fc50d8a57c740d850d56789cfb9dd 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),
context_lost_(false),
content_committed_(false),
@@ -106,6 +107,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());
@@ -196,6 +204,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