| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_cc.h" | 5 #include "ui/gfx/compositor/compositor_cc.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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 void TextureCC::Draw(const ui::TextureDrawParams& params, | 124 void TextureCC::Draw(const ui::TextureDrawParams& params, |
| 125 const gfx::Rect& clip_bounds_in_texture) { | 125 const gfx::Rect& clip_bounds_in_texture) { |
| 126 NOTREACHED(); | 126 NOTREACHED(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 CompositorCC::CompositorCC(CompositorDelegate* delegate, | 129 CompositorCC::CompositorCC(CompositorDelegate* delegate, |
| 130 gfx::AcceleratedWidget widget, | 130 gfx::AcceleratedWidget widget, |
| 131 const gfx::Size& size) | 131 const gfx::Size& size) |
| 132 : Compositor(delegate, size), | 132 : Compositor(delegate, size), |
| 133 widget_(widget), | 133 widget_(widget), |
| 134 root_web_layer_(WebKit::WebLayer::create(this)) { | 134 root_web_layer_(WebKit::WebLayer::create()) { |
| 135 WebKit::WebLayerTreeView::Settings settings; | 135 WebKit::WebLayerTreeView::Settings settings; |
| 136 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 136 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 137 settings.showFPSCounter = | 137 settings.showFPSCounter = |
| 138 command_line->HasSwitch(switches::kUIShowFPSCounter); | 138 command_line->HasSwitch(switches::kUIShowFPSCounter); |
| 139 settings.showPlatformLayerTree = | 139 settings.showPlatformLayerTree = |
| 140 command_line->HasSwitch(switches::kUIShowLayerTree); | 140 command_line->HasSwitch(switches::kUIShowLayerTree); |
| 141 settings.partialSwapEnabled = | 141 settings.partialSwapEnabled = |
| 142 command_line->HasSwitch(switches::kUIEnablePartialSwap); | 142 command_line->HasSwitch(switches::kUIEnablePartialSwap); |
| 143 | 143 |
| 144 #ifndef WEBCOMPOSITOR_HAS_INITIALIZE | 144 #ifndef WEBCOMPOSITOR_HAS_INITIALIZE |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 return context; | 268 return context; |
| 269 } | 269 } |
| 270 | 270 |
| 271 void CompositorCC::didRebindGraphicsContext(bool success) { | 271 void CompositorCC::didRebindGraphicsContext(bool success) { |
| 272 } | 272 } |
| 273 | 273 |
| 274 void CompositorCC::scheduleComposite() { | 274 void CompositorCC::scheduleComposite() { |
| 275 ScheduleDraw(); | 275 ScheduleDraw(); |
| 276 } | 276 } |
| 277 | 277 |
| 278 void CompositorCC::notifyNeedsComposite() { | |
| 279 ScheduleDraw(); | |
| 280 } | |
| 281 | |
| 282 Compositor* Compositor::Create(CompositorDelegate* owner, | 278 Compositor* Compositor::Create(CompositorDelegate* owner, |
| 283 gfx::AcceleratedWidget widget, | 279 gfx::AcceleratedWidget widget, |
| 284 const gfx::Size& size) { | 280 const gfx::Size& size) { |
| 285 return new CompositorCC(owner, widget, size); | 281 return new CompositorCC(owner, widget, size); |
| 286 } | 282 } |
| 287 | 283 |
| 288 COMPOSITOR_EXPORT void SetupTestCompositor() { | 284 COMPOSITOR_EXPORT void SetupTestCompositor() { |
| 289 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 285 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 290 switches::kDisableTestCompositor)) { | 286 switches::kDisableTestCompositor)) { |
| 291 test_context_enabled = true; | 287 test_context_enabled = true; |
| 292 } | 288 } |
| 293 } | 289 } |
| 294 | 290 |
| 295 COMPOSITOR_EXPORT void DisableTestCompositor() { | 291 COMPOSITOR_EXPORT void DisableTestCompositor() { |
| 296 test_context_enabled = false; | 292 test_context_enabled = false; |
| 297 } | 293 } |
| 298 | 294 |
| 299 } // namespace ui | 295 } // namespace ui |
| OLD | NEW |