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_OWNER_H_ | 5 #ifndef UI_COMPOSITOR_LAYER_OWNER_H_ |
6 #define UI_COMPOSITOR_LAYER_OWNER_H_ | 6 #define UI_COMPOSITOR_LAYER_OWNER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 19 matching lines...) Expand all Loading... | |
30 // end of ~LayerOwner(). | 30 // end of ~LayerOwner(). |
31 std::unique_ptr<Layer> AcquireLayer(); | 31 std::unique_ptr<Layer> AcquireLayer(); |
32 | 32 |
33 // Asks the owner to recreate the layer, returning the old Layer. NULL is | 33 // Asks the owner to recreate the layer, returning the old Layer. NULL is |
34 // returned if there is no existing layer, or recreate is not supported. | 34 // returned if there is no existing layer, or recreate is not supported. |
35 // | 35 // |
36 // This does not recurse. Existing children of the layer are moved to the new | 36 // This does not recurse. Existing children of the layer are moved to the new |
37 // layer. | 37 // layer. |
38 virtual std::unique_ptr<Layer> RecreateLayer(); | 38 virtual std::unique_ptr<Layer> RecreateLayer(); |
39 | 39 |
40 // Requests a |mirror| of the owned layer from the LayerOwnerDelegate. | |
oshima
2016/10/04 21:06:31
how about "Requests to mirror the content of ownin
Dominik Laskowski
2016/10/04 23:18:52
Done.
| |
41 void MirrorLayer(Layer* mirror) const; | |
42 | |
40 ui::Layer* layer() { return layer_; } | 43 ui::Layer* layer() { return layer_; } |
41 const ui::Layer* layer() const { return layer_; } | 44 const ui::Layer* layer() const { return layer_; } |
42 | 45 |
43 void set_layer_owner_delegate(LayerOwnerDelegate* delegate) { | 46 void set_layer_owner_delegate(LayerOwnerDelegate* delegate) { |
44 layer_owner_delegate_ = delegate; | 47 layer_owner_delegate_ = delegate; |
45 } | 48 } |
46 | 49 |
47 protected: | 50 protected: |
48 void DestroyLayer(); | 51 void DestroyLayer(); |
49 | 52 |
50 bool OwnsLayer() const; | 53 bool OwnsLayer() const; |
51 | 54 |
52 private: | 55 private: |
53 // The LayerOwner owns its layer unless ownership is relinquished via a call | 56 // The LayerOwner owns its layer unless ownership is relinquished via a call |
54 // to AcquireLayer(). After that moment |layer_| will still be valid but | 57 // to AcquireLayer(). After that moment |layer_| will still be valid but |
55 // |layer_owner_| will be NULL. The reason for releasing ownership is that | 58 // |layer_owner_| will be NULL. The reason for releasing ownership is that |
56 // the client may wish to animate the layer beyond the lifetime of the owner, | 59 // the client may wish to animate the layer beyond the lifetime of the owner, |
57 // e.g. fading it out when it is destroyed. | 60 // e.g. fading it out when it is destroyed. |
58 std::unique_ptr<Layer> layer_owner_; | 61 std::unique_ptr<Layer> layer_owner_; |
59 Layer* layer_; | 62 Layer* layer_; |
60 | 63 |
61 LayerOwnerDelegate* layer_owner_delegate_; | 64 LayerOwnerDelegate* layer_owner_delegate_; |
62 | 65 |
63 DISALLOW_COPY_AND_ASSIGN(LayerOwner); | 66 DISALLOW_COPY_AND_ASSIGN(LayerOwner); |
64 }; | 67 }; |
65 | 68 |
66 } // namespace ui | 69 } // namespace ui |
67 | 70 |
68 #endif // UI_COMPOSITOR_LAYER_OWNER_H_ | 71 #endif // UI_COMPOSITOR_LAYER_OWNER_H_ |
OLD | NEW |