Index: ui/compositor/compositor.cc |
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc |
index f69e71ee0dda95a7e88a164c674a9c403348a2b9..4b552a16bd32421d3195876f0ba04e2ee4266dff 100644 |
--- a/ui/compositor/compositor.cc |
+++ b/ui/compositor/compositor.cc |
@@ -15,6 +15,7 @@ |
#include "base/message_loop/message_loop.h" |
#include "base/metrics/histogram_macros.h" |
#include "base/stl_util.h" |
+#include "base/strings/string_split.h" |
#include "base/strings/string_util.h" |
#include "base/sys_info.h" |
#include "base/trace_event/trace_event.h" |
@@ -108,9 +109,26 @@ Compositor::Compositor(const cc::FrameSinkId& frame_sink_id, |
settings.renderer_settings.show_overdraw_feedback = |
command_line->HasSwitch(cc::switches::kShowOverdrawFeedback); |
- // These flags should be mirrored by renderer versions in content/renderer/. |
- settings.initial_debug_state.show_debug_borders = |
- command_line->HasSwitch(cc::switches::kUIShowCompositedLayerBorders); |
+ if (command_line->HasSwitch(cc::switches::kUIShowCompositedLayerBorders)) { |
danakj
2017/04/13 15:25:51
I'd like --ui-show-composited-layer-borders (with
reveman
2017/04/13 17:00:46
Done.
|
+ std::string layer_borders_string = command_line->GetSwitchValueASCII( |
+ cc::switches::kUIShowCompositedLayerBorders); |
+ std::vector<std::string> entries = base::SplitString( |
+ layer_borders_string, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
+ for (const auto& entry : entries) { |
+ const struct { |
+ const char* name; |
+ cc::DebugBorderType type; |
+ } kBorders[] = {{"renderpass", cc::DebugBorderType::RENDERPASS}, |
+ {"surface", cc::DebugBorderType::SURFACE}, |
+ {"layer", cc::DebugBorderType::LAYER}}; |
+ for (const auto& border : kBorders) { |
+ if (border.name == entry) { |
+ settings.initial_debug_state.show_debug_borders.set(border.type); |
+ break; |
+ } |
+ } |
+ } |
+ } |
settings.initial_debug_state.show_fps_counter = |
command_line->HasSwitch(cc::switches::kUIShowFPSCounter); |
settings.initial_debug_state.show_layer_animation_bounds_rects = |