From 4d5e67617fab0e96c86549a4caecaca40f8da47f Mon Sep 17 00:00:00 2001 From: "danakj@chromium.org" Date: Tue, 19 Mar 2013 18:46:57 +0000 Subject: cc: Add --ui-foo flags for all compositor debug visualizations. For every --show-debug-thing flag, we should have a mirrored --ui-show-debug-thing flag to show the same information in the UI compositor. Move the current ui-compositor flags to cc/base/switches.h where the renderer-compositor flags are, so that the mirrored nature is easily seen and maintained. Also move the few renderer-compositor flags for these compositor features to cc/base/switches.h. The only flag that can't move is kShowPaintRects, as it is also used for the software non-compositing path. So instead we mirror this flag in the ui-compositor switches. R=piman Review URL: https://codereview.chromium.org/12909003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189062 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/compositor/compositor.cc | 34 ++++++++++++++++++++++++++-------- ui/compositor/compositor_switches.cc | 15 ++------------- ui/compositor/compositor_switches.h | 6 +----- 3 files changed, 29 insertions(+), 26 deletions(-) (limited to 'ui/compositor') diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc index 954e11e..92c0a12 100644 --- a/ui/compositor/compositor.cc +++ b/ui/compositor/compositor.cc @@ -14,6 +14,7 @@ #include "base/string_util.h" #include "base/threading/thread.h" #include "base/threading/thread_restrictions.h" +#include "cc/base/switches.h" #include "cc/base/thread_impl.h" #include "cc/input/input_handler.h" #include "cc/layers/layer.h" @@ -415,19 +416,36 @@ Compositor::Compositor(CompositorDelegate* delegate, root_web_layer_->SetAnchorPoint(gfx::PointF(0.f, 0.f)); CommandLine* command_line = CommandLine::ForCurrentProcess(); + cc::LayerTreeSettings settings; - settings.initialDebugState.show_fps_counter = - command_line->HasSwitch(switches::kUIShowFPSCounter); - settings.initialDebugState.show_platform_layer_tree = - command_line->HasSwitch(switches::kUIShowLayerTree); settings.refreshRate = g_test_compositor_enabled ? kTestRefreshRate : kDefaultRefreshRate; - settings.initialDebugState.show_debug_borders = - command_line->HasSwitch(switches::kUIShowLayerBorders); settings.partialSwapEnabled = - command_line->HasSwitch(switches::kUIEnablePartialSwap); + command_line->HasSwitch(cc::switches::kUIEnablePartialSwap); settings.perTilePaintingEnabled = - command_line->HasSwitch(switches::kUIEnablePerTilePainting); + command_line->HasSwitch(cc::switches::kUIEnablePerTilePainting); + + // These flags should be mirrored by renderer versions in content/renderer/. + settings.initialDebugState.show_debug_borders = + command_line->HasSwitch(cc::switches::kUIShowCompositedLayerBorders); + settings.initialDebugState.show_fps_counter = + command_line->HasSwitch(cc::switches::kUIShowFPSCounter); + settings.initialDebugState.show_paint_rects = + command_line->HasSwitch(switches::kUIShowPaintRects); + settings.initialDebugState.show_platform_layer_tree = + command_line->HasSwitch(cc::switches::kUIShowCompositedLayerTree); + settings.initialDebugState.show_property_changed_rects = + command_line->HasSwitch(cc::switches::kUIShowPropertyChangedRects); + settings.initialDebugState.show_surface_damage_rects = + command_line->HasSwitch(cc::switches::kUIShowSurfaceDamageRects); + settings.initialDebugState.show_screen_space_rects = + command_line->HasSwitch(cc::switches::kUIShowScreenSpaceRects); + settings.initialDebugState.show_replica_screen_space_rects = + command_line->HasSwitch(cc::switches::kUIShowReplicaScreenSpaceRects); + settings.initialDebugState.show_occluding_rects = + command_line->HasSwitch(cc::switches::kUIShowOccludingRects); + settings.initialDebugState.show_non_occluding_rects = + command_line->HasSwitch(cc::switches::kUIShowNonOccludingRects); scoped_ptr thread; if (g_compositor_thread) { diff --git a/ui/compositor/compositor_switches.cc b/ui/compositor/compositor_switches.cc index 7029197..d5176a2 100644 --- a/ui/compositor/compositor_switches.cc +++ b/ui/compositor/compositor_switches.cc @@ -8,23 +8,12 @@ namespace switches { const char kDisableTestCompositor[] = "disable-test-compositor"; -const char kUIEnablePartialSwap[] = "ui-enable-partial-swap"; - -// Show FPS counter. -const char kUIShowFPSCounter[] = "ui-show-fps-counter"; - -// Show colored borders around layers. -const char kUIShowLayerBorders[] = "ui-show-layer-borders"; - -// Show layer tree. -const char kUIShowLayerTree[] = "ui-show-layer-tree"; - -const char kUIEnablePerTilePainting[] = "ui-enable-per-tile-painting"; - const char kUIEnableThreadedCompositing[] = "ui-enable-threaded-compositing"; const char kUIEnableSoftwareCompositing[] = "ui-enable-software-compositing"; const char kUIMaxFramesPending[] = "ui-max-frames-pending"; +const char kUIShowPaintRects[] = "ui-show-paint-rects"; + } // namespace switches diff --git a/ui/compositor/compositor_switches.h b/ui/compositor/compositor_switches.h index 1f74376..69711bd 100644 --- a/ui/compositor/compositor_switches.h +++ b/ui/compositor/compositor_switches.h @@ -10,14 +10,10 @@ namespace switches { COMPOSITOR_EXPORT extern const char kDisableTestCompositor[]; -COMPOSITOR_EXPORT extern const char kUIEnablePartialSwap[]; -COMPOSITOR_EXPORT extern const char kUIShowFPSCounter[]; -COMPOSITOR_EXPORT extern const char kUIShowLayerBorders[]; -COMPOSITOR_EXPORT extern const char kUIShowLayerTree[]; -COMPOSITOR_EXPORT extern const char kUIEnablePerTilePainting[]; COMPOSITOR_EXPORT extern const char kUIEnableThreadedCompositing[]; COMPOSITOR_EXPORT extern const char kUIEnableSoftwareCompositing[]; COMPOSITOR_EXPORT extern const char kUIMaxFramesPending[]; +COMPOSITOR_EXPORT extern const char kUIShowPaintRects[]; } // namespace switches -- cgit v1.1