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/gfx/compositor/compositor.h" | 5 #include "ui/gfx/compositor/compositor.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "third_party/skia/include/images/SkImageEncoder.h" | 8 #include "third_party/skia/include/images/SkImageEncoder.h" |
9 #include "third_party/skia/include/core/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 WebKit::WebLayerTreeView::Settings settings; | 129 WebKit::WebLayerTreeView::Settings settings; |
130 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 130 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
131 settings.showFPSCounter = | 131 settings.showFPSCounter = |
132 command_line->HasSwitch(switches::kUIShowFPSCounter); | 132 command_line->HasSwitch(switches::kUIShowFPSCounter); |
133 settings.showPlatformLayerTree = | 133 settings.showPlatformLayerTree = |
134 command_line->HasSwitch(switches::kUIShowLayerTree); | 134 command_line->HasSwitch(switches::kUIShowLayerTree); |
135 settings.refreshRate = test_compositor_enabled ? | 135 settings.refreshRate = test_compositor_enabled ? |
136 kTestRefreshRate : kDefaultRefreshRate; | 136 kTestRefreshRate : kDefaultRefreshRate; |
137 settings.partialSwapEnabled = | 137 settings.partialSwapEnabled = |
138 command_line->HasSwitch(switches::kUIEnablePartialSwap); | 138 command_line->HasSwitch(switches::kUIEnablePartialSwap); |
| 139 #if defined(PER_TILE_PAINTING) |
| 140 settings.perTilePainting = |
| 141 command_line->HasSwitch(switches::kUIEnablePerTilePainting); |
| 142 #endif |
139 | 143 |
140 host_ = WebKit::WebLayerTreeView::create(this, root_web_layer_, settings); | 144 host_ = WebKit::WebLayerTreeView::create(this, root_web_layer_, settings); |
141 root_web_layer_.setAnchorPoint(WebKit::WebFloatPoint(0.f, 0.f)); | 145 root_web_layer_.setAnchorPoint(WebKit::WebFloatPoint(0.f, 0.f)); |
142 WidgetSizeChanged(size_); | 146 WidgetSizeChanged(size_); |
143 } | 147 } |
144 | 148 |
145 Compositor::~Compositor() { | 149 Compositor::~Compositor() { |
146 // There's a cycle between |root_web_layer_| and |host_|, which results in | 150 // There's a cycle between |root_web_layer_| and |host_|, which results in |
147 // leaking and/or crashing. Explicitly set the root layer to NULL so the cycle | 151 // leaking and/or crashing. Explicitly set the root layer to NULL so the cycle |
148 // is broken. | 152 // is broken. |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 switches::kDisableTestCompositor)) { | 324 switches::kDisableTestCompositor)) { |
321 test_compositor_enabled = true; | 325 test_compositor_enabled = true; |
322 } | 326 } |
323 } | 327 } |
324 | 328 |
325 COMPOSITOR_EXPORT void DisableTestCompositor() { | 329 COMPOSITOR_EXPORT void DisableTestCompositor() { |
326 test_compositor_enabled = false; | 330 test_compositor_enabled = false; |
327 } | 331 } |
328 | 332 |
329 } // namespace ui | 333 } // namespace ui |
OLD | NEW |