Index: cc/resources/texture_mailbox.h |
diff --git a/cc/resources/texture_mailbox.h b/cc/resources/texture_mailbox.h |
index ff8c1842ced48d559c84197f1e2b914722273bf1..f9648a8dbd51a0eef3ea532ff3d55dd5ef0f0404 100644 |
--- a/cc/resources/texture_mailbox.h |
+++ b/cc/resources/texture_mailbox.h |
@@ -7,10 +7,11 @@ |
#include <string> |
-#include "base/basictypes.h" |
#include "base/callback.h" |
+#include "base/memory/shared_memory.h" |
#include "cc/base/cc_export.h" |
#include "gpu/command_buffer/common/mailbox.h" |
+#include "ui/gfx/size.h" |
namespace cc { |
@@ -30,14 +31,24 @@ class CC_EXPORT TextureMailbox { |
const ReleaseCallback& callback, |
unsigned texture_target, |
unsigned sync_point); |
+ TextureMailbox(base::SharedMemoryHandle handle, |
+ gfx::Size size, |
danakj
2013/05/23 15:34:33
For textures we always pass along the size outside
|
+ const ReleaseCallback& callback); |
~TextureMailbox(); |
- const ReleaseCallback& callback() const { return callback_; } |
- const int8* data() const { return name_.name; } |
+ bool IsValid() const { return IsTexture() || IsSharedMemory(); } |
+ bool IsTexture() const { return !name_.IsZero(); } |
+ bool IsSharedMemory() const { |
+ return base::SharedMemory::IsHandleValid(handle_); |
+ } |
+ |
bool Equals(const gpu::Mailbox&) const; |
danakj
2013/05/23 15:34:33
This is the wrong name for this method now. How ab
slavi
2013/05/28 18:55:13
Done.
|
+ bool Equals(base::SharedMemoryHandle handle) const; |
danakj
2013/05/23 15:34:33
Same here
slavi
2013/05/28 18:55:13
Done.
|
bool Equals(const TextureMailbox&) const; |
- bool IsEmpty() const; |
+ |
+ const ReleaseCallback& callback() const { return callback_; } |
+ const int8* data() const { return name_.name; } |
const gpu::Mailbox& name() const { return name_; } |
danakj
2013/05/23 15:34:33
I think I'd like to see all the gpu::Mailbox relat
slavi
2013/05/28 18:55:13
Let's do that on a second pass when this guy gets
|
void ResetSyncPoint() { sync_point_ = 0; } |
void RunReleaseCallback(unsigned sync_point, bool lost_resource) const; |
@@ -45,11 +56,17 @@ class CC_EXPORT TextureMailbox { |
unsigned target() const { return target_; } |
unsigned sync_point() const { return sync_point_; } |
+ void SetHandle(base::SharedMemoryHandle handle, gfx::Size size); |
+ base::SharedMemoryHandle handle() const { return handle_; } |
+ gfx::Size size() const { return size_; } |
+ |
private: |
gpu::Mailbox name_; |
ReleaseCallback callback_; |
unsigned target_; |
unsigned sync_point_; |
+ base::SharedMemoryHandle handle_; |
+ gfx::Size size_; |
}; |
} // namespace cc |