| 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..da4bc78134eb5b07943aa72bc41e9ea4eb6abc9a 100644
|
| --- a/cc/output/copy_output_result.cc
|
| +++ b/cc/output/copy_output_result.cc
|
| @@ -19,24 +19,30 @@ CopyOutputResult::CopyOutputResult(scoped_ptr<SkBitmap> bitmap)
|
| }
|
|
|
| CopyOutputResult::CopyOutputResult(gfx::Size size,
|
| - scoped_ptr<TextureMailbox> texture_mailbox)
|
| + const TextureMailbox& texture_mailbox,
|
| + ScopedReleaseCallback 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_.IsEmpty())
|
| + release_callback_.RunAndReset(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,
|
| + ScopedReleaseCallback* release_callback) {
|
| + *texture_mailbox = texture_mailbox_;
|
| + *release_callback = release_callback_.Pass();
|
| +
|
| + texture_mailbox_ = TextureMailbox();
|
| + DCHECK(release_callback_.IsEmpty());
|
| }
|
|
|
| } // namespace cc
|
|
|