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*>(innerViewportScrollLayer) |
| 499 ->layer(), |
| 500 // The outer viewport layer will only exist when using pinch virtual |
| 501 // viewports. |
| 502 outerViewportScrollLayer ? static_cast<const webkit::WebLayerImpl*>( |
| 503 outerViewportScrollLayer)->layer() |
| 504 : NULL); |
| 505 } |
| 506 |
| 507 void RenderWidgetCompositor::clearViewportLayers() { |
| 508 layer_tree_host_->RegisterViewportLayers(scoped_refptr<cc::Layer>(), |
| 509 scoped_refptr<cc::Layer>(), |
| 510 scoped_refptr<cc::Layer>()); |
| 511 } |
| 512 |
492 bool RenderWidgetCompositor::compositeAndReadback( | 513 bool RenderWidgetCompositor::compositeAndReadback( |
493 void *pixels, const WebRect& rect_in_device_viewport) { | 514 void *pixels, const WebRect& rect_in_device_viewport) { |
494 return layer_tree_host_->CompositeAndReadback(pixels, | 515 return layer_tree_host_->CompositeAndReadback(pixels, |
495 rect_in_device_viewport); | 516 rect_in_device_viewport); |
496 } | 517 } |
497 | 518 |
498 void RenderWidgetCompositor::finishAllRendering() { | 519 void RenderWidgetCompositor::finishAllRendering() { |
499 layer_tree_host_->FinishAllRendering(); | 520 layer_tree_host_->FinishAllRendering(); |
500 } | 521 } |
501 | 522 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); | 615 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); |
595 } | 616 } |
596 | 617 |
597 scoped_refptr<cc::ContextProvider> | 618 scoped_refptr<cc::ContextProvider> |
598 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { | 619 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { |
599 return RenderThreadImpl::current()-> | 620 return RenderThreadImpl::current()-> |
600 OffscreenContextProviderForCompositorThread(); | 621 OffscreenContextProviderForCompositorThread(); |
601 } | 622 } |
602 | 623 |
603 } // namespace content | 624 } // namespace content |
OLD | NEW |