summaryrefslogtreecommitdiffstats
path: root/cc/resources/texture_mailbox.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc/resources/texture_mailbox.cc')
-rw-r--r--cc/resources/texture_mailbox.cc67
1 files changed, 16 insertions, 51 deletions
diff --git a/cc/resources/texture_mailbox.cc b/cc/resources/texture_mailbox.cc
index 2a8f570..149d56c 100644
--- a/cc/resources/texture_mailbox.cc
+++ b/cc/resources/texture_mailbox.cc
@@ -4,7 +4,6 @@
#include "cc/resources/texture_mailbox.h"
-#include "base/callback_helpers.h"
#include "base/logging.h"
#include "third_party/khronos/GLES2/gl2.h"
@@ -16,69 +15,48 @@ TextureMailbox::TextureMailbox()
shared_memory_(NULL) {
}
-TextureMailbox::TextureMailbox(
- const std::string& mailbox_name,
- const ReleaseCallback& callback)
- : callback_(callback),
- target_(GL_TEXTURE_2D),
+TextureMailbox::TextureMailbox(const std::string& mailbox_name)
+ : target_(GL_TEXTURE_2D),
sync_point_(0),
shared_memory_(NULL) {
- DCHECK(mailbox_name.empty() == 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& callback)
- : callback_(callback),
- target_(GL_TEXTURE_2D),
+TextureMailbox::TextureMailbox(const gpu::Mailbox& mailbox_name)
+ : target_(GL_TEXTURE_2D),
sync_point_(0),
shared_memory_(NULL) {
- DCHECK(mailbox_name.IsZero() == callback.is_null());
name_.SetName(mailbox_name.name);
}
-TextureMailbox::TextureMailbox(
- const gpu::Mailbox& mailbox_name,
- const ReleaseCallback& callback,
- unsigned sync_point)
- : callback_(callback),
- target_(GL_TEXTURE_2D),
+TextureMailbox::TextureMailbox(const gpu::Mailbox& mailbox_name,
+ unsigned sync_point)
+ : target_(GL_TEXTURE_2D),
sync_point_(sync_point),
shared_memory_(NULL) {
- DCHECK(mailbox_name.IsZero() == callback.is_null());
name_.SetName(mailbox_name.name);
}
-TextureMailbox::TextureMailbox(
- const gpu::Mailbox& mailbox_name,
- const ReleaseCallback& callback,
- unsigned texture_target,
- unsigned sync_point)
- : callback_(callback),
- target_(texture_target),
+TextureMailbox::TextureMailbox(const gpu::Mailbox& mailbox_name,
+ unsigned texture_target,
+ unsigned sync_point)
+ : target_(texture_target),
sync_point_(sync_point),
shared_memory_(NULL) {
- DCHECK(mailbox_name.IsZero() == callback.is_null());
name_.SetName(mailbox_name.name);
}
-TextureMailbox::TextureMailbox(
- base::SharedMemory* shared_memory,
- gfx::Size size,
- const ReleaseCallback& callback)
- : callback_(callback),
- target_(GL_TEXTURE_2D),
+TextureMailbox::TextureMailbox(base::SharedMemory* shared_memory,
+ gfx::Size size)
+ : target_(GL_TEXTURE_2D),
sync_point_(0),
shared_memory_(shared_memory),
- shared_memory_size_(size) {
-}
+ shared_memory_size_(size) {}
-TextureMailbox::~TextureMailbox() {
-}
+TextureMailbox::~TextureMailbox() {}
bool TextureMailbox::Equals(const TextureMailbox& other) const {
if (other.IsTexture())
@@ -103,19 +81,6 @@ void TextureMailbox::SetName(const gpu::Mailbox& name) {
name_ = name;
}
-void TextureMailbox::RunReleaseCallback(unsigned sync_point,
- bool lost_resource) {
- if (!callback_.is_null())
- base::ResetAndReturn(&callback_).Run(sync_point, lost_resource);
-}
-
-TextureMailbox TextureMailbox::CopyWithNewCallback(
- const ReleaseCallback& callback) const {
- TextureMailbox result(*this);
- result.callback_ = callback;
- return result;
-}
-
size_t TextureMailbox::shared_memory_size_in_bytes() const {
return 4 * shared_memory_size_.GetArea();
}