OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_COMPOSITOR_LAYER_H_ | 5 #ifndef UI_COMPOSITOR_LAYER_H_ |
6 #define UI_COMPOSITOR_LAYER_H_ | 6 #define UI_COMPOSITOR_LAYER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
18 #include "cc/base/region.h" | 18 #include "cc/base/region.h" |
19 #include "cc/layers/content_layer_client.h" | 19 #include "cc/layers/content_layer_client.h" |
20 #include "cc/layers/layer_client.h" | 20 #include "cc/layers/layer_client.h" |
21 #include "cc/layers/surface_layer.h" | 21 #include "cc/layers/surface_layer.h" |
22 #include "cc/layers/texture_layer_client.h" | 22 #include "cc/layers/texture_layer_client.h" |
23 #include "cc/resources/texture_mailbox.h" | 23 #include "cc/resources/texture_mailbox.h" |
24 #include "cc/surfaces/surface_id.h" | 24 #include "cc/surfaces/surface_id.h" |
| 25 #include "cc/trees/element_id.h" |
25 #include "third_party/skia/include/core/SkColor.h" | 26 #include "third_party/skia/include/core/SkColor.h" |
26 #include "third_party/skia/include/core/SkRegion.h" | 27 #include "third_party/skia/include/core/SkRegion.h" |
27 #include "ui/compositor/compositor.h" | 28 #include "ui/compositor/compositor.h" |
28 #include "ui/compositor/layer_animation_delegate.h" | 29 #include "ui/compositor/layer_animation_delegate.h" |
29 #include "ui/compositor/layer_delegate.h" | 30 #include "ui/compositor/layer_delegate.h" |
30 #include "ui/compositor/layer_type.h" | 31 #include "ui/compositor/layer_type.h" |
31 #include "ui/gfx/geometry/rect.h" | 32 #include "ui/gfx/geometry/rect.h" |
32 #include "ui/gfx/image/image_skia.h" | 33 #include "ui/gfx/image/image_skia.h" |
33 #include "ui/gfx/transform.h" | 34 #include "ui/gfx/transform.h" |
34 | 35 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 const_cast<const Layer*>(this)->GetCompositor()); | 82 const_cast<const Layer*>(this)->GetCompositor()); |
82 } | 83 } |
83 const Compositor* GetCompositor() const; | 84 const Compositor* GetCompositor() const; |
84 | 85 |
85 // Called by the compositor when the Layer is set as its root Layer. This can | 86 // Called by the compositor when the Layer is set as its root Layer. This can |
86 // only ever be called on the root layer. | 87 // only ever be called on the root layer. |
87 void SetCompositor(Compositor* compositor, | 88 void SetCompositor(Compositor* compositor, |
88 scoped_refptr<cc::Layer> root_layer); | 89 scoped_refptr<cc::Layer> root_layer); |
89 void ResetCompositor(); | 90 void ResetCompositor(); |
90 | 91 |
| 92 static cc::ElementId NextElementId(); |
| 93 |
91 LayerDelegate* delegate() { return delegate_; } | 94 LayerDelegate* delegate() { return delegate_; } |
92 void set_delegate(LayerDelegate* delegate) { delegate_ = delegate; } | 95 void set_delegate(LayerDelegate* delegate) { delegate_ = delegate; } |
93 | 96 |
94 LayerOwner* owner() { return owner_; } | 97 LayerOwner* owner() { return owner_; } |
95 | 98 |
96 // Adds a new Layer to this Layer. | 99 // Adds a new Layer to this Layer. |
97 void Add(Layer* child); | 100 void Add(Layer* child); |
98 | 101 |
99 // Removes a Layer from this Layer. | 102 // Removes a Layer from this Layer. |
100 void Remove(Layer* child); | 103 void Remove(Layer* child); |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 // The size of the frame or texture in DIP, set when SetShowDelegatedContent | 505 // The size of the frame or texture in DIP, set when SetShowDelegatedContent |
503 // or SetTextureMailbox was called. | 506 // or SetTextureMailbox was called. |
504 gfx::Size frame_size_in_dip_; | 507 gfx::Size frame_size_in_dip_; |
505 | 508 |
506 DISALLOW_COPY_AND_ASSIGN(Layer); | 509 DISALLOW_COPY_AND_ASSIGN(Layer); |
507 }; | 510 }; |
508 | 511 |
509 } // namespace ui | 512 } // namespace ui |
510 | 513 |
511 #endif // UI_COMPOSITOR_LAYER_H_ | 514 #endif // UI_COMPOSITOR_LAYER_H_ |
OLD | NEW |