| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/renderer/gpu/render_widget_compositor.h" | 5 #include "content/renderer/gpu/render_widget_compositor.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 | 345 |
| 346 void RenderWidgetCompositor::SetNeedsRedrawRect(gfx::Rect damage_rect) { | 346 void RenderWidgetCompositor::SetNeedsRedrawRect(gfx::Rect damage_rect) { |
| 347 layer_tree_host_->SetNeedsRedrawRect(damage_rect); | 347 layer_tree_host_->SetNeedsRedrawRect(damage_rect); |
| 348 } | 348 } |
| 349 | 349 |
| 350 void RenderWidgetCompositor::SetLatencyInfo( | 350 void RenderWidgetCompositor::SetLatencyInfo( |
| 351 const cc::LatencyInfo& latency_info) { | 351 const cc::LatencyInfo& latency_info) { |
| 352 layer_tree_host_->SetLatencyInfo(latency_info); | 352 layer_tree_host_->SetLatencyInfo(latency_info); |
| 353 } | 353 } |
| 354 | 354 |
| 355 void RenderWidgetCompositor::ShowTopControls(bool show) { |
| 356 layer_tree_host_->ShowTopControls(show); |
| 357 } |
| 358 |
| 359 float RenderWidgetCompositor::GetTopControlsOffset() { |
| 360 return layer_tree_host_->GetTopControlsOffset(); |
| 361 } |
| 362 |
| 355 bool RenderWidgetCompositor::initialize(cc::LayerTreeSettings settings) { | 363 bool RenderWidgetCompositor::initialize(cc::LayerTreeSettings settings) { |
| 356 scoped_ptr<cc::Thread> impl_thread; | 364 scoped_ptr<cc::Thread> impl_thread; |
| 357 scoped_refptr<base::MessageLoopProxy> compositor_message_loop_proxy = | 365 scoped_refptr<base::MessageLoopProxy> compositor_message_loop_proxy = |
| 358 RenderThreadImpl::current()->compositor_message_loop_proxy(); | 366 RenderThreadImpl::current()->compositor_message_loop_proxy(); |
| 359 threaded_ = !!compositor_message_loop_proxy; | 367 threaded_ = !!compositor_message_loop_proxy; |
| 360 if (threaded_) { | 368 if (threaded_) { |
| 361 impl_thread = cc::ThreadImpl::CreateForDifferentThread( | 369 impl_thread = cc::ThreadImpl::CreateForDifferentThread( |
| 362 compositor_message_loop_proxy); | 370 compositor_message_loop_proxy); |
| 363 } | 371 } |
| 364 layer_tree_host_ = cc::LayerTreeHost::Create(this, | 372 layer_tree_host_ = cc::LayerTreeHost::Create(this, |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); | 578 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); |
| 571 } | 579 } |
| 572 | 580 |
| 573 scoped_refptr<cc::ContextProvider> | 581 scoped_refptr<cc::ContextProvider> |
| 574 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { | 582 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { |
| 575 return RenderThreadImpl::current()-> | 583 return RenderThreadImpl::current()-> |
| 576 OffscreenContextProviderForCompositorThread(); | 584 OffscreenContextProviderForCompositorThread(); |
| 577 } | 585 } |
| 578 | 586 |
| 579 } // namespace content | 587 } // namespace content |
| OLD | NEW |