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_TEXTURE_LAYER_H_ | 5 #ifndef CC_LAYERS_TEXTURE_LAYER_H_ |
6 #define CC_LAYERS_TEXTURE_LAYER_H_ | 6 #define CC_LAYERS_TEXTURE_LAYER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 TextureLayer(TextureLayerClient* client, bool uses_mailbox); | 87 TextureLayer(TextureLayerClient* client, bool uses_mailbox); |
88 virtual ~TextureLayer(); | 88 virtual ~TextureLayer(); |
89 | 89 |
90 private: | 90 private: |
91 class MailboxHolder : public base::RefCountedThreadSafe<MailboxHolder> { | 91 class MailboxHolder : public base::RefCountedThreadSafe<MailboxHolder> { |
92 public: | 92 public: |
93 class MainThreadReference { | 93 class MainThreadReference { |
94 public: | 94 public: |
95 explicit MainThreadReference(MailboxHolder* holder); | 95 explicit MainThreadReference(MailboxHolder* holder); |
96 ~MainThreadReference(); | 96 ~MainThreadReference(); |
97 MailboxHolder* holder() { return holder_; } | 97 MailboxHolder* holder() { return holder_.get(); } |
98 | 98 |
99 private: | 99 private: |
100 scoped_refptr<MailboxHolder> holder_; | 100 scoped_refptr<MailboxHolder> holder_; |
101 DISALLOW_COPY_AND_ASSIGN(MainThreadReference); | 101 DISALLOW_COPY_AND_ASSIGN(MainThreadReference); |
102 }; | 102 }; |
103 | 103 |
104 static scoped_ptr<MainThreadReference> Create( | 104 static scoped_ptr<MainThreadReference> Create( |
105 const TextureMailbox& mailbox); | 105 const TextureMailbox& mailbox); |
106 | 106 |
107 const TextureMailbox& mailbox() const { return mailbox_; } | 107 const TextureMailbox& mailbox() const { return mailbox_; } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 unsigned texture_id_; | 148 unsigned texture_id_; |
149 scoped_ptr<MailboxHolder::MainThreadReference> holder_ref_; | 149 scoped_ptr<MailboxHolder::MainThreadReference> holder_ref_; |
150 bool needs_set_mailbox_; | 150 bool needs_set_mailbox_; |
151 | 151 |
152 DISALLOW_COPY_AND_ASSIGN(TextureLayer); | 152 DISALLOW_COPY_AND_ASSIGN(TextureLayer); |
153 }; | 153 }; |
154 | 154 |
155 } // namespace cc | 155 } // namespace cc |
156 #endif // CC_LAYERS_TEXTURE_LAYER_H_ | 156 #endif // CC_LAYERS_TEXTURE_LAYER_H_ |
OLD | NEW |