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

Side by Side Diff: cc/layers/layer_impl.h

Issue 256303006: Make LayerScrollOffsetDelegate updates consistent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix build break Created 6 years, 7 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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 #ifndef CC_LAYERS_LAYER_IMPL_H_ 5 #ifndef CC_LAYERS_LAYER_IMPL_H_
6 #define CC_LAYERS_LAYER_IMPL_H_ 6 #define CC_LAYERS_LAYER_IMPL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 enum DrawMode { 58 enum DrawMode {
59 DRAW_MODE_NONE, 59 DRAW_MODE_NONE,
60 DRAW_MODE_HARDWARE, 60 DRAW_MODE_HARDWARE,
61 DRAW_MODE_SOFTWARE, 61 DRAW_MODE_SOFTWARE,
62 DRAW_MODE_RESOURCELESS_SOFTWARE 62 DRAW_MODE_RESOURCELESS_SOFTWARE
63 }; 63 };
64 64
65 class CC_EXPORT LayerImpl : public LayerAnimationValueObserver, 65 class CC_EXPORT LayerImpl : public LayerAnimationValueObserver,
66 public LayerAnimationValueProvider { 66 public LayerAnimationValueProvider {
67 public: 67 public:
68 // Allows for the ownership of the total scroll offset to be delegated outside
69 // of the layer.
70 class ScrollOffsetDelegate {
71 public:
72 virtual void SetTotalScrollOffset(const gfx::Vector2dF& new_value) = 0;
73 virtual gfx::Vector2dF GetTotalScrollOffset() = 0;
74 virtual bool IsExternalFlingActive() const = 0;
75 };
76
68 typedef LayerImplList RenderSurfaceListType; 77 typedef LayerImplList RenderSurfaceListType;
69 typedef LayerImplList LayerListType; 78 typedef LayerImplList LayerListType;
70 typedef RenderSurfaceImpl RenderSurfaceType; 79 typedef RenderSurfaceImpl RenderSurfaceType;
71 80
72 enum RenderingContextConstants { NO_RENDERING_CONTEXT = 0 }; 81 enum RenderingContextConstants { NO_RENDERING_CONTEXT = 0 };
73 82
74 static scoped_ptr<LayerImpl> Create(LayerTreeImpl* tree_impl, int id) { 83 static scoped_ptr<LayerImpl> Create(LayerTreeImpl* tree_impl, int id) {
75 return make_scoped_ptr(new LayerImpl(tree_impl, id)); 84 return make_scoped_ptr(new LayerImpl(tree_impl, id));
76 } 85 }
77 86
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 363
355 virtual void CalculateContentsScale(float ideal_contents_scale, 364 virtual void CalculateContentsScale(float ideal_contents_scale,
356 float device_scale_factor, 365 float device_scale_factor,
357 float page_scale_factor, 366 float page_scale_factor,
358 float maximum_animation_contents_scale, 367 float maximum_animation_contents_scale,
359 bool animating_transform_to_screen, 368 bool animating_transform_to_screen,
360 float* contents_scale_x, 369 float* contents_scale_x,
361 float* contents_scale_y, 370 float* contents_scale_y,
362 gfx::Size* content_bounds); 371 gfx::Size* content_bounds);
363 372
364 void SetScrollOffsetDelegate( 373 void SetScrollOffsetDelegate(ScrollOffsetDelegate* scroll_offset_delegate);
365 LayerScrollOffsetDelegate* scroll_offset_delegate);
366 bool IsExternalFlingActive() const; 374 bool IsExternalFlingActive() const;
367 375
368 void SetScrollOffset(const gfx::Vector2d& scroll_offset); 376 void SetScrollOffset(const gfx::Vector2d& scroll_offset);
369 void SetScrollOffsetAndDelta(const gfx::Vector2d& scroll_offset, 377 void SetScrollOffsetAndDelta(const gfx::Vector2d& scroll_offset,
370 const gfx::Vector2dF& scroll_delta); 378 const gfx::Vector2dF& scroll_delta);
371 gfx::Vector2d scroll_offset() const { return scroll_offset_; } 379 gfx::Vector2d scroll_offset() const { return scroll_offset_; }
372 380
373 gfx::Vector2d MaxScrollOffset() const; 381 gfx::Vector2d MaxScrollOffset() const;
374 gfx::Vector2dF ClampScrollToMaxScrollOffset(); 382 gfx::Vector2dF ClampScrollToMaxScrollOffset();
375 void SetScrollbarPosition(ScrollbarLayerImplBase* scrollbar_layer, 383 void SetScrollbarPosition(ScrollbarLayerImplBase* scrollbar_layer,
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 scoped_ptr<LayerImpl> replica_layer_; 593 scoped_ptr<LayerImpl> replica_layer_;
586 int layer_id_; 594 int layer_id_;
587 LayerTreeImpl* layer_tree_impl_; 595 LayerTreeImpl* layer_tree_impl_;
588 596
589 // Properties synchronized from the associated Layer. 597 // Properties synchronized from the associated Layer.
590 gfx::PointF anchor_point_; 598 gfx::PointF anchor_point_;
591 float anchor_point_z_; 599 float anchor_point_z_;
592 gfx::Size bounds_; 600 gfx::Size bounds_;
593 gfx::SizeF temporary_impl_bounds_; 601 gfx::SizeF temporary_impl_bounds_;
594 gfx::Vector2d scroll_offset_; 602 gfx::Vector2d scroll_offset_;
595 LayerScrollOffsetDelegate* scroll_offset_delegate_; 603 ScrollOffsetDelegate* scroll_offset_delegate_;
596 LayerImpl* scroll_clip_layer_; 604 LayerImpl* scroll_clip_layer_;
597 bool scrollable_ : 1; 605 bool scrollable_ : 1;
598 bool should_scroll_on_main_thread_ : 1; 606 bool should_scroll_on_main_thread_ : 1;
599 bool have_wheel_event_handlers_ : 1; 607 bool have_wheel_event_handlers_ : 1;
600 bool have_scroll_event_handlers_ : 1; 608 bool have_scroll_event_handlers_ : 1;
601 bool user_scrollable_horizontal_ : 1; 609 bool user_scrollable_horizontal_ : 1;
602 bool user_scrollable_vertical_ : 1; 610 bool user_scrollable_vertical_ : 1;
603 bool stacking_order_changed_ : 1; 611 bool stacking_order_changed_ : 1;
604 // Whether the "back" of this layer should draw. 612 // Whether the "back" of this layer should draw.
605 bool double_sided_ : 1; 613 bool double_sided_ : 1;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 DrawProperties<LayerImpl> draw_properties_; 691 DrawProperties<LayerImpl> draw_properties_;
684 692
685 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; 693 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_;
686 694
687 DISALLOW_COPY_AND_ASSIGN(LayerImpl); 695 DISALLOW_COPY_AND_ASSIGN(LayerImpl);
688 }; 696 };
689 697
690 } // namespace cc 698 } // namespace cc
691 699
692 #endif // CC_LAYERS_LAYER_IMPL_H_ 700 #endif // CC_LAYERS_LAYER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698