| 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 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #if defined(OS_ANDROID) | 10 #if defined(OS_ANDROID) |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 } | 406 } |
| 407 | 407 |
| 408 void RenderWidgetCompositor::NotifyInputThrottledUntilCommit() { | 408 void RenderWidgetCompositor::NotifyInputThrottledUntilCommit() { |
| 409 layer_tree_host_->NotifyInputThrottledUntilCommit(); | 409 layer_tree_host_->NotifyInputThrottledUntilCommit(); |
| 410 } | 410 } |
| 411 | 411 |
| 412 const cc::Layer* RenderWidgetCompositor::GetRootLayer() const { | 412 const cc::Layer* RenderWidgetCompositor::GetRootLayer() const { |
| 413 return layer_tree_host_->root_layer(); | 413 return layer_tree_host_->root_layer(); |
| 414 } | 414 } |
| 415 | 415 |
| 416 bool RenderWidgetCompositor::ScheduleMicroBenchmark( | 416 int RenderWidgetCompositor::ScheduleMicroBenchmark( |
| 417 const std::string& name, | 417 const std::string& name, |
| 418 scoped_ptr<base::Value> value, | 418 scoped_ptr<base::Value> value, |
| 419 const base::Callback<void(scoped_ptr<base::Value>)>& callback) { | 419 const base::Callback<void(scoped_ptr<base::Value>)>& callback) { |
| 420 return layer_tree_host_->ScheduleMicroBenchmark(name, value.Pass(), callback); | 420 return layer_tree_host_->ScheduleMicroBenchmark(name, value.Pass(), callback); |
| 421 } | 421 } |
| 422 | 422 |
| 423 bool RenderWidgetCompositor::SendMessageToMicroBenchmark( |
| 424 int id, |
| 425 scoped_ptr<base::Value> value) { |
| 426 return layer_tree_host_->SendMessageToMicroBenchmark(id, value.Pass()); |
| 427 } |
| 428 |
| 423 void RenderWidgetCompositor::Initialize(cc::LayerTreeSettings settings) { | 429 void RenderWidgetCompositor::Initialize(cc::LayerTreeSettings settings) { |
| 424 scoped_refptr<base::MessageLoopProxy> compositor_message_loop_proxy; | 430 scoped_refptr<base::MessageLoopProxy> compositor_message_loop_proxy; |
| 425 RenderThreadImpl* render_thread = RenderThreadImpl::current(); | 431 RenderThreadImpl* render_thread = RenderThreadImpl::current(); |
| 426 cc::SharedBitmapManager* shared_bitmap_manager = NULL; | 432 cc::SharedBitmapManager* shared_bitmap_manager = NULL; |
| 427 // render_thread may be NULL in tests. | 433 // render_thread may be NULL in tests. |
| 428 if (render_thread) { | 434 if (render_thread) { |
| 429 compositor_message_loop_proxy = | 435 compositor_message_loop_proxy = |
| 430 render_thread->compositor_message_loop_proxy(); | 436 render_thread->compositor_message_loop_proxy(); |
| 431 shared_bitmap_manager = render_thread->shared_bitmap_manager(); | 437 shared_bitmap_manager = render_thread->shared_bitmap_manager(); |
| 432 } | 438 } |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 widget_->OnSwapBuffersAborted(); | 704 widget_->OnSwapBuffersAborted(); |
| 699 } | 705 } |
| 700 | 706 |
| 701 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 707 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
| 702 cc::ContextProvider* provider = | 708 cc::ContextProvider* provider = |
| 703 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 709 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
| 704 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 710 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
| 705 } | 711 } |
| 706 | 712 |
| 707 } // namespace content | 713 } // namespace content |
| OLD | NEW |