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

Unified Diff: cc/resources/texture_mailbox.cc

Issue 23648014: cc: Move TextureMailbox::ReleaseCallback to SingleReleaseCallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: releasecallback: SingleReleaseCallback Created 7 years, 3 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
« no previous file with comments | « cc/resources/texture_mailbox.h ('k') | cc/resources/texture_mailbox_deleter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/texture_mailbox.cc
diff --git a/cc/resources/texture_mailbox.cc b/cc/resources/texture_mailbox.cc
index 2a8f570c1bf23ced9bc9251133c232782d422c2a..149d56c8d1ac12031cf85f1646fa7d8fe952a406 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();
}
« no previous file with comments | « cc/resources/texture_mailbox.h ('k') | cc/resources/texture_mailbox_deleter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698