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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
482 void RenderWidgetCompositor::didStopFlinging() { | 482 void RenderWidgetCompositor::didStopFlinging() { |
483 layer_tree_host_->DidStopFlinging(); | 483 layer_tree_host_->DidStopFlinging(); |
484 } | 484 } |
485 | 485 |
486 void RenderWidgetCompositor::registerForAnimations(WebKit::WebLayer* layer) { | 486 void RenderWidgetCompositor::registerForAnimations(WebKit::WebLayer* layer) { |
487 cc::Layer* cc_layer = static_cast<webkit::WebLayerImpl*>(layer)->layer(); | 487 cc::Layer* cc_layer = static_cast<webkit::WebLayerImpl*>(layer)->layer(); |
488 cc_layer->layer_animation_controller()->SetAnimationRegistrar( | 488 cc_layer->layer_animation_controller()->SetAnimationRegistrar( |
489 layer_tree_host_->animation_registrar()); | 489 layer_tree_host_->animation_registrar()); |
490 } | 490 } |
491 | 491 |
492 void RenderWidgetCompositor::registerViewportLayers( | |
493 const WebKit::WebLayer* pageScaleLayer, | |
494 const WebKit::WebLayer* innerViewportScrollLayer, | |
495 const WebKit::WebLayer* outerViewportScrollLayer) { | |
496 layer_tree_host_->RegisterViewportLayers( | |
497 static_cast<const webkit::WebLayerImpl*>(pageScaleLayer)->layer(), | |
498 static_cast<const webkit::WebLayerImpl*>( | |
499 innerViewportScrollLayer)->layer(), | |
500 // The outer viewport layer will only exist when using pinch. | |
enne (OOO)
2013/09/12 18:57:02
pinch => pinch virtual viewports
wjmaclean
2013/09/12 19:06:17
Done.
| |
501 outerViewportScrollLayer ? static_cast<const webkit::WebLayerImpl*>( | |
502 outerViewportScrollLayer)->layer() | |
503 : 0); | |
enne (OOO)
2013/09/12 18:57:02
0 => NULL
wjmaclean
2013/09/12 19:06:17
Done.
| |
504 } | |
505 | |
506 void RenderWidgetCompositor::clearViewportLayers() { | |
507 layer_tree_host_->RegisterViewportLayers(scoped_refptr<cc::Layer>(), | |
508 scoped_refptr<cc::Layer>(), | |
509 scoped_refptr<cc::Layer>()); | |
510 } | |
511 | |
492 bool RenderWidgetCompositor::compositeAndReadback( | 512 bool RenderWidgetCompositor::compositeAndReadback( |
493 void *pixels, const WebRect& rect_in_device_viewport) { | 513 void *pixels, const WebRect& rect_in_device_viewport) { |
494 return layer_tree_host_->CompositeAndReadback(pixels, | 514 return layer_tree_host_->CompositeAndReadback(pixels, |
495 rect_in_device_viewport); | 515 rect_in_device_viewport); |
496 } | 516 } |
497 | 517 |
498 void RenderWidgetCompositor::finishAllRendering() { | 518 void RenderWidgetCompositor::finishAllRendering() { |
499 layer_tree_host_->FinishAllRendering(); | 519 layer_tree_host_->FinishAllRendering(); |
500 } | 520 } |
501 | 521 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
594 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); | 614 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); |
595 } | 615 } |
596 | 616 |
597 scoped_refptr<cc::ContextProvider> | 617 scoped_refptr<cc::ContextProvider> |
598 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { | 618 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { |
599 return RenderThreadImpl::current()-> | 619 return RenderThreadImpl::current()-> |
600 OffscreenContextProviderForCompositorThread(); | 620 OffscreenContextProviderForCompositorThread(); |
601 } | 621 } |
602 | 622 |
603 } // namespace content | 623 } // namespace content |
OLD | NEW |