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

Unified Diff: cc/resources/texture_mailbox.cc

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.cc
diff --git a/cc/resources/texture_mailbox.cc b/cc/resources/texture_mailbox.cc
index 0d4787438f46b2d5a00488d74087cc42952c79f1..273f55ebc8141cb9c114d64a9acddf790723999d 100644
--- a/cc/resources/texture_mailbox.cc
+++ b/cc/resources/texture_mailbox.cc
@@ -76,6 +76,17 @@ TextureMailbox::TextureMailbox(
shared_memory_size_(size) {
}
+TextureMailbox::TextureMailbox(
+ SkBitmap bitmap,
+ gfx::Size size,
+ const ReleaseCallback& callback)
+ : callback_(callback),
+ target_(GL_TEXTURE_2D),
+ sync_point_(0),
+ bitmap_(bitmap),
+ shared_memory_size_(size) {
+}
+
TextureMailbox::~TextureMailbox() {
}
@@ -84,6 +95,8 @@ bool TextureMailbox::Equals(const TextureMailbox& other) const {
return ContainsMailbox(other.name());
else if (other.IsSharedMemory())
return ContainsHandle(other.shared_memory_->handle());
+ else if (other.IsBitmap())
+ return other.bitmap_.getPixels() == bitmap_.getPixels();
DCHECK(!other.IsValid());
return !IsValid();

Powered by Google App Engine
This is Rietveld 408576698