| Index: cc/output/copy_output_result.cc
|
| diff --git a/cc/output/copy_output_result.cc b/cc/output/copy_output_result.cc
|
| index 55213cde6b86a6c56e09061e85e65a50b4dea35c..1831fba3be13be6502df7fcca321ba852ca6ad75 100644
|
| --- a/cc/output/copy_output_result.cc
|
| +++ b/cc/output/copy_output_result.cc
|
| @@ -5,6 +5,7 @@
|
| #include "cc/output/copy_output_result.h"
|
|
|
| #include "base/logging.h"
|
| +#include "cc/resources/single_release_callback.h"
|
| #include "cc/resources/texture_mailbox.h"
|
| #include "third_party/skia/include/core/SkBitmap.h"
|
|
|
| @@ -18,25 +19,32 @@ CopyOutputResult::CopyOutputResult(scoped_ptr<SkBitmap> bitmap)
|
| DCHECK(bitmap_);
|
| }
|
|
|
| -CopyOutputResult::CopyOutputResult(gfx::Size size,
|
| - scoped_ptr<TextureMailbox> texture_mailbox)
|
| +CopyOutputResult::CopyOutputResult(
|
| + gfx::Size size,
|
| + const TextureMailbox& texture_mailbox,
|
| + scoped_ptr<SingleReleaseCallback> release_callback)
|
| : size_(size),
|
| - texture_mailbox_(texture_mailbox.Pass()) {
|
| - DCHECK(texture_mailbox_);
|
| - DCHECK(texture_mailbox_->IsTexture());
|
| + texture_mailbox_(texture_mailbox),
|
| + release_callback_(release_callback.Pass()) {
|
| + DCHECK(texture_mailbox_.IsTexture());
|
| }
|
|
|
| CopyOutputResult::~CopyOutputResult() {
|
| - if (texture_mailbox_)
|
| - texture_mailbox_->RunReleaseCallback(0, false);
|
| + if (release_callback_)
|
| + release_callback_->Run(0, false);
|
| }
|
|
|
| scoped_ptr<SkBitmap> CopyOutputResult::TakeBitmap() {
|
| return bitmap_.Pass();
|
| }
|
|
|
| -scoped_ptr<TextureMailbox> CopyOutputResult::TakeTexture() {
|
| - return texture_mailbox_.Pass();
|
| +void CopyOutputResult::TakeTexture(
|
| + TextureMailbox* texture_mailbox,
|
| + scoped_ptr<SingleReleaseCallback>* release_callback) {
|
| + *texture_mailbox = texture_mailbox_;
|
| + *release_callback = release_callback_.Pass();
|
| +
|
| + texture_mailbox_ = TextureMailbox();
|
| }
|
|
|
| } // namespace cc
|
|
|