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

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

Issue 102733006: Use bit fields inside cc to reduce memory usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modified after the review comments! Created 7 years 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 <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 namespace cc { 46 namespace cc {
47 47
48 class LayerTreeHostImpl; 48 class LayerTreeHostImpl;
49 class LayerTreeImpl; 49 class LayerTreeImpl;
50 class MicroBenchmarkImpl; 50 class MicroBenchmarkImpl;
51 class QuadSink; 51 class QuadSink;
52 class Renderer; 52 class Renderer;
53 class ScrollbarAnimationController; 53 class ScrollbarAnimationController;
54 class ScrollbarLayerImplBase; 54 class ScrollbarLayerImplBase;
55 class Layer;
56 55
57 struct AppendQuadsData; 56 struct AppendQuadsData;
58 57
59 enum DrawMode { 58 enum DrawMode {
60 DRAW_MODE_NONE, 59 DRAW_MODE_NONE,
61 DRAW_MODE_HARDWARE, 60 DRAW_MODE_HARDWARE,
62 DRAW_MODE_SOFTWARE, 61 DRAW_MODE_SOFTWARE,
63 DRAW_MODE_RESOURCELESS_SOFTWARE 62 DRAW_MODE_RESOURCELESS_SOFTWARE
64 }; 63 };
65 64
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 scoped_ptr<LayerImpl> replica_layer_; 568 scoped_ptr<LayerImpl> replica_layer_;
570 int layer_id_; 569 int layer_id_;
571 LayerTreeImpl* layer_tree_impl_; 570 LayerTreeImpl* layer_tree_impl_;
572 571
573 // Properties synchronized from the associated Layer. 572 // Properties synchronized from the associated Layer.
574 gfx::PointF anchor_point_; 573 gfx::PointF anchor_point_;
575 float anchor_point_z_; 574 float anchor_point_z_;
576 gfx::Size bounds_; 575 gfx::Size bounds_;
577 gfx::Vector2d scroll_offset_; 576 gfx::Vector2d scroll_offset_;
578 LayerScrollOffsetDelegate* scroll_offset_delegate_; 577 LayerScrollOffsetDelegate* scroll_offset_delegate_;
579 bool scrollable_; 578 bool scrollable_ : 1;
580 bool should_scroll_on_main_thread_; 579 bool should_scroll_on_main_thread_ : 1;
581 bool have_wheel_event_handlers_; 580 bool have_wheel_event_handlers_ : 1;
582 bool user_scrollable_horizontal_; 581 bool user_scrollable_horizontal_ : 1;
583 bool user_scrollable_vertical_; 582 bool user_scrollable_vertical_ : 1;
583 bool stacking_order_changed_ : 1;
584 // Whether the "back" of this layer should draw.
585 bool double_sided_ : 1;
586
587 // Tracks if drawing-related properties have changed since last redraw.
588 bool layer_property_changed_ : 1;
589
590 bool masks_to_bounds_ : 1;
591 bool contents_opaque_ : 1;
592 bool is_root_for_isolated_group_ : 1;
593 bool preserves_3d_ : 1;
594 bool use_parent_backface_visibility_ : 1;
595 bool draw_checkerboard_for_missing_tiles_ : 1;
596 bool draws_content_ : 1;
597 bool hide_layer_and_subtree_ : 1;
598 bool force_render_surface_ : 1;
599
600 // Set for the layer that other layers are fixed to.
601 bool is_container_for_fixed_position_layers_ : 1;
584 Region non_fast_scrollable_region_; 602 Region non_fast_scrollable_region_;
585 Region touch_event_handler_region_; 603 Region touch_event_handler_region_;
586 SkColor background_color_; 604 SkColor background_color_;
587 bool stacking_order_changed_;
588 605
589 // Whether the "back" of this layer should draw.
590 bool double_sided_;
591
592 // Tracks if drawing-related properties have changed since last redraw.
593 bool layer_property_changed_;
594
595 bool masks_to_bounds_;
596 bool contents_opaque_;
597 float opacity_; 606 float opacity_;
598 SkXfermode::Mode blend_mode_; 607 SkXfermode::Mode blend_mode_;
599 bool is_root_for_isolated_group_;
600 gfx::PointF position_; 608 gfx::PointF position_;
601 bool preserves_3d_;
602 bool use_parent_backface_visibility_;
603 bool draw_checkerboard_for_missing_tiles_;
604 gfx::Transform sublayer_transform_; 609 gfx::Transform sublayer_transform_;
605 gfx::Transform transform_; 610 gfx::Transform transform_;
606 611
607 bool draws_content_;
608 bool hide_layer_and_subtree_;
609 bool force_render_surface_;
610
611 // Set for the layer that other layers are fixed to.
612 bool is_container_for_fixed_position_layers_;
613 // This property is effective when 612 // This property is effective when
614 // is_container_for_fixed_position_layers_ == true, 613 // is_container_for_fixed_position_layers_ == true,
615 gfx::Vector2dF fixed_container_size_delta_; 614 gfx::Vector2dF fixed_container_size_delta_;
616 615
617 LayerPositionConstraint position_constraint_; 616 LayerPositionConstraint position_constraint_;
618 617
619 gfx::Vector2dF scroll_delta_; 618 gfx::Vector2dF scroll_delta_;
620 gfx::Vector2d sent_scroll_delta_; 619 gfx::Vector2d sent_scroll_delta_;
621 gfx::Vector2d max_scroll_offset_; 620 gfx::Vector2d max_scroll_offset_;
622 gfx::Vector2dF last_scroll_offset_; 621 gfx::Vector2dF last_scroll_offset_;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 DrawProperties<LayerImpl> draw_properties_; 658 DrawProperties<LayerImpl> draw_properties_;
660 659
661 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; 660 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_;
662 661
663 DISALLOW_COPY_AND_ASSIGN(LayerImpl); 662 DISALLOW_COPY_AND_ASSIGN(LayerImpl);
664 }; 663 };
665 664
666 } // namespace cc 665 } // namespace cc
667 666
668 #endif // CC_LAYERS_LAYER_IMPL_H_ 667 #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