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

Unified Diff: ui/compositor/layer.cc

Issue 12093067: Handle ui::Layer's visibility using cc::Layer's m_isDrawable flag (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 11 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: ui/compositor/layer.cc
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index 119a1cfa868390103209691c432da434f32c665f..3b15433f6a8eb6533d2252b91d4e6c79b67116bb 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -438,7 +438,8 @@ void Layer::SetExternalTexture(Texture* texture) {
}
cc_layer_->setAnchorPoint(gfx::PointF());
cc_layer_->setContentsOpaque(fills_bounds_opaquely_);
- cc_layer_->setOpacity(visible_ ? opacity_ : 0.f);
+ cc_layer_->setOpacity(opacity_);
+ cc_layer_->setVisible(visible_);
cc_layer_->setForceRenderSurface(force_render_surface_);
cc_layer_->setIsDrawable(true);
RecomputeTransform();
@@ -645,8 +646,7 @@ void Layer::SetOpacityImmediately(float opacity) {
bool schedule_draw = (opacity != opacity_ && IsDrawn());
opacity_ = opacity;
- if (visible_)
- cc_layer_->setOpacity(opacity);
+ cc_layer_->setOpacity(opacity);
if (schedule_draw)
ScheduleDraw();
}
@@ -656,8 +656,7 @@ void Layer::SetVisibilityImmediately(bool visible) {
return;
visible_ = visible;
- // TODO(piman): Expose a visibility flag on WebLayer.
- cc_layer_->setOpacity(visible_ ? opacity_ : 0.f);
+ cc_layer_->setVisible(visible_);
}
void Layer::SetBrightnessImmediately(float brightness) {
« cc/layer.h ('K') | « cc/layer_tree_host_common.cc ('k') | ui/compositor/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698