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

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

Issue 2767213003: First Implementation of Snapped Points
Patch Set: Rebase and format Created 3 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
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/layer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 11 matching lines...) Expand all
22 #include "cc/base/synced_property.h" 22 #include "cc/base/synced_property.h"
23 #include "cc/cc_export.h" 23 #include "cc/cc_export.h"
24 #include "cc/debug/layer_tree_debug_state.h" 24 #include "cc/debug/layer_tree_debug_state.h"
25 #include "cc/input/input_handler.h" 25 #include "cc/input/input_handler.h"
26 #include "cc/layers/draw_properties.h" 26 #include "cc/layers/draw_properties.h"
27 #include "cc/layers/layer_collections.h" 27 #include "cc/layers/layer_collections.h"
28 #include "cc/layers/layer_impl_test_properties.h" 28 #include "cc/layers/layer_impl_test_properties.h"
29 #include "cc/layers/layer_position_constraint.h" 29 #include "cc/layers/layer_position_constraint.h"
30 #include "cc/layers/performance_properties.h" 30 #include "cc/layers/performance_properties.h"
31 #include "cc/layers/render_surface_impl.h" 31 #include "cc/layers/render_surface_impl.h"
32 #include "cc/layers/snap_point_list.h"
32 #include "cc/quads/shared_quad_state.h" 33 #include "cc/quads/shared_quad_state.h"
33 #include "cc/resources/resource_provider.h" 34 #include "cc/resources/resource_provider.h"
34 #include "cc/tiles/tile_priority.h" 35 #include "cc/tiles/tile_priority.h"
35 #include "cc/trees/element_id.h" 36 #include "cc/trees/element_id.h"
36 #include "cc/trees/mutator_host_client.h" 37 #include "cc/trees/mutator_host_client.h"
37 #include "cc/trees/target_property.h" 38 #include "cc/trees/target_property.h"
38 #include "third_party/skia/include/core/SkColor.h" 39 #include "third_party/skia/include/core/SkColor.h"
39 #include "ui/gfx/geometry/point3_f.h" 40 #include "ui/gfx/geometry/point3_f.h"
40 #include "ui/gfx/geometry/rect.h" 41 #include "ui/gfx/geometry/rect.h"
41 #include "ui/gfx/geometry/rect_f.h" 42 #include "ui/gfx/geometry/rect_f.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 return viewport_layer_type() != NOT_VIEWPORT_LAYER; 292 return viewport_layer_type() != NOT_VIEWPORT_LAYER;
292 } 293 }
293 294
294 void SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset); 295 void SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset);
295 gfx::ScrollOffset CurrentScrollOffset() const; 296 gfx::ScrollOffset CurrentScrollOffset() const;
296 297
297 gfx::ScrollOffset MaxScrollOffset() const; 298 gfx::ScrollOffset MaxScrollOffset() const;
298 gfx::ScrollOffset ClampScrollOffsetToLimits(gfx::ScrollOffset offset) const; 299 gfx::ScrollOffset ClampScrollOffsetToLimits(gfx::ScrollOffset offset) const;
299 gfx::Vector2dF ClampScrollToMaxScrollOffset(); 300 gfx::Vector2dF ClampScrollToMaxScrollOffset();
300 301
302 void SetScrollSnapOffsets(const SnapPointList& offsets);
303 std::vector<SnapPoint> snap_offsets_horizontal() {
304 return snap_offsets_.horizontal;
305 }
306 std::vector<SnapPoint> snap_offsets_vertical() {
307 return snap_offsets_.vertical;
308 }
309
301 // Returns the delta of the scroll that was outside of the bounds of the 310 // Returns the delta of the scroll that was outside of the bounds of the
302 // initial scroll 311 // initial scroll
303 gfx::Vector2dF ScrollBy(const gfx::Vector2dF& scroll); 312 gfx::Vector2dF ScrollBy(const gfx::Vector2dF& scroll);
304 313
305 void SetScrollClipLayer(int scroll_clip_layer_id); 314 void SetScrollClipLayer(int scroll_clip_layer_id);
306 int scroll_clip_layer_id() const { return scroll_clip_layer_id_; } 315 int scroll_clip_layer_id() const { return scroll_clip_layer_id_; }
307 LayerImpl* scroll_clip_layer() const; 316 LayerImpl* scroll_clip_layer() const;
308 bool scrollable() const; 317 bool scrollable() const;
309 318
310 void set_main_thread_scrolling_reasons( 319 void set_main_thread_scrolling_reasons(
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 SkColor safe_opaque_background_color_; 517 SkColor safe_opaque_background_color_;
509 518
510 gfx::PointF position_; 519 gfx::PointF position_;
511 520
512 gfx::Rect clip_rect_in_target_space_; 521 gfx::Rect clip_rect_in_target_space_;
513 int transform_tree_index_; 522 int transform_tree_index_;
514 int effect_tree_index_; 523 int effect_tree_index_;
515 int clip_tree_index_; 524 int clip_tree_index_;
516 int scroll_tree_index_; 525 int scroll_tree_index_;
517 526
527 SnapPointList snap_offsets_;
528
518 protected: 529 protected:
519 friend class TreeSynchronizer; 530 friend class TreeSynchronizer;
520 531
521 DrawMode current_draw_mode_; 532 DrawMode current_draw_mode_;
522 533
523 private: 534 private:
524 PropertyTrees* GetPropertyTrees() const; 535 PropertyTrees* GetPropertyTrees() const;
525 ClipTree& GetClipTree() const; 536 ClipTree& GetClipTree() const;
526 EffectTree& GetEffectTree() const; 537 EffectTree& GetEffectTree() const;
527 ScrollTree& GetScrollTree() const; 538 ScrollTree& GetScrollTree() const;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 // is being animated). For this reason, while these layers are not drawn, they 572 // is being animated). For this reason, while these layers are not drawn, they
562 // are still rasterized. 573 // are still rasterized.
563 bool raster_even_if_not_drawn_ : 1; 574 bool raster_even_if_not_drawn_ : 1;
564 575
565 DISALLOW_COPY_AND_ASSIGN(LayerImpl); 576 DISALLOW_COPY_AND_ASSIGN(LayerImpl);
566 }; 577 };
567 578
568 } // namespace cc 579 } // namespace cc
569 580
570 #endif // CC_LAYERS_LAYER_IMPL_H_ 581 #endif // CC_LAYERS_LAYER_IMPL_H_
OLDNEW
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698