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/mutator_host_client.h" | 30 #include "cc/trees/mutator_host_client.h" |
30 #include "cc/trees/property_tree.h" | 31 #include "cc/trees/property_tree.h" |
31 #include "cc/trees/target_property.h" | 32 #include "cc/trees/target_property.h" |
32 #include "third_party/skia/include/core/SkColor.h" | 33 #include "third_party/skia/include/core/SkColor.h" |
33 #include "third_party/skia/include/core/SkPicture.h" | |
34 #include "ui/gfx/geometry/point3_f.h" | 34 #include "ui/gfx/geometry/point3_f.h" |
35 #include "ui/gfx/geometry/rect.h" | 35 #include "ui/gfx/geometry/rect.h" |
36 #include "ui/gfx/geometry/rect_f.h" | 36 #include "ui/gfx/geometry/rect_f.h" |
37 #include "ui/gfx/geometry/scroll_offset.h" | 37 #include "ui/gfx/geometry/scroll_offset.h" |
38 #include "ui/gfx/transform.h" | 38 #include "ui/gfx/transform.h" |
39 | 39 |
40 namespace base { | 40 namespace base { |
41 namespace trace_event { | 41 namespace trace_event { |
42 class ConvertableToTraceFormat; | 42 class ConvertableToTraceFormat; |
43 } | 43 } |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 void SetLayerClient(LayerClient* client) { inputs_.client = client; } | 321 void SetLayerClient(LayerClient* client) { inputs_.client = client; } |
322 | 322 |
323 virtual bool IsSnapped(); | 323 virtual bool IsSnapped(); |
324 | 324 |
325 virtual void PushPropertiesTo(LayerImpl* layer); | 325 virtual void PushPropertiesTo(LayerImpl* layer); |
326 | 326 |
327 LayerTreeHost* GetLayerTreeHostForTesting() const { return layer_tree_host_; } | 327 LayerTreeHost* GetLayerTreeHostForTesting() const { return layer_tree_host_; } |
328 | 328 |
329 virtual ScrollbarLayerInterface* ToScrollbarLayer(); | 329 virtual ScrollbarLayerInterface* ToScrollbarLayer(); |
330 | 330 |
331 virtual sk_sp<SkPicture> GetPicture() const; | 331 // TODO(enne): rename this to PaintRecord |
| 332 virtual sk_sp<PaintRecord> GetPicture() const; |
332 | 333 |
333 // Constructs a LayerImpl of the correct runtime type for this Layer type. | 334 // Constructs a LayerImpl of the correct runtime type for this Layer type. |
334 virtual std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); | 335 virtual std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); |
335 | 336 |
336 bool NeedsDisplayForTesting() const { return !inputs_.update_rect.IsEmpty(); } | 337 bool NeedsDisplayForTesting() const { return !inputs_.update_rect.IsEmpty(); } |
337 void ResetNeedsDisplayForTesting() { inputs_.update_rect = gfx::Rect(); } | 338 void ResetNeedsDisplayForTesting() { inputs_.update_rect = gfx::Rect(); } |
338 | 339 |
339 const PaintProperties& paint_properties() const { | 340 const PaintProperties& paint_properties() const { |
340 return paint_properties_; | 341 return paint_properties_; |
341 } | 342 } |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 // These all act like draw properties, so don't need push properties. | 657 // These all act like draw properties, so don't need push properties. |
657 gfx::Rect visible_layer_rect_; | 658 gfx::Rect visible_layer_rect_; |
658 size_t num_unclipped_descendants_; | 659 size_t num_unclipped_descendants_; |
659 | 660 |
660 DISALLOW_COPY_AND_ASSIGN(Layer); | 661 DISALLOW_COPY_AND_ASSIGN(Layer); |
661 }; | 662 }; |
662 | 663 |
663 } // namespace cc | 664 } // namespace cc |
664 | 665 |
665 #endif // CC_LAYERS_LAYER_H_ | 666 #endif // CC_LAYERS_LAYER_H_ |
OLD | NEW |