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

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

Issue 584503005: Make scroll offset type of float in cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use ScrollOffset instead of vector2dF for scroll offset Created 6 years, 2 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 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 12 matching lines...) Expand all
23 #include "cc/layers/layer_lists.h" 23 #include "cc/layers/layer_lists.h"
24 #include "cc/layers/layer_position_constraint.h" 24 #include "cc/layers/layer_position_constraint.h"
25 #include "cc/layers/render_surface_impl.h" 25 #include "cc/layers/render_surface_impl.h"
26 #include "cc/output/filter_operations.h" 26 #include "cc/output/filter_operations.h"
27 #include "cc/quads/shared_quad_state.h" 27 #include "cc/quads/shared_quad_state.h"
28 #include "cc/resources/resource_provider.h" 28 #include "cc/resources/resource_provider.h"
29 #include "skia/ext/refptr.h" 29 #include "skia/ext/refptr.h"
30 #include "third_party/skia/include/core/SkColor.h" 30 #include "third_party/skia/include/core/SkColor.h"
31 #include "third_party/skia/include/core/SkImageFilter.h" 31 #include "third_party/skia/include/core/SkImageFilter.h"
32 #include "third_party/skia/include/core/SkPicture.h" 32 #include "third_party/skia/include/core/SkPicture.h"
33 #include "ui/gfx/geometry/scroll_offset.h"
33 #include "ui/gfx/point3_f.h" 34 #include "ui/gfx/point3_f.h"
34 #include "ui/gfx/rect.h" 35 #include "ui/gfx/rect.h"
35 #include "ui/gfx/rect_f.h" 36 #include "ui/gfx/rect_f.h"
36 #include "ui/gfx/transform.h" 37 #include "ui/gfx/transform.h"
37 38
38 namespace base { 39 namespace base {
39 namespace debug { 40 namespace debug {
40 class ConvertableToTraceFormat; 41 class ConvertableToTraceFormat;
41 class TracedValue; 42 class TracedValue;
42 } 43 }
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 void SetContentBounds(const gfx::Size& content_bounds); 370 void SetContentBounds(const gfx::Size& content_bounds);
370 gfx::Size content_bounds() const { return draw_properties_.content_bounds; } 371 gfx::Size content_bounds() const { return draw_properties_.content_bounds; }
371 372
372 float contents_scale_x() const { return draw_properties_.contents_scale_x; } 373 float contents_scale_x() const { return draw_properties_.contents_scale_x; }
373 float contents_scale_y() const { return draw_properties_.contents_scale_y; } 374 float contents_scale_y() const { return draw_properties_.contents_scale_y; }
374 void SetContentsScale(float contents_scale_x, float contents_scale_y); 375 void SetContentsScale(float contents_scale_x, float contents_scale_y);
375 376
376 void SetScrollOffsetDelegate(ScrollOffsetDelegate* scroll_offset_delegate); 377 void SetScrollOffsetDelegate(ScrollOffsetDelegate* scroll_offset_delegate);
377 bool IsExternalFlingActive() const; 378 bool IsExternalFlingActive() const;
378 379
379 void SetScrollOffset(const gfx::Vector2d& scroll_offset); 380 void SetScrollOffset(const gfx::ScrollOffset& scroll_offset);
380 void SetScrollOffsetAndDelta(const gfx::Vector2d& scroll_offset, 381 void SetScrollOffsetAndDelta(const gfx::ScrollOffset& scroll_offset,
381 const gfx::Vector2dF& scroll_delta); 382 const gfx::Vector2dF& scroll_delta);
382 gfx::Vector2d scroll_offset() const { return scroll_offset_; } 383 gfx::ScrollOffset scroll_offset() const { return scroll_offset_; }
383 384
384 gfx::Vector2d MaxScrollOffset() const; 385 gfx::Vector2d MaxScrollOffset() const;
danakj 2014/09/25 15:13:31 Should this and ClampScroll be ScrollOffsets?
Yufeng Shen (Slow to review) 2014/09/25 20:06:23 Done.
385 gfx::Vector2dF ClampScrollToMaxScrollOffset(); 386 gfx::Vector2dF ClampScrollToMaxScrollOffset();
386 void SetScrollbarPosition(ScrollbarLayerImplBase* scrollbar_layer, 387 void SetScrollbarPosition(ScrollbarLayerImplBase* scrollbar_layer,
387 LayerImpl* scrollbar_clip_layer) const; 388 LayerImpl* scrollbar_clip_layer) const;
388 void SetScrollDelta(const gfx::Vector2dF& scroll_delta); 389 void SetScrollDelta(const gfx::Vector2dF& scroll_delta);
389 gfx::Vector2dF ScrollDelta() const; 390 gfx::Vector2dF ScrollDelta() const;
390 391
391 gfx::Vector2dF TotalScrollOffset() const; 392 gfx::Vector2dF TotalScrollOffset() const;
danakj 2014/09/25 15:13:31 TODO to change to ScrollOffset?
Yufeng Shen (Slow to review) 2014/09/25 20:06:24 done in this patch.
392 393
393 void SetSentScrollDelta(const gfx::Vector2d& sent_scroll_delta); 394 void SetSentScrollDelta(const gfx::ScrollOffset& sent_scroll_delta);
danakj 2014/09/25 15:13:30 Why isn't the delta a Vector2dF? We should be con
Yufeng Shen (Slow to review) 2014/09/25 20:06:23 right, I change all the scroll delta to Vector2dF,
394 gfx::Vector2d sent_scroll_delta() const { return sent_scroll_delta_; } 395 gfx::ScrollOffset sent_scroll_delta() const { return sent_scroll_delta_; }
395 396
396 // Returns the delta of the scroll that was outside of the bounds of the 397 // Returns the delta of the scroll that was outside of the bounds of the
397 // initial scroll 398 // initial scroll
398 gfx::Vector2dF ScrollBy(const gfx::Vector2dF& scroll); 399 gfx::Vector2dF ScrollBy(const gfx::Vector2dF& scroll);
399 400
400 void SetScrollClipLayer(int scroll_clip_layer_id); 401 void SetScrollClipLayer(int scroll_clip_layer_id);
401 LayerImpl* scroll_clip_layer() const { return scroll_clip_layer_; } 402 LayerImpl* scroll_clip_layer() const { return scroll_clip_layer_; }
402 bool scrollable() const { return !!scroll_clip_layer_; } 403 bool scrollable() const { return !!scroll_clip_layer_; }
403 404
404 void set_user_scrollable_horizontal(bool scrollable) { 405 void set_user_scrollable_horizontal(bool scrollable) {
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 scoped_ptr<LayerImpl> mask_layer_; 600 scoped_ptr<LayerImpl> mask_layer_;
600 int replica_layer_id_; // ditto 601 int replica_layer_id_; // ditto
601 scoped_ptr<LayerImpl> replica_layer_; 602 scoped_ptr<LayerImpl> replica_layer_;
602 int layer_id_; 603 int layer_id_;
603 LayerTreeImpl* layer_tree_impl_; 604 LayerTreeImpl* layer_tree_impl_;
604 605
605 // Properties synchronized from the associated Layer. 606 // Properties synchronized from the associated Layer.
606 gfx::Point3F transform_origin_; 607 gfx::Point3F transform_origin_;
607 gfx::Size bounds_; 608 gfx::Size bounds_;
608 gfx::Vector2dF bounds_delta_; 609 gfx::Vector2dF bounds_delta_;
609 gfx::Vector2d scroll_offset_; 610 gfx::ScrollOffset scroll_offset_;
610 ScrollOffsetDelegate* scroll_offset_delegate_; 611 ScrollOffsetDelegate* scroll_offset_delegate_;
611 LayerImpl* scroll_clip_layer_; 612 LayerImpl* scroll_clip_layer_;
612 bool scrollable_ : 1; 613 bool scrollable_ : 1;
613 bool should_scroll_on_main_thread_ : 1; 614 bool should_scroll_on_main_thread_ : 1;
614 bool have_wheel_event_handlers_ : 1; 615 bool have_wheel_event_handlers_ : 1;
615 bool have_scroll_event_handlers_ : 1; 616 bool have_scroll_event_handlers_ : 1;
616 bool user_scrollable_horizontal_ : 1; 617 bool user_scrollable_horizontal_ : 1;
617 bool user_scrollable_vertical_ : 1; 618 bool user_scrollable_vertical_ : 1;
618 bool stacking_order_changed_ : 1; 619 bool stacking_order_changed_ : 1;
619 // Whether the "back" of this layer should draw. 620 // Whether the "back" of this layer should draw.
(...skipping 22 matching lines...) Expand all
642 SkColor background_color_; 643 SkColor background_color_;
643 644
644 float opacity_; 645 float opacity_;
645 SkXfermode::Mode blend_mode_; 646 SkXfermode::Mode blend_mode_;
646 gfx::PointF position_; 647 gfx::PointF position_;
647 gfx::Transform transform_; 648 gfx::Transform transform_;
648 649
649 LayerPositionConstraint position_constraint_; 650 LayerPositionConstraint position_constraint_;
650 651
651 gfx::Vector2dF scroll_delta_; 652 gfx::Vector2dF scroll_delta_;
652 gfx::Vector2d sent_scroll_delta_; 653 gfx::ScrollOffset sent_scroll_delta_;
danakj 2014/09/25 15:13:30 impl-side deltas are Vector2dF can this be that?
Yufeng Shen (Slow to review) 2014/09/25 20:06:23 Done.
653 gfx::Vector2dF last_scroll_offset_; 654 gfx::Vector2dF last_scroll_offset_;
danakj 2014/09/25 15:13:31 shouldnt this be a ScrollOffset?
Yufeng Shen (Slow to review) 2014/09/25 20:06:23 Done.
654 655
655 int num_descendants_that_draw_content_; 656 int num_descendants_that_draw_content_;
656 657
657 // The global depth value of the center of the layer. This value is used 658 // The global depth value of the center of the layer. This value is used
658 // to sort layers from back to front. 659 // to sort layers from back to front.
659 float draw_depth_; 660 float draw_depth_;
660 661
661 FilterOperations filters_; 662 FilterOperations filters_;
662 FilterOperations background_filters_; 663 FilterOperations background_filters_;
663 664
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 DrawProperties<LayerImpl> draw_properties_; 705 DrawProperties<LayerImpl> draw_properties_;
705 706
706 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; 707 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_;
707 708
708 DISALLOW_COPY_AND_ASSIGN(LayerImpl); 709 DISALLOW_COPY_AND_ASSIGN(LayerImpl);
709 }; 710 };
710 711
711 } // namespace cc 712 } // namespace cc
712 713
713 #endif // CC_LAYERS_LAYER_IMPL_H_ 714 #endif // CC_LAYERS_LAYER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698