| 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
| 14 #include "cc/animation/layer_animation_controller.h" | 14 #include "cc/animation/layer_animation_controller.h" |
| 15 #include "cc/animation/layer_animation_value_observer.h" | 15 #include "cc/animation/layer_animation_value_observer.h" |
| 16 #include "cc/animation/layer_animation_value_provider.h" | 16 #include "cc/animation/layer_animation_value_provider.h" |
| 17 #include "cc/base/cc_export.h" | 17 #include "cc/base/cc_export.h" |
| 18 #include "cc/base/region.h" | 18 #include "cc/base/region.h" |
| 19 #include "cc/base/scoped_ptr_vector.h" | 19 #include "cc/base/scoped_ptr_vector.h" |
| 20 #include "cc/debug/micro_benchmark.h" | 20 #include "cc/debug/micro_benchmark.h" |
| 21 #include "cc/layers/draw_properties.h" | 21 #include "cc/layers/draw_properties.h" |
| 22 #include "cc/layers/layer_lists.h" | 22 #include "cc/layers/layer_lists.h" |
| 23 #include "cc/layers/layer_position_constraint.h" | 23 #include "cc/layers/layer_position_constraint.h" |
| 24 #include "cc/layers/paint_properties.h" | 24 #include "cc/layers/paint_properties.h" |
| 25 #include "cc/layers/render_surface.h" | 25 #include "cc/layers/render_surface.h" |
| 26 #include "cc/output/filter_operations.h" | 26 #include "cc/output/filter_operations.h" |
| 27 #include "cc/trees/occlusion_tracker.h" | |
| 28 #include "skia/ext/refptr.h" | 27 #include "skia/ext/refptr.h" |
| 29 #include "third_party/skia/include/core/SkColor.h" | 28 #include "third_party/skia/include/core/SkColor.h" |
| 30 #include "third_party/skia/include/core/SkImageFilter.h" | 29 #include "third_party/skia/include/core/SkImageFilter.h" |
| 31 #include "third_party/skia/include/core/SkPicture.h" | 30 #include "third_party/skia/include/core/SkPicture.h" |
| 32 #include "third_party/skia/include/core/SkXfermode.h" | 31 #include "third_party/skia/include/core/SkXfermode.h" |
| 33 #include "ui/gfx/rect.h" | 32 #include "ui/gfx/rect.h" |
| 34 #include "ui/gfx/rect_f.h" | 33 #include "ui/gfx/rect_f.h" |
| 35 #include "ui/gfx/transform.h" | 34 #include "ui/gfx/transform.h" |
| 36 | 35 |
| 37 namespace gfx { | 36 namespace gfx { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 54 class LayerAnimationEventObserver; | 53 class LayerAnimationEventObserver; |
| 55 class LayerClient; | 54 class LayerClient; |
| 56 class LayerImpl; | 55 class LayerImpl; |
| 57 class LayerTreeHost; | 56 class LayerTreeHost; |
| 58 class LayerTreeImpl; | 57 class LayerTreeImpl; |
| 59 class PriorityCalculator; | 58 class PriorityCalculator; |
| 60 class RenderingStatsInstrumentation; | 59 class RenderingStatsInstrumentation; |
| 61 class ResourceUpdateQueue; | 60 class ResourceUpdateQueue; |
| 62 class ScrollbarLayerInterface; | 61 class ScrollbarLayerInterface; |
| 63 struct AnimationEvent; | 62 struct AnimationEvent; |
| 63 template <typename LayerType> |
| 64 class OcclusionTracker; |
| 64 | 65 |
| 65 // Base class for composited layers. Special layer types are derived from | 66 // Base class for composited layers. Special layer types are derived from |
| 66 // this class. | 67 // this class. |
| 67 class CC_EXPORT Layer : public base::RefCounted<Layer>, | 68 class CC_EXPORT Layer : public base::RefCounted<Layer>, |
| 68 public LayerAnimationValueObserver, | 69 public LayerAnimationValueObserver, |
| 69 public LayerAnimationValueProvider { | 70 public LayerAnimationValueProvider { |
| 70 public: | 71 public: |
| 71 typedef RenderSurfaceLayerList RenderSurfaceListType; | 72 typedef RenderSurfaceLayerList RenderSurfaceListType; |
| 72 typedef LayerList LayerListType; | 73 typedef LayerList LayerListType; |
| 73 typedef RenderSurface RenderSurfaceType; | 74 typedef RenderSurface RenderSurfaceType; |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 bool replica_has_mask() const { | 346 bool replica_has_mask() const { |
| 346 return replica_layer_.get() && | 347 return replica_layer_.get() && |
| 347 (mask_layer_.get() || replica_layer_->mask_layer_.get()); | 348 (mask_layer_.get() || replica_layer_->mask_layer_.get()); |
| 348 } | 349 } |
| 349 | 350 |
| 350 // These methods typically need to be overwritten by derived classes. | 351 // These methods typically need to be overwritten by derived classes. |
| 351 virtual bool DrawsContent() const; | 352 virtual bool DrawsContent() const; |
| 352 virtual void SavePaintProperties(); | 353 virtual void SavePaintProperties(); |
| 353 // Returns true iff any resources were updated that need to be committed. | 354 // Returns true iff any resources were updated that need to be committed. |
| 354 virtual bool Update(ResourceUpdateQueue* queue, | 355 virtual bool Update(ResourceUpdateQueue* queue, |
| 355 const OcclusionTracker* occlusion); | 356 const OcclusionTracker<Layer>* occlusion); |
| 356 virtual bool NeedMoreUpdates(); | 357 virtual bool NeedMoreUpdates(); |
| 357 virtual void SetIsMask(bool is_mask) {} | 358 virtual void SetIsMask(bool is_mask) {} |
| 358 virtual void ReduceMemoryUsage() {} | 359 virtual void ReduceMemoryUsage() {} |
| 359 virtual void OnOutputSurfaceCreated() {} | 360 virtual void OnOutputSurfaceCreated() {} |
| 360 | 361 |
| 361 virtual scoped_refptr<base::debug::ConvertableToTraceFormat> TakeDebugInfo(); | 362 virtual scoped_refptr<base::debug::ConvertableToTraceFormat> TakeDebugInfo(); |
| 362 | 363 |
| 363 void SetLayerClient(LayerClient* client) { client_ = client; } | 364 void SetLayerClient(LayerClient* client) { client_ = client; } |
| 364 | 365 |
| 365 virtual void PushPropertiesTo(LayerImpl* layer); | 366 virtual void PushPropertiesTo(LayerImpl* layer); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 DrawProperties<Layer> draw_properties_; | 620 DrawProperties<Layer> draw_properties_; |
| 620 | 621 |
| 621 PaintProperties paint_properties_; | 622 PaintProperties paint_properties_; |
| 622 | 623 |
| 623 DISALLOW_COPY_AND_ASSIGN(Layer); | 624 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 624 }; | 625 }; |
| 625 | 626 |
| 626 } // namespace cc | 627 } // namespace cc |
| 627 | 628 |
| 628 #endif // CC_LAYERS_LAYER_H_ | 629 #endif // CC_LAYERS_LAYER_H_ |
| OLD | NEW |