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

Unified Diff: cc/resources/texture_mailbox.h

Issue 15001027: [Aura] Added Support for rendering software compositor frames as cc::TextureLayers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed DuplicateHandle on Windows. Created 7 years, 7 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
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

Powered by Google App Engine
This is Rietveld 408576698