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

Unified Diff: cc/resources/texture_mailbox.h

Issue 17859002: Allow WebExternalTextureLayers to receive a bitmap along with a mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 855287df2d1931102322025818b0bd2adb93099c..2608295606f0ebc737584677e4ff597336c82f13 100644
--- a/cc/resources/texture_mailbox.h
+++ b/cc/resources/texture_mailbox.h
@@ -11,6 +11,7 @@
#include "base/memory/shared_memory.h"
#include "cc/base/cc_export.h"
#include "gpu/command_buffer/common/mailbox.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/size.h"
namespace cc {
@@ -36,12 +37,16 @@ class CC_EXPORT TextureMailbox {
TextureMailbox(base::SharedMemory* shared_memory,
gfx::Size size,
const ReleaseCallback& callback);
+ TextureMailbox(SkBitmap bitmap,
+ gfx::Size size,
+ const ReleaseCallback& callback);
~TextureMailbox();
- bool IsValid() const { return IsTexture() || IsSharedMemory(); }
+ bool IsValid() const { return IsTexture() || IsSharedMemory() || IsBitmap(); }
bool IsTexture() const { return !name_.IsZero(); }
bool IsSharedMemory() const { return shared_memory_ != NULL; }
+ bool IsBitmap() const { return !bitmap_.isNull(); }
bool Equals(const TextureMailbox&) const;
bool ContainsMailbox(const gpu::Mailbox&) const;
@@ -59,6 +64,7 @@ class CC_EXPORT TextureMailbox {
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;
+ const SkBitmap& bitmap() const { return bitmap_; }
TextureMailbox CopyWithNewCallback(const ReleaseCallback& callback) const;
@@ -69,6 +75,7 @@ class CC_EXPORT TextureMailbox {
unsigned sync_point_;
base::SharedMemory* shared_memory_;
gfx::Size shared_memory_size_;
+ SkBitmap bitmap_;
};
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698