| 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 323 |
| 324 virtual bool IsSnapped(); | 324 virtual bool IsSnapped(); |
| 325 | 325 |
| 326 virtual void PushPropertiesTo(LayerImpl* layer); | 326 virtual void PushPropertiesTo(LayerImpl* layer); |
| 327 | 327 |
| 328 LayerTreeHost* GetLayerTreeHostForTesting() const { return layer_tree_host_; } | 328 LayerTreeHost* GetLayerTreeHostForTesting() const { return layer_tree_host_; } |
| 329 LayerTree* GetLayerTree() const; | 329 LayerTree* GetLayerTree() const; |
| 330 | 330 |
| 331 virtual ScrollbarLayerInterface* ToScrollbarLayer(); | 331 virtual ScrollbarLayerInterface* ToScrollbarLayer(); |
| 332 | 332 |
| 333 virtual sk_sp<SkPicture> GetPicture() const; | 333 // TODO(enne): rename this to PaintRecord |
| 334 virtual sk_sp<PaintRecord> GetPicture() const; |
| 334 | 335 |
| 335 // Constructs a LayerImpl of the correct runtime type for this Layer type. | 336 // Constructs a LayerImpl of the correct runtime type for this Layer type. |
| 336 virtual std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); | 337 virtual std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); |
| 337 | 338 |
| 338 bool NeedsDisplayForTesting() const { return !inputs_.update_rect.IsEmpty(); } | 339 bool NeedsDisplayForTesting() const { return !inputs_.update_rect.IsEmpty(); } |
| 339 void ResetNeedsDisplayForTesting() { inputs_.update_rect = gfx::Rect(); } | 340 void ResetNeedsDisplayForTesting() { inputs_.update_rect = gfx::Rect(); } |
| 340 | 341 |
| 341 const PaintProperties& paint_properties() const { | 342 const PaintProperties& paint_properties() const { |
| 342 return paint_properties_; | 343 return paint_properties_; |
| 343 } | 344 } |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 // These all act like draw properties, so don't need push properties. | 660 // These all act like draw properties, so don't need push properties. |
| 660 gfx::Rect visible_layer_rect_; | 661 gfx::Rect visible_layer_rect_; |
| 661 size_t num_unclipped_descendants_; | 662 size_t num_unclipped_descendants_; |
| 662 | 663 |
| 663 DISALLOW_COPY_AND_ASSIGN(Layer); | 664 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 664 }; | 665 }; |
| 665 | 666 |
| 666 } // namespace cc | 667 } // namespace cc |
| 667 | 668 |
| 668 #endif // CC_LAYERS_LAYER_H_ | 669 #endif // CC_LAYERS_LAYER_H_ |
| OLD | NEW |