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

Unified Diff: gpu/command_buffer/common/mailbox.h

Issue 105743004: Add gpu::MailboxHolder to hold state for a gpu::Mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cc2a95fe Android fixes. Created 7 years 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/common/mailbox.h
diff --git a/gpu/command_buffer/common/mailbox.h b/gpu/command_buffer/common/mailbox.h
index 938167f5cf8142b078cd32af506f1d10b4d384f9..a03594f1253de0b674e92c3014b827baddd4119f 100644
--- a/gpu/command_buffer/common/mailbox.h
+++ b/gpu/command_buffer/common/mailbox.h
@@ -7,6 +7,8 @@
#include <string.h>
+#include "base/callback_forward.h"
+#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/common/types.h"
#include "gpu/gpu_export.h"
@@ -23,6 +25,24 @@ struct GPU_EXPORT Mailbox {
}
};
+class GPU_EXPORT MailboxHolder {
piman 2013/12/06 23:29:42 Should this be a struct? It's a value type, copyab
sheu 2013/12/07 01:03:50 Sure.
+ public:
+ typedef base::Callback<void(scoped_ptr<MailboxHolder>)> ReleaseCallback;
danakj 2013/12/06 22:37:03 At least in cc, we also include a "is_lost" boolea
sheu 2013/12/06 22:54:12 That's cc::ReleaseCallback (and cc::SingleReleaseC
piman 2013/12/06 23:29:42 I'm pretty meh about defining this here. Among all
sheu 2013/12/07 01:03:50 I'm getting more users of the callback soon. Righ
piman 2013/12/07 01:32:34 Right, but like I said, this doesn't fit all use c
sheu 2013/12/07 01:44:15 This isn't really inherent to the gpu::MailboxHold
+
+ MailboxHolder();
+ MailboxHolder(const gpu::Mailbox& mailbox, uint32 target, uint32 sync_point);
+
+ const gpu::Mailbox& mailbox() const { return mailbox_; }
+ uint32 target() const { return target_; }
+ uint32 sync_point() const { return sync_point_; }
+ void set_sync_point(uint32 sync_point) { sync_point_ = sync_point; }
danakj 2013/12/06 22:37:03 Can you do the set only if the |sync_point| != 0?
sheu 2013/12/06 22:54:12 We use this also to replace cc::TextureMailbox::Re
+
+ private:
+ gpu::Mailbox mailbox_;
+ uint32 target_;
+ uint32 sync_point_;
+};
+
} // namespace gpu
#endif // GPU_COMMAND_BUFFER_MAILBOX_H_

Powered by Google App Engine
This is Rietveld 408576698