summaryrefslogtreecommitdiffstats
path: root/cc
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 /cc
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 'cc')
-rw-r--r--cc/base/switches.cc81
-rw-r--r--cc/base/switches.h35
-rw-r--r--cc/trees/layer_tree_host.cc1
-rw-r--r--cc/trees/layer_tree_settings.cc1
4 files changed, 79 insertions, 39 deletions
diff --git a/cc/base/switches.cc b/cc/base/switches.cc
index d8fb484..75be68b 100644
--- a/cc/base/switches.cc
+++ b/cc/base/switches.cc
@@ -14,7 +14,7 @@ namespace switches {
const char kBackgroundColorInsteadOfCheckerboard[] =
"background-color-instead-of-checkerboard";
-const char kDisableThreadedAnimation[] = "disable-threaded-animation";
+const char kDisableThreadedAnimation[] = "disable-threaded-animation";
// Send a message for every frame from the impl thread to the parent compositor.
const char kEnableCompositorFrameMessage[] = "enable-compositor-frame-message";
@@ -26,10 +26,6 @@ const char kDisableImplSidePainting[] = "disable-impl-side-painting";
// Paint content on the compositor thread instead of the main thread.
const char kEnableImplSidePainting[] = "enable-impl-side-painting";
-const char kEnablePartialSwap[] = "enable-partial-swap";
-
-const char kEnablePerTilePainting[] = "enable-per-tile-painting";
-
// Try to finish display pipeline before vsync tick
const char kEnableRightAlignedScheduling[] = "enable-right-aligned-scheduling";
@@ -51,35 +47,12 @@ const char kTopControlsShowThreshold[] = "top-controls-show-threshold";
// Number of worker threads used to rasterize content.
const char kNumRasterThreads[] = "num-raster-threads";
-// Show rects in the HUD around layers whose properties have changed.
-const char kShowPropertyChangedRects[] = "show-property-changed-rects";
-
-// Show rects in the HUD around damage as it is recorded into each render
-// surface.
-const char kShowSurfaceDamageRects[] = "show-surface-damage-rects";
-
-// Show rects in the HUD around the screen-space transformed bounds of every
-// layer.
-const char kShowScreenSpaceRects[] = "show-screenspace-rects";
-
-// Show rects in the HUD around the screen-space transformed bounds of every
-// layer's replica, when they have one.
-const char kShowReplicaScreenSpaceRects[] = "show-replica-screenspace-rects";
-
-// Show rects in the HUD wherever something is known to be drawn opaque and is
-// considered occluding the pixels behind it.
-const char kShowOccludingRects[] = "show-occluding-rects";
-
-// Show rects in the HUD wherever something is not known to be drawn opaque and
-// is not considered to be occluding the pixels behind it.
-const char kShowNonOccludingRects[] = "show-nonoccluding-rects";
-
// Show metrics about overdraw in about:tracing recordings, such as the number
// of pixels culled, and the number of pixels drawn, for each frame.
const char kTraceOverdraw[] = "trace-overdraw";
// Logs all rendered frames.
-const char kTraceAllRenderedFrames[] = "trace-all-rendered-frames";
+const char kTraceAllRenderedFrames[] = "trace-all-rendered-frames";
// Re-rasters everything multiple times to simulate a much slower machine.
// Give a scale factor to cause raster to take that many times longer to
@@ -101,6 +74,56 @@ const char kLowResolutionContentsScaleFactor[] =
// Requires --enable-compositor-frame-message.
const char kCompositeToMailbox[] = "composite-to-mailbox";
+const char kEnablePartialSwap[] = "enable-partial-swap";
+const char kUIEnablePartialSwap[] = "ui-enable-partial-swap";
+
+const char kEnablePerTilePainting[] = "enable-per-tile-painting";
+const char kUIEnablePerTilePainting[] = "ui-enable-per-tile-painting";
+
+// Renders a border around compositor layers to help debug and study
+// layer compositing.
+const char kShowCompositedLayerBorders[] = "show-composited-layer-borders";
+const char kUIShowCompositedLayerBorders[] = "ui-show-layer-borders";
+
+// Draws a textual dump of the compositor layer tree to help debug and study
+// layer compositing.
+const char kShowCompositedLayerTree[] = "show-composited-layer-tree";
+const char kUIShowCompositedLayerTree[] = "ui-show-layer-tree";
+
+// Draws a FPS indicator
+const char kShowFPSCounter[] = "show-fps-counter";
+const char kUIShowFPSCounter[] = "ui-show-fps-counter";
+
+// Show rects in the HUD around layers whose properties have changed.
+const char kShowPropertyChangedRects[] = "show-property-changed-rects";
+const char kUIShowPropertyChangedRects[] = "ui-show-property-changed-rects";
+
+// Show rects in the HUD around damage as it is recorded into each render
+// surface.
+const char kShowSurfaceDamageRects[] = "show-surface-damage-rects";
+const char kUIShowSurfaceDamageRects[] = "ui-show-surface-damage-rects";
+
+// Show rects in the HUD around the screen-space transformed bounds of every
+// layer.
+const char kShowScreenSpaceRects[] = "show-screenspace-rects";
+const char kUIShowScreenSpaceRects[] = "ui-show-screenspace-rects";
+
+// Show rects in the HUD around the screen-space transformed bounds of every
+// layer's replica, when they have one.
+const char kShowReplicaScreenSpaceRects[] = "show-replica-screenspace-rects";
+const char kUIShowReplicaScreenSpaceRects[] =
+ "ui-show-replica-screenspace-rects";
+
+// Show rects in the HUD wherever something is known to be drawn opaque and is
+// considered occluding the pixels behind it.
+const char kShowOccludingRects[] = "show-occluding-rects";
+const char kUIShowOccludingRects[] = "ui-show-occluding-rects";
+
+// Show rects in the HUD wherever something is not known to be drawn opaque and
+// is not considered to be occluding the pixels behind it.
+const char kShowNonOccludingRects[] = "show-nonoccluding-rects";
+const char kUIShowNonOccludingRects[] = "ui-show-nonoccluding-rects";
+
bool IsImplSidePaintingEnabled() {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
diff --git a/cc/base/switches.h b/cc/base/switches.h
index 55e7172..fe91832 100644
--- a/cc/base/switches.h
+++ b/cc/base/switches.h
@@ -15,24 +15,17 @@
namespace cc {
namespace switches {
+// Switches for the renderer compositor only.
CC_EXPORT extern const char kBackgroundColorInsteadOfCheckerboard[];
CC_EXPORT extern const char kDisableThreadedAnimation[];
CC_EXPORT extern const char kEnableCompositorFrameMessage[];
CC_EXPORT extern const char kDisableImplSidePainting[];
CC_EXPORT extern const char kEnableImplSidePainting[];
-CC_EXPORT extern const char kEnablePartialSwap[];
-CC_EXPORT extern const char kEnablePerTilePainting[];
CC_EXPORT extern const char kEnablePredictionBenchmarking[];
CC_EXPORT extern const char kEnableRightAlignedScheduling[];
CC_EXPORT extern const char kEnableTopControlsPositionCalculation[];
CC_EXPORT extern const char kJankInsteadOfCheckerboard[];
CC_EXPORT extern const char kNumRasterThreads[];
-CC_EXPORT extern const char kShowPropertyChangedRects[];
-CC_EXPORT extern const char kShowSurfaceDamageRects[];
-CC_EXPORT extern const char kShowScreenSpaceRects[];
-CC_EXPORT extern const char kShowReplicaScreenSpaceRects[];
-CC_EXPORT extern const char kShowOccludingRects[];
-CC_EXPORT extern const char kShowNonOccludingRects[];
CC_EXPORT extern const char kTraceOverdraw[];
CC_EXPORT extern const char kTopControlsHeight[];
CC_EXPORT extern const char kTopControlsHideThreshold[];
@@ -44,6 +37,32 @@ CC_EXPORT extern const char kUseColorEstimator[];
CC_EXPORT extern const char kLowResolutionContentsScaleFactor[];
CC_EXPORT extern const char kCompositeToMailbox[];
+// Switches for both the renderer and ui compositors.
+CC_EXPORT extern const char kEnablePartialSwap[];
+CC_EXPORT extern const char kUIEnablePartialSwap[];
+CC_EXPORT extern const char kEnablePerTilePainting[];
+CC_EXPORT extern const char kUIEnablePerTilePainting[];
+
+// Debug visualizations.
+CC_EXPORT extern const char kShowCompositedLayerBorders[];
+CC_EXPORT extern const char kUIShowCompositedLayerBorders[];
+CC_EXPORT extern const char kShowCompositedLayerTree[];
+CC_EXPORT extern const char kUIShowCompositedLayerTree[];
+CC_EXPORT extern const char kShowFPSCounter[];
+CC_EXPORT extern const char kUIShowFPSCounter[];
+CC_EXPORT extern const char kShowPropertyChangedRects[];
+CC_EXPORT extern const char kUIShowPropertyChangedRects[];
+CC_EXPORT extern const char kShowSurfaceDamageRects[];
+CC_EXPORT extern const char kUIShowSurfaceDamageRects[];
+CC_EXPORT extern const char kShowScreenSpaceRects[];
+CC_EXPORT extern const char kUIShowScreenSpaceRects[];
+CC_EXPORT extern const char kShowReplicaScreenSpaceRects[];
+CC_EXPORT extern const char kUIShowReplicaScreenSpaceRects[];
+CC_EXPORT extern const char kShowOccludingRects[];
+CC_EXPORT extern const char kUIShowOccludingRects[];
+CC_EXPORT extern const char kShowNonOccludingRects[];
+CC_EXPORT extern const char kUIShowNonOccludingRects[];
+
CC_EXPORT bool IsImplSidePaintingEnabled();
} // namespace switches
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index ce8e6fc..2fa4f66 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -13,7 +13,6 @@
#include "cc/animation/animation_registrar.h"
#include "cc/animation/layer_animation_controller.h"
#include "cc/base/math_util.h"
-#include "cc/base/switches.h"
#include "cc/base/thread.h"
#include "cc/debug/overdraw_metrics.h"
#include "cc/input/pinch_zoom_scrollbar.h"
diff --git a/cc/trees/layer_tree_settings.cc b/cc/trees/layer_tree_settings.cc
index 8726afb..ac76125 100644
--- a/cc/trees/layer_tree_settings.cc
+++ b/cc/trees/layer_tree_settings.cc
@@ -9,7 +9,6 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "base/string_number_conversions.h"
-#include "cc/base/switches.h"
namespace cc {