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

Unified Diff: ui/compositor/layer.cc

Issue 11410098: ui: Enable debug borders for the UI compositor through layer tree settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | « ui/compositor/layer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer.cc
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index 2a88db500fe5b74141d8dddd174b02b8638ba6b6..5fc7aedf10165f5af02f94630aae3557b25887c8 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -374,7 +374,6 @@ void Layer::SetFillsBoundsOpaquely(bool fills_bounds_opaquely) {
fills_bounds_opaquely_ = fills_bounds_opaquely;
web_layer_->setOpaque(fills_bounds_opaquely);
- RecomputeDebugBorderColor();
}
void Layer::SetExternalTexture(Texture* texture) {
@@ -416,10 +415,8 @@ void Layer::SetExternalTexture(Texture* texture) {
web_layer_->setAnchorPoint(WebKit::WebFloatPoint(0.f, 0.f));
web_layer_->setOpaque(fills_bounds_opaquely_);
web_layer_->setOpacity(visible_ ? opacity_ : 0.f);
- web_layer_->setDebugBorderWidth(show_debug_borders_ ? 2 : 0);
web_layer_->setForceRenderSurface(force_render_surface_);
RecomputeTransform();
- RecomputeDebugBorderColor();
}
RecomputeDrawsContentAndUVRect();
}
@@ -627,7 +624,6 @@ void Layer::SetOpacityImmediately(float opacity) {
if (visible_)
web_layer_->setOpacity(opacity);
- RecomputeDebugBorderColor();
if (schedule_draw)
ScheduleDraw();
}
@@ -733,11 +729,8 @@ void Layer::CreateWebLayer() {
web_layer_ = content_layer_->layer();
}
web_layer_is_accelerated_ = false;
- show_debug_borders_ = CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kUIShowLayerBorders);
web_layer_->setAnchorPoint(WebKit::WebFloatPoint(0.f, 0.f));
web_layer_->setOpaque(true);
- web_layer_->setDebugBorderWidth(show_debug_borders_ ? 2 : 0);
}
void Layer::RecomputeTransform() {
@@ -785,15 +778,4 @@ void Layer::RecomputeDrawsContentAndUVRect() {
}
}
-void Layer::RecomputeDebugBorderColor() {
- if (!show_debug_borders_)
- return;
- unsigned int color = 0xFF000000;
- color |= web_layer_is_accelerated_ ? 0x0000FF00 : 0x00FF0000;
- bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f);
- if (!opaque)
- color |= 0xFF;
- web_layer_->setDebugBorderColor(color);
jonathan.backer 2012/11/14 21:39:12 Is the purpose of this code to give the UI layer b
danakj 2012/11/14 22:26:39 As per offline, this was the way to get layer bord
-}
-
} // namespace ui
« no previous file with comments | « ui/compositor/layer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698