summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc')
-rw-r--r--cc/texture_layer_unittest.cc4
-rw-r--r--cc/texture_mailbox.cc12
-rw-r--r--cc/texture_mailbox.h2
3 files changed, 15 insertions, 3 deletions
diff --git a/cc/texture_layer_unittest.cc b/cc/texture_layer_unittest.cc
index b89f945..3a419c7c 100644
--- a/cc/texture_layer_unittest.cc
+++ b/cc/texture_layer_unittest.cc
@@ -293,10 +293,8 @@ public:
}
void setMailbox(char mailbox_char) {
- gpu::Mailbox name;
- memset(name.name, mailbox_char, sizeof(name.name));
TextureMailbox mailbox(
- name,
+ std::string(64, mailbox_char),
base::Bind(
&TextureLayerImplWithMailboxThreadedCallback::releaseCallback,
base::Unretained(this)));
diff --git a/cc/texture_mailbox.cc b/cc/texture_mailbox.cc
index 437fb1c..b534605 100644
--- a/cc/texture_mailbox.cc
+++ b/cc/texture_mailbox.cc
@@ -12,6 +12,18 @@ TextureMailbox::TextureMailbox()
}
TextureMailbox::TextureMailbox(
+ const std::string& mailbox_name,
+ const ReleaseCallback& mailbox_callback)
+ : callback_(mailbox_callback),
+ sync_point_(0) {
+ DCHECK(mailbox_name.empty() == mailbox_callback.is_null());
+ if (!mailbox_name.empty()) {
+ CHECK(mailbox_name.size() == sizeof(name_.name));
+ name_.SetName(reinterpret_cast<const int8*>(mailbox_name.data()));
+ }
+}
+
+TextureMailbox::TextureMailbox(
const gpu::Mailbox& mailbox_name,
const ReleaseCallback& mailbox_callback)
: callback_(mailbox_callback),
diff --git a/cc/texture_mailbox.h b/cc/texture_mailbox.h
index 7520087..9314ddd 100644
--- a/cc/texture_mailbox.h
+++ b/cc/texture_mailbox.h
@@ -18,6 +18,8 @@ class CC_EXPORT TextureMailbox {
public:
typedef base::Callback<void(unsigned)> ReleaseCallback;
TextureMailbox();
+ TextureMailbox(const std::string& mailbox_name,
+ const ReleaseCallback& callback);
TextureMailbox(const gpu::Mailbox& mailbox_name,
const ReleaseCallback& callback);
TextureMailbox(const gpu::Mailbox& mailbox_name,