1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CC_TEXTURE_MAILBOX_H_
6 #define CC_TEXTURE_MAILBOX_H_
10 #include "base/basictypes.h"
11 #include "base/callback.h"
12 #include "cc/cc_export.h"
13 #include "cc/transferable_resource.h"
17 class CC_EXPORT TextureMailbox
{
19 typedef base::Callback
<void(unsigned)> ReleaseCallback
;
21 TextureMailbox(const std::string
& mailbox_name
,
22 const ReleaseCallback
& callback
);
23 TextureMailbox(const Mailbox
& mailbox_name
,
24 const ReleaseCallback
& callback
);
25 TextureMailbox(const Mailbox
& mailbox_name
,
26 const ReleaseCallback
& callback
,
31 const ReleaseCallback
& callback() const { return callback_
; }
32 const int8
* data() const { return name_
.name
; }
33 bool Equals(const Mailbox
&) const;
34 bool Equals(const TextureMailbox
&) const;
36 const Mailbox
& name() const { return name_
; }
37 void ResetSyncPoint() { sync_point_
= 0; }
38 void RunReleaseCallback(unsigned sync_point
) const;
39 void SetName(const Mailbox
&);
40 unsigned sync_point() const { return sync_point_
; }
44 ReleaseCallback callback_
;
50 #endif // CC_TEXTURE_MAILBOX_H_