Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/compositor/compositor.h" | 5 #include "ui/compositor/compositor.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <deque> | 10 #include <deque> |
| 11 #include <utility> | 11 #include <utility> |
| 12 | 12 |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 16 #include "base/metrics/histogram_macros.h" | 16 #include "base/metrics/histogram_macros.h" |
| 17 #include "base/stl_util.h" | 17 #include "base/stl_util.h" |
| 18 #include "base/strings/string_split.h" | |
| 18 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
| 19 #include "base/sys_info.h" | 20 #include "base/sys_info.h" |
| 20 #include "base/trace_event/trace_event.h" | 21 #include "base/trace_event/trace_event.h" |
| 21 #include "build/build_config.h" | 22 #include "build/build_config.h" |
| 22 #include "cc/animation/animation_host.h" | 23 #include "cc/animation/animation_host.h" |
| 23 #include "cc/animation/animation_id_provider.h" | 24 #include "cc/animation/animation_id_provider.h" |
| 24 #include "cc/animation/animation_timeline.h" | 25 #include "cc/animation/animation_timeline.h" |
| 25 #include "cc/base/switches.h" | 26 #include "cc/base/switches.h" |
| 26 #include "cc/input/input_handler.h" | 27 #include "cc/input/input_handler.h" |
| 27 #include "cc/layers/layer.h" | 28 #include "cc/layers/layer.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 101 #if defined(OS_WIN) | 102 #if defined(OS_WIN) |
| 102 settings.renderer_settings.finish_rendering_on_resize = true; | 103 settings.renderer_settings.finish_rendering_on_resize = true; |
| 103 #elif defined(OS_MACOSX) | 104 #elif defined(OS_MACOSX) |
| 104 settings.renderer_settings.release_overlay_resources_after_gpu_query = true; | 105 settings.renderer_settings.release_overlay_resources_after_gpu_query = true; |
| 105 #endif | 106 #endif |
| 106 settings.renderer_settings.gl_composited_texture_quad_border = | 107 settings.renderer_settings.gl_composited_texture_quad_border = |
| 107 command_line->HasSwitch(cc::switches::kGlCompositedTextureQuadBorder); | 108 command_line->HasSwitch(cc::switches::kGlCompositedTextureQuadBorder); |
| 108 settings.renderer_settings.show_overdraw_feedback = | 109 settings.renderer_settings.show_overdraw_feedback = |
| 109 command_line->HasSwitch(cc::switches::kShowOverdrawFeedback); | 110 command_line->HasSwitch(cc::switches::kShowOverdrawFeedback); |
| 110 | 111 |
| 111 // These flags should be mirrored by renderer versions in content/renderer/. | 112 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.
| |
| 112 settings.initial_debug_state.show_debug_borders = | 113 std::string layer_borders_string = command_line->GetSwitchValueASCII( |
| 113 command_line->HasSwitch(cc::switches::kUIShowCompositedLayerBorders); | 114 cc::switches::kUIShowCompositedLayerBorders); |
| 115 std::vector<std::string> entries = base::SplitString( | |
| 116 layer_borders_string, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | |
| 117 for (const auto& entry : entries) { | |
| 118 const struct { | |
| 119 const char* name; | |
| 120 cc::DebugBorderType type; | |
| 121 } kBorders[] = {{"renderpass", cc::DebugBorderType::RENDERPASS}, | |
| 122 {"surface", cc::DebugBorderType::SURFACE}, | |
| 123 {"layer", cc::DebugBorderType::LAYER}}; | |
| 124 for (const auto& border : kBorders) { | |
| 125 if (border.name == entry) { | |
| 126 settings.initial_debug_state.show_debug_borders.set(border.type); | |
| 127 break; | |
| 128 } | |
| 129 } | |
| 130 } | |
| 131 } | |
| 114 settings.initial_debug_state.show_fps_counter = | 132 settings.initial_debug_state.show_fps_counter = |
| 115 command_line->HasSwitch(cc::switches::kUIShowFPSCounter); | 133 command_line->HasSwitch(cc::switches::kUIShowFPSCounter); |
| 116 settings.initial_debug_state.show_layer_animation_bounds_rects = | 134 settings.initial_debug_state.show_layer_animation_bounds_rects = |
| 117 command_line->HasSwitch(cc::switches::kUIShowLayerAnimationBounds); | 135 command_line->HasSwitch(cc::switches::kUIShowLayerAnimationBounds); |
| 118 settings.initial_debug_state.show_paint_rects = | 136 settings.initial_debug_state.show_paint_rects = |
| 119 command_line->HasSwitch(switches::kUIShowPaintRects); | 137 command_line->HasSwitch(switches::kUIShowPaintRects); |
| 120 settings.initial_debug_state.show_property_changed_rects = | 138 settings.initial_debug_state.show_property_changed_rects = |
| 121 command_line->HasSwitch(cc::switches::kUIShowPropertyChangedRects); | 139 command_line->HasSwitch(cc::switches::kUIShowPropertyChangedRects); |
| 122 settings.initial_debug_state.show_surface_damage_rects = | 140 settings.initial_debug_state.show_surface_damage_rects = |
| 123 command_line->HasSwitch(cc::switches::kUIShowSurfaceDamageRects); | 141 command_line->HasSwitch(cc::switches::kUIShowSurfaceDamageRects); |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 570 void Compositor::TimeoutLocks() { | 588 void Compositor::TimeoutLocks() { |
| 571 // Make a copy, we're going to cause |active_locks_| to become | 589 // Make a copy, we're going to cause |active_locks_| to become |
| 572 // empty. | 590 // empty. |
| 573 std::vector<CompositorLock*> locks = active_locks_; | 591 std::vector<CompositorLock*> locks = active_locks_; |
| 574 for (auto* lock : locks) | 592 for (auto* lock : locks) |
| 575 lock->TimeoutLock(); | 593 lock->TimeoutLock(); |
| 576 DCHECK(active_locks_.empty()); | 594 DCHECK(active_locks_.empty()); |
| 577 } | 595 } |
| 578 | 596 |
| 579 } // namespace ui | 597 } // namespace ui |
| OLD | NEW |