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

Unified Diff: cc/resources/texture_mailbox.h

Issue 132233041: Add gpu::MailboxHolder to hold state for a gpu::Mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ff7262fa Rebase. Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/single_release_callback.cc ('k') | cc/resources/texture_mailbox.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/texture_mailbox.h
diff --git a/cc/resources/texture_mailbox.h b/cc/resources/texture_mailbox.h
index 8ff87cca1755a244fd125b4b16d32cb59352c222..229f7a735148892d44106c22a67c656b4abe14b4 100644
--- a/cc/resources/texture_mailbox.h
+++ b/cc/resources/texture_mailbox.h
@@ -10,7 +10,7 @@
#include "base/callback.h"
#include "base/memory/shared_memory.h"
#include "cc/base/cc_export.h"
-#include "gpu/command_buffer/common/mailbox.h"
+#include "gpu/command_buffer/common/mailbox_holder.h"
#include "ui/gfx/size.h"
namespace cc {
@@ -20,44 +20,32 @@ namespace cc {
class CC_EXPORT TextureMailbox {
public:
TextureMailbox();
- explicit TextureMailbox(const std::string& mailbox_name);
- explicit TextureMailbox(const gpu::Mailbox& mailbox_name);
- TextureMailbox(const gpu::Mailbox& mailbox_name,
- unsigned sync_point);
- TextureMailbox(const gpu::Mailbox& mailbox_name,
- unsigned texture_target,
- unsigned sync_point);
- TextureMailbox(base::SharedMemory* shared_memory,
- const gfx::Size& size);
+ explicit TextureMailbox(const gpu::MailboxHolder& mailbox_holder);
+ TextureMailbox(const gpu::Mailbox& mailbox, uint32 target, uint32 sync_point);
+ TextureMailbox(base::SharedMemory* shared_memory, const gfx::Size& size);
~TextureMailbox();
bool IsValid() const { return IsTexture() || IsSharedMemory(); }
- bool IsTexture() const { return !name_.IsZero(); }
+ bool IsTexture() const { return !mailbox_holder_.mailbox.IsZero(); }
bool IsSharedMemory() const { return shared_memory_ != NULL; }
bool Equals(const TextureMailbox&) const;
- bool ContainsMailbox(const gpu::Mailbox&) const;
- bool ContainsHandle(base::SharedMemoryHandle handle) const;
- const int8* data() const { return name_.name; }
- const gpu::Mailbox& name() const { return name_; }
- void ResetSyncPoint() { sync_point_ = 0; }
- unsigned target() const { return target_; }
- unsigned sync_point() const { return sync_point_; }
+ const gpu::Mailbox& mailbox() const { return mailbox_holder_.mailbox; }
+ const int8* name() const { return mailbox().name; }
+ uint32 target() const { return mailbox_holder_.texture_target; }
+ uint32 sync_point() const { return mailbox_holder_.sync_point; }
+ void set_sync_point(int32 sync_point) {
+ mailbox_holder_.sync_point = sync_point;
+ }
base::SharedMemory* shared_memory() const { return shared_memory_; }
gfx::Size shared_memory_size() const { return shared_memory_size_; }
size_t shared_memory_size_in_bytes() const;
- // TODO(danakj): ReleaseCallback should be separate from this class, and stop
- // storing a TextureMailbox in ResourceProvider. Then we can remove this.
- void SetName(const gpu::Mailbox& name);
-
private:
- gpu::Mailbox name_;
- unsigned target_;
- unsigned sync_point_;
+ gpu::MailboxHolder mailbox_holder_;
base::SharedMemory* shared_memory_;
gfx::Size shared_memory_size_;
};
« no previous file with comments | « cc/resources/single_release_callback.cc ('k') | cc/resources/texture_mailbox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698