Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Side by Side Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 16679011: Add viewport scrollbar class to support overlay scrollbars for pinch zoom virtual viewport. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add scrollbars layers in compositor, plumb layer ids to LayerTreeImpl. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 void RenderWidgetCompositor::didStopFlinging() { 465 void RenderWidgetCompositor::didStopFlinging() {
466 layer_tree_host_->DidStopFlinging(); 466 layer_tree_host_->DidStopFlinging();
467 } 467 }
468 468
469 void RenderWidgetCompositor::registerForAnimations(WebKit::WebLayer* layer) { 469 void RenderWidgetCompositor::registerForAnimations(WebKit::WebLayer* layer) {
470 cc::Layer* cc_layer = static_cast<webkit::WebLayerImpl*>(layer)->layer(); 470 cc::Layer* cc_layer = static_cast<webkit::WebLayerImpl*>(layer)->layer();
471 cc_layer->layer_animation_controller()->SetAnimationRegistrar( 471 cc_layer->layer_animation_controller()->SetAnimationRegistrar(
472 layer_tree_host_->animation_registrar()); 472 layer_tree_host_->animation_registrar());
473 } 473 }
474 474
475 void RenderWidgetCompositor::registerPinchViewportLayers(
476 const WebKit::WebLayer* innerViewportClipLayer,
477 const WebKit::WebLayer* pageScaleLayerLayer,
478 const WebKit::WebLayer* innerViewportScrollLayer,
479 const WebKit::WebLayer* outerViewportScrollLayer,
480 const WebKit::WebLayer* innerViewportHorizontalScrollbarLayer,
481 const WebKit::WebLayer* innerViewportVerticalScrollbarLayer) {
482 layer_tree_host_->RegisterPinchViewportLayers(
483 static_cast<const webkit::WebLayerImpl*>(innerViewportClipLayer)
484 ->layer(),
485 static_cast<const webkit::WebLayerImpl*>(pageScaleLayerLayer)->layer(),
486 static_cast<const webkit::WebLayerImpl*>(innerViewportScrollLayer)
487 ->layer(),
488 static_cast<const webkit::WebLayerImpl*>(outerViewportScrollLayer)
489 ->layer(),
490 static_cast<const webkit::WebLayerImpl*>(
491 innerViewportHorizontalScrollbarLayer)->layer(),
492 static_cast<const webkit::WebLayerImpl*>(
493 innerViewportVerticalScrollbarLayer)->layer());
494 }
495
496 void RenderWidgetCompositor::clearPinchViewportLayers() {
497 layer_tree_host_->RegisterPinchViewportLayers(
498 scoped_refptr<cc::Layer>(),
499 scoped_refptr<cc::Layer>(),
500 scoped_refptr<cc::Layer>(),
501 scoped_refptr<cc::Layer>(),
502 scoped_refptr<cc::Layer>(),
503 scoped_refptr<cc::Layer>());
504 }
505
475 bool RenderWidgetCompositor::compositeAndReadback( 506 bool RenderWidgetCompositor::compositeAndReadback(
476 void *pixels, const WebRect& rect_in_device_viewport) { 507 void *pixels, const WebRect& rect_in_device_viewport) {
477 return layer_tree_host_->CompositeAndReadback(pixels, 508 return layer_tree_host_->CompositeAndReadback(pixels,
478 rect_in_device_viewport); 509 rect_in_device_viewport);
479 } 510 }
480 511
481 void RenderWidgetCompositor::finishAllRendering() { 512 void RenderWidgetCompositor::finishAllRendering() {
482 layer_tree_host_->FinishAllRendering(); 513 layer_tree_host_->FinishAllRendering();
483 } 514 }
484 515
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); 599 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread();
569 } 600 }
570 601
571 scoped_refptr<cc::ContextProvider> 602 scoped_refptr<cc::ContextProvider>
572 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { 603 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() {
573 return RenderThreadImpl::current()-> 604 return RenderThreadImpl::current()->
574 OffscreenContextProviderForCompositorThread(); 605 OffscreenContextProviderForCompositorThread();
575 } 606 }
576 607
577 } // namespace content 608 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698