OLD | NEW |
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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <set> | 11 #include <set> |
12 #include <string> | 12 #include <string> |
13 #include <unordered_map> | 13 #include <unordered_map> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "base/callback.h" | 16 #include "base/callback.h" |
17 #include "base/macros.h" | 17 #include "base/macros.h" |
18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
19 #include "base/observer_list.h" | 19 #include "base/observer_list.h" |
20 #include "cc/base/cc_export.h" | 20 #include "cc/base/cc_export.h" |
21 #include "cc/base/region.h" | 21 #include "cc/base/region.h" |
22 #include "cc/debug/micro_benchmark.h" | 22 #include "cc/debug/micro_benchmark.h" |
23 #include "cc/input/input_handler.h" | 23 #include "cc/input/input_handler.h" |
24 #include "cc/layers/layer_collections.h" | 24 #include "cc/layers/layer_collections.h" |
25 #include "cc/layers/layer_position_constraint.h" | 25 #include "cc/layers/layer_position_constraint.h" |
26 #include "cc/layers/paint_properties.h" | 26 #include "cc/layers/paint_properties.h" |
27 #include "cc/output/filter_operations.h" | 27 #include "cc/output/filter_operations.h" |
| 28 #include "cc/paint/paint_record.h" |
28 #include "cc/trees/element_id.h" | 29 #include "cc/trees/element_id.h" |
29 #include "cc/trees/layer_tree.h" | 30 #include "cc/trees/layer_tree.h" |
30 #include "cc/trees/mutator_host_client.h" | 31 #include "cc/trees/mutator_host_client.h" |
31 #include "cc/trees/property_tree.h" | 32 #include "cc/trees/property_tree.h" |
32 #include "cc/trees/target_property.h" | 33 #include "cc/trees/target_property.h" |
33 #include "third_party/skia/include/core/SkColor.h" | 34 #include "third_party/skia/include/core/SkColor.h" |
34 #include "third_party/skia/include/core/SkPicture.h" | |
35 #include "ui/gfx/geometry/point3_f.h" | 35 #include "ui/gfx/geometry/point3_f.h" |
36 #include "ui/gfx/geometry/rect.h" | 36 #include "ui/gfx/geometry/rect.h" |
37 #include "ui/gfx/geometry/rect_f.h" | 37 #include "ui/gfx/geometry/rect_f.h" |
38 #include "ui/gfx/geometry/scroll_offset.h" | 38 #include "ui/gfx/geometry/scroll_offset.h" |
39 #include "ui/gfx/transform.h" | 39 #include "ui/gfx/transform.h" |
40 | 40 |
41 namespace base { | 41 namespace base { |
42 namespace trace_event { | 42 namespace trace_event { |
43 class ConvertableToTraceFormat; | 43 class ConvertableToTraceFormat; |
44 } | 44 } |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 // a LayerImpl, it pushes the properties to proto::LayerProperties. It is | 351 // a LayerImpl, it pushes the properties to proto::LayerProperties. It is |
352 // called only on layers that have changed properties. The properties | 352 // called only on layers that have changed properties. The properties |
353 // themselves are pushed to proto::LayerProperties. | 353 // themselves are pushed to proto::LayerProperties. |
354 virtual void ToLayerPropertiesProto(proto::LayerProperties* proto); | 354 virtual void ToLayerPropertiesProto(proto::LayerProperties* proto); |
355 | 355 |
356 LayerTreeHost* GetLayerTreeHostForTesting() const { return layer_tree_host_; } | 356 LayerTreeHost* GetLayerTreeHostForTesting() const { return layer_tree_host_; } |
357 LayerTree* GetLayerTree() const; | 357 LayerTree* GetLayerTree() const; |
358 | 358 |
359 virtual ScrollbarLayerInterface* ToScrollbarLayer(); | 359 virtual ScrollbarLayerInterface* ToScrollbarLayer(); |
360 | 360 |
361 virtual sk_sp<SkPicture> GetPicture() const; | 361 virtual sk_sp<PaintRecord> GetPicture() const; |
362 | 362 |
363 // Constructs a LayerImpl of the correct runtime type for this Layer type. | 363 // Constructs a LayerImpl of the correct runtime type for this Layer type. |
364 virtual std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); | 364 virtual std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); |
365 | 365 |
366 bool NeedsDisplayForTesting() const { return !inputs_.update_rect.IsEmpty(); } | 366 bool NeedsDisplayForTesting() const { return !inputs_.update_rect.IsEmpty(); } |
367 void ResetNeedsDisplayForTesting() { inputs_.update_rect = gfx::Rect(); } | 367 void ResetNeedsDisplayForTesting() { inputs_.update_rect = gfx::Rect(); } |
368 | 368 |
369 const PaintProperties& paint_properties() const { | 369 const PaintProperties& paint_properties() const { |
370 return paint_properties_; | 370 return paint_properties_; |
371 } | 371 } |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 // These all act like draw properties, so don't need push properties. | 691 // These all act like draw properties, so don't need push properties. |
692 gfx::Rect visible_layer_rect_; | 692 gfx::Rect visible_layer_rect_; |
693 size_t num_unclipped_descendants_; | 693 size_t num_unclipped_descendants_; |
694 | 694 |
695 DISALLOW_COPY_AND_ASSIGN(Layer); | 695 DISALLOW_COPY_AND_ASSIGN(Layer); |
696 }; | 696 }; |
697 | 697 |
698 } // namespace cc | 698 } // namespace cc |
699 | 699 |
700 #endif // CC_LAYERS_LAYER_H_ | 700 #endif // CC_LAYERS_LAYER_H_ |
OLD | NEW |