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

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

Issue 584503005: Make scroll offset type of float in cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update unittests Created 6 years, 3 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
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 #ifndef CC_LAYERS_LAYER_H_ 5 #ifndef CC_LAYERS_LAYER_H_
6 #define CC_LAYERS_LAYER_H_ 6 #define CC_LAYERS_LAYER_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 draw_properties_.render_target->render_surface()); 254 draw_properties_.render_target->render_surface());
255 return draw_properties_.render_target; 255 return draw_properties_.render_target;
256 } 256 }
257 RenderSurface* render_surface() const { 257 RenderSurface* render_surface() const {
258 return draw_properties_.render_surface.get(); 258 return draw_properties_.render_surface.get();
259 } 259 }
260 int num_unclipped_descendants() const { 260 int num_unclipped_descendants() const {
261 return draw_properties_.num_unclipped_descendants; 261 return draw_properties_.num_unclipped_descendants;
262 } 262 }
263 263
264 void SetScrollOffset(gfx::Vector2d scroll_offset); 264 void SetScrollOffset(gfx::Vector2dF scroll_offset);
danakj 2014/09/18 21:21:52 this should be a const& while you're here
Yufeng Shen (Slow to review) 2014/09/18 22:47:55 Done.
265 gfx::Vector2d scroll_offset() const { return scroll_offset_; } 265 gfx::Vector2dF scroll_offset() const { return scroll_offset_; }
266 void SetScrollOffsetFromImplSide(const gfx::Vector2d& scroll_offset); 266 void SetScrollOffsetFromImplSide(const gfx::Vector2dF& scroll_offset);
267 267
268 void SetScrollClipLayerId(int clip_layer_id); 268 void SetScrollClipLayerId(int clip_layer_id);
269 bool scrollable() const { return scroll_clip_layer_id_ != INVALID_ID; } 269 bool scrollable() const { return scroll_clip_layer_id_ != INVALID_ID; }
270 270
271 void SetUserScrollable(bool horizontal, bool vertical); 271 void SetUserScrollable(bool horizontal, bool vertical);
272 bool user_scrollable_horizontal() const { 272 bool user_scrollable_horizontal() const {
273 return user_scrollable_horizontal_; 273 return user_scrollable_horizontal_;
274 } 274 }
275 bool user_scrollable_vertical() const { return user_scrollable_vertical_; } 275 bool user_scrollable_vertical() const { return user_scrollable_vertical_; }
276 276
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 // Layer instances have a weak pointer to their LayerTreeHost. 577 // Layer instances have a weak pointer to their LayerTreeHost.
578 // This pointer value is nil when a Layer is not in a tree and is 578 // This pointer value is nil when a Layer is not in a tree and is
579 // updated via SetLayerTreeHost() if a layer moves between trees. 579 // updated via SetLayerTreeHost() if a layer moves between trees.
580 LayerTreeHost* layer_tree_host_; 580 LayerTreeHost* layer_tree_host_;
581 581
582 scoped_refptr<LayerAnimationController> layer_animation_controller_; 582 scoped_refptr<LayerAnimationController> layer_animation_controller_;
583 583
584 // Layer properties. 584 // Layer properties.
585 gfx::Size bounds_; 585 gfx::Size bounds_;
586 586
587 gfx::Vector2d scroll_offset_; 587 gfx::Vector2dF scroll_offset_;
588 // This variable indicates which ancestor layer (if any) whose size, 588 // This variable indicates which ancestor layer (if any) whose size,
589 // transformed relative to this layer, defines the maximum scroll offset for 589 // transformed relative to this layer, defines the maximum scroll offset for
590 // this layer. 590 // this layer.
591 int scroll_clip_layer_id_; 591 int scroll_clip_layer_id_;
592 int num_descendants_that_draw_content_; 592 int num_descendants_that_draw_content_;
593 bool should_scroll_on_main_thread_ : 1; 593 bool should_scroll_on_main_thread_ : 1;
594 bool have_wheel_event_handlers_ : 1; 594 bool have_wheel_event_handlers_ : 1;
595 bool have_scroll_event_handlers_ : 1; 595 bool have_scroll_event_handlers_ : 1;
596 bool user_scrollable_horizontal_ : 1; 596 bool user_scrollable_horizontal_ : 1;
597 bool user_scrollable_vertical_ : 1; 597 bool user_scrollable_vertical_ : 1;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 DrawProperties<Layer> draw_properties_; 641 DrawProperties<Layer> draw_properties_;
642 642
643 PaintProperties paint_properties_; 643 PaintProperties paint_properties_;
644 644
645 DISALLOW_COPY_AND_ASSIGN(Layer); 645 DISALLOW_COPY_AND_ASSIGN(Layer);
646 }; 646 };
647 647
648 } // namespace cc 648 } // namespace cc
649 649
650 #endif // CC_LAYERS_LAYER_H_ 650 #endif // CC_LAYERS_LAYER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698