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 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 } | 372 } |
373 | 373 |
374 void RenderWidgetCompositor::NotifyInputThrottledUntilCommit() { | 374 void RenderWidgetCompositor::NotifyInputThrottledUntilCommit() { |
375 layer_tree_host_->NotifyInputThrottledUntilCommit(); | 375 layer_tree_host_->NotifyInputThrottledUntilCommit(); |
376 } | 376 } |
377 | 377 |
378 const cc::Layer* RenderWidgetCompositor::GetRootLayer() const { | 378 const cc::Layer* RenderWidgetCompositor::GetRootLayer() const { |
379 return layer_tree_host_->root_layer(); | 379 return layer_tree_host_->root_layer(); |
380 } | 380 } |
381 | 381 |
| 382 void RenderWidgetCompositor::SetNeedsForcedRedraw() { |
| 383 layer_tree_host_->SetNextCommitForcesRedraw(); |
| 384 if (threaded_) { |
| 385 LOG(INFO) << "RenderWidgetCompositor::SetNeedsForcedRedraw: threaded"; |
| 386 layer_tree_host_->SetNeedsAnimate(); |
| 387 } else { |
| 388 LOG(INFO) << "RenderWidgetCompositor::SetNeedsForcedRedraw: not threaded"; |
| 389 widget_->scheduleAnimation(); |
| 390 } |
| 391 } |
| 392 |
382 bool RenderWidgetCompositor::initialize(cc::LayerTreeSettings settings) { | 393 bool RenderWidgetCompositor::initialize(cc::LayerTreeSettings settings) { |
383 scoped_refptr<base::MessageLoopProxy> compositor_message_loop_proxy = | 394 scoped_refptr<base::MessageLoopProxy> compositor_message_loop_proxy = |
384 RenderThreadImpl::current()->compositor_message_loop_proxy(); | 395 RenderThreadImpl::current()->compositor_message_loop_proxy(); |
385 layer_tree_host_ = cc::LayerTreeHost::Create(this, | 396 layer_tree_host_ = cc::LayerTreeHost::Create(this, |
386 settings, | 397 settings, |
387 compositor_message_loop_proxy); | 398 compositor_message_loop_proxy); |
388 return layer_tree_host_; | 399 return layer_tree_host_; |
389 } | 400 } |
390 | 401 |
391 void RenderWidgetCompositor::setSurfaceReady() { | 402 void RenderWidgetCompositor::setSurfaceReady() { |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); | 601 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); |
591 } | 602 } |
592 | 603 |
593 scoped_refptr<cc::ContextProvider> | 604 scoped_refptr<cc::ContextProvider> |
594 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { | 605 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { |
595 return RenderThreadImpl::current()-> | 606 return RenderThreadImpl::current()-> |
596 OffscreenContextProviderForCompositorThread(); | 607 OffscreenContextProviderForCompositorThread(); |
597 } | 608 } |
598 | 609 |
599 } // namespace content | 610 } // namespace content |
OLD | NEW |