summaryrefslogtreecommitdiffstats
path: root/ui/compositor
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-19 18:46:57 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-19 18:46:57 +0000
commit4d5e67617fab0e96c86549a4caecaca40f8da47f (patch)
tree7c4f7464724507410d1e6431883aaef2cc1a1416 /ui/compositor
parent0de4f905b82c8e3c9abfacd880095dd7b9053cad (diff)
downloadchromium_src-4d5e67617fab0e96c86549a4caecaca40f8da47f.zip
chromium_src-4d5e67617fab0e96c86549a4caecaca40f8da47f.tar.gz
chromium_src-4d5e67617fab0e96c86549a4caecaca40f8da47f.tar.bz2
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
Diffstat (limited to 'ui/compositor')
-rw-r--r--ui/compositor/compositor.cc34
-rw-r--r--ui/compositor/compositor_switches.cc15
-rw-r--r--ui/compositor/compositor_switches.h6
3 files changed, 29 insertions, 26 deletions
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<cc::Thread> 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