Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: cc/texture_mailbox.h

Issue 12440005: Use gpu::Mailbox in IPCs instead of std::string (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/texture_layer_unittest.cc ('k') | cc/texture_mailbox.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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_TEXTURE_MAILBOX_H_ 5 #ifndef CC_TEXTURE_MAILBOX_H_
6 #define CC_TEXTURE_MAILBOX_H_ 6 #define CC_TEXTURE_MAILBOX_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "cc/cc_export.h" 12 #include "cc/cc_export.h"
13 #include "gpu/command_buffer/common/mailbox.h" 13 #include "gpu/command_buffer/common/mailbox.h"
14 14
15 namespace cc { 15 namespace cc {
16 16
17 class CC_EXPORT TextureMailbox { 17 class CC_EXPORT TextureMailbox {
18 public: 18 public:
19 typedef base::Callback<void(unsigned)> ReleaseCallback; 19 typedef base::Callback<void(unsigned)> ReleaseCallback;
20 TextureMailbox(); 20 TextureMailbox();
21 TextureMailbox(const std::string& mailbox_name,
22 const ReleaseCallback& callback);
23 TextureMailbox(const gpu::Mailbox& mailbox_name, 21 TextureMailbox(const gpu::Mailbox& mailbox_name,
24 const ReleaseCallback& callback); 22 const ReleaseCallback& callback);
25 TextureMailbox(const gpu::Mailbox& mailbox_name, 23 TextureMailbox(const gpu::Mailbox& mailbox_name,
26 const ReleaseCallback& callback, 24 const ReleaseCallback& callback,
27 unsigned sync_point); 25 unsigned sync_point);
28 26
29 ~TextureMailbox(); 27 ~TextureMailbox();
30 28
31 const ReleaseCallback& callback() const { return callback_; } 29 const ReleaseCallback& callback() const { return callback_; }
32 const int8* data() const { return name_.name; } 30 const int8* data() const { return name_.name; }
33 bool Equals(const gpu::Mailbox&) const; 31 bool Equals(const gpu::Mailbox&) const;
34 bool Equals(const TextureMailbox&) const; 32 bool Equals(const TextureMailbox&) const;
35 bool IsEmpty() const; 33 bool IsEmpty() const;
36 const gpu::Mailbox& name() const { return name_; } 34 const gpu::Mailbox& name() const { return name_; }
37 void ResetSyncPoint() { sync_point_ = 0; } 35 void ResetSyncPoint() { sync_point_ = 0; }
38 void RunReleaseCallback(unsigned sync_point) const; 36 void RunReleaseCallback(unsigned sync_point) const;
39 void SetName(const gpu::Mailbox&); 37 void SetName(const gpu::Mailbox&);
40 unsigned sync_point() const { return sync_point_; } 38 unsigned sync_point() const { return sync_point_; }
41 39
42 private: 40 private:
43 gpu::Mailbox name_; 41 gpu::Mailbox name_;
44 ReleaseCallback callback_; 42 ReleaseCallback callback_;
45 unsigned sync_point_; 43 unsigned sync_point_;
46 }; 44 };
47 45
48 } // namespace cc 46 } // namespace cc
49 47
50 #endif // CC_TEXTURE_MAILBOX_H_ 48 #endif // CC_TEXTURE_MAILBOX_H_
OLDNEW
« no previous file with comments | « cc/texture_layer_unittest.cc ('k') | cc/texture_mailbox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698