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

Side by Side Diff: cc/layer.cc

Issue 11975007: Implement one-page-at-a-time mousewheel scrolling in the impl thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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 "cc/layer.h" 5 #include "cc/layer.h"
6 6
7 #include "cc/animation.h" 7 #include "cc/animation.h"
8 #include "cc/animation_events.h" 8 #include "cc/animation_events.h"
9 #include "cc/layer_animation_controller.h" 9 #include "cc/layer_animation_controller.h"
10 #include "cc/layer_impl.h" 10 #include "cc/layer_impl.h"
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 } 445 }
446 446
447 void Layer::setMaxScrollOffset(gfx::Vector2d maxScrollOffset) 447 void Layer::setMaxScrollOffset(gfx::Vector2d maxScrollOffset)
448 { 448 {
449 if (m_maxScrollOffset == maxScrollOffset) 449 if (m_maxScrollOffset == maxScrollOffset)
450 return; 450 return;
451 m_maxScrollOffset = maxScrollOffset; 451 m_maxScrollOffset = maxScrollOffset;
452 setNeedsCommit(); 452 setNeedsCommit();
453 } 453 }
454 454
455 void Layer::setVisibleScrollArea(gfx::Size visibleScrollArea)
456 {
457 if (m_visibleScrollArea == visibleScrollArea)
458 return;
459 m_visibleScrollArea = visibleScrollArea;
460 setNeedsCommit();
461 }
462
463
455 void Layer::setScrollable(bool scrollable) 464 void Layer::setScrollable(bool scrollable)
456 { 465 {
457 if (m_scrollable == scrollable) 466 if (m_scrollable == scrollable)
458 return; 467 return;
459 m_scrollable = scrollable; 468 m_scrollable = scrollable;
460 setNeedsCommit(); 469 setNeedsCommit();
461 } 470 }
462 471
463 void Layer::setShouldScrollOnMainThread(bool shouldScrollOnMainThread) 472 void Layer::setShouldScrollOnMainThread(bool shouldScrollOnMainThread)
464 { 473 {
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 layer->setFixedToContainerLayer(m_fixedToContainerLayer); 615 layer->setFixedToContainerLayer(m_fixedToContainerLayer);
607 layer->setPreserves3D(preserves3D()); 616 layer->setPreserves3D(preserves3D());
608 layer->setUseParentBackfaceVisibility(m_useParentBackfaceVisibility); 617 layer->setUseParentBackfaceVisibility(m_useParentBackfaceVisibility);
609 layer->setSublayerTransform(m_sublayerTransform); 618 layer->setSublayerTransform(m_sublayerTransform);
610 if (!transformIsAnimating()) 619 if (!transformIsAnimating())
611 layer->setTransform(m_transform); 620 layer->setTransform(m_transform);
612 621
613 layer->setScrollable(m_scrollable); 622 layer->setScrollable(m_scrollable);
614 layer->setScrollOffset(m_scrollOffset); 623 layer->setScrollOffset(m_scrollOffset);
615 layer->setMaxScrollOffset(m_maxScrollOffset); 624 layer->setMaxScrollOffset(m_maxScrollOffset);
625 layer->setVisibleScrollArea(m_visibleScrollArea);
616 626
617 // If the main thread commits multiple times before the impl thread actually draws, then damage tracking 627 // If the main thread commits multiple times before the impl thread actually draws, then damage tracking
618 // will become incorrect if we simply clobber the updateRect here. The Layer Impl's updateRect needs to 628 // will become incorrect if we simply clobber the updateRect here. The Layer Impl's updateRect needs to
619 // accumulate (i.e. union) any update changes that have occurred on the main thread. 629 // accumulate (i.e. union) any update changes that have occurred on the main thread.
620 m_updateRect.Union(layer->updateRect()); 630 m_updateRect.Union(layer->updateRect());
621 layer->setUpdateRect(m_updateRect); 631 layer->setUpdateRect(m_updateRect);
622 632
623 if (layer->layerTreeImpl()->settings().implSidePainting) { 633 if (layer->layerTreeImpl()->settings().implSidePainting) {
624 DCHECK(layer->layerTreeImpl()->IsPendingTree()); 634 DCHECK(layer->layerTreeImpl()->IsPendingTree());
625 LayerImpl* active_twin = layer->layerTreeImpl()->FindActiveTreeLayerById (id()); 635 LayerImpl* active_twin = layer->layerTreeImpl()->FindActiveTreeLayerById (id());
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 { 860 {
851 return 0; 861 return 0;
852 } 862 }
853 863
854 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped _refptr<Layer> >::iterator, void*) 864 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped _refptr<Layer> >::iterator, void*)
855 { 865 {
856 // Currently we don't use z-order to decide what to paint, so there's no nee d to actually sort Layers. 866 // Currently we don't use z-order to decide what to paint, so there's no nee d to actually sort Layers.
857 } 867 }
858 868
859 } // namespace cc 869 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer.h ('k') | cc/layer_impl.h » ('j') | cc/layer_tree_host_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698