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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
495 double duration_sec) { | 495 double duration_sec) { |
496 base::TimeDelta duration = base::TimeDelta::FromMicroseconds( | 496 base::TimeDelta duration = base::TimeDelta::FromMicroseconds( |
497 duration_sec * base::Time::kMicrosecondsPerSecond); | 497 duration_sec * base::Time::kMicrosecondsPerSecond); |
498 layer_tree_host_->StartPageScaleAnimation( | 498 layer_tree_host_->StartPageScaleAnimation( |
499 gfx::Vector2d(destination.x, destination.y), | 499 gfx::Vector2d(destination.x, destination.y), |
500 use_anchor, | 500 use_anchor, |
501 new_page_scale, | 501 new_page_scale, |
502 duration); | 502 duration); |
503 } | 503 } |
504 | 504 |
505 void RenderWidgetCompositor::setNeedsAnimate() { | 505 void RenderWidgetCompositor::setNeedsUpdateLayers() { |
506 layer_tree_host_->SetNeedsAnimate(); | 506 layer_tree_host_->SetNeedsUpdateLayers(); |
507 } | 507 } |
508 | 508 |
509 void RenderWidgetCompositor::setNeedsRedraw() { | 509 void RenderWidgetCompositor::setNeedsRedraw() { |
510 // TODO(trchen): This function is not doing what the name indicates? | |
jamesr
2013/11/19 00:54:26
the purpose of this function is to request that wh
| |
510 if (threaded_) | 511 if (threaded_) |
511 layer_tree_host_->SetNeedsAnimate(); | 512 layer_tree_host_->SetNeedsUpdateLayers(); |
512 else | 513 else |
513 widget_->scheduleAnimation(); | 514 widget_->scheduleAnimation(); |
514 } | 515 } |
515 | 516 |
516 bool RenderWidgetCompositor::commitRequested() const { | |
517 return layer_tree_host_->CommitRequested(); | |
518 } | |
519 | |
520 void RenderWidgetCompositor::didStopFlinging() { | 517 void RenderWidgetCompositor::didStopFlinging() { |
521 layer_tree_host_->DidStopFlinging(); | 518 layer_tree_host_->DidStopFlinging(); |
522 } | 519 } |
523 | 520 |
524 void RenderWidgetCompositor::registerForAnimations(blink::WebLayer* layer) { | 521 void RenderWidgetCompositor::registerForAnimations(blink::WebLayer* layer) { |
525 cc::Layer* cc_layer = static_cast<webkit::WebLayerImpl*>(layer)->layer(); | 522 cc::Layer* cc_layer = static_cast<webkit::WebLayerImpl*>(layer)->layer(); |
526 cc_layer->layer_animation_controller()->SetAnimationRegistrar( | 523 cc_layer->layer_animation_controller()->SetAnimationRegistrar( |
527 layer_tree_host_->animation_registrar()); | 524 layer_tree_host_->animation_registrar()); |
528 } | 525 } |
529 | 526 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
663 widget_->OnSwapBuffersAborted(); | 660 widget_->OnSwapBuffersAborted(); |
664 } | 661 } |
665 | 662 |
666 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 663 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
667 cc::ContextProvider* provider = | 664 cc::ContextProvider* provider = |
668 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 665 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
669 provider->Context3d()->rateLimitOffscreenContextCHROMIUM(); | 666 provider->Context3d()->rateLimitOffscreenContextCHROMIUM(); |
670 } | 667 } |
671 | 668 |
672 } // namespace content | 669 } // namespace content |
OLD | NEW |