OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/output/copy_output_result.h" | 5 #include "cc/output/copy_output_result.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "cc/resources/texture_mailbox.h" | 8 #include "cc/resources/texture_mailbox.h" |
9 #include "third_party/skia/include/core/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
10 | 10 |
11 namespace cc { | 11 namespace cc { |
12 | 12 |
13 CopyOutputResult::CopyOutputResult() {} | 13 CopyOutputResult::CopyOutputResult() {} |
14 | 14 |
15 CopyOutputResult::CopyOutputResult(scoped_ptr<SkBitmap> bitmap) | 15 CopyOutputResult::CopyOutputResult(std::unique_ptr<SkBitmap> bitmap) |
16 : size_(bitmap->width(), bitmap->height()), bitmap_(std::move(bitmap)) { | 16 : size_(bitmap->width(), bitmap->height()), bitmap_(std::move(bitmap)) { |
17 DCHECK(bitmap_); | 17 DCHECK(bitmap_); |
18 } | 18 } |
19 | 19 |
20 CopyOutputResult::CopyOutputResult( | 20 CopyOutputResult::CopyOutputResult( |
21 const gfx::Size& size, | 21 const gfx::Size& size, |
22 const TextureMailbox& texture_mailbox, | 22 const TextureMailbox& texture_mailbox, |
23 scoped_ptr<SingleReleaseCallback> release_callback) | 23 std::unique_ptr<SingleReleaseCallback> release_callback) |
24 : size_(size), | 24 : size_(size), |
25 texture_mailbox_(texture_mailbox), | 25 texture_mailbox_(texture_mailbox), |
26 release_callback_(std::move(release_callback)) { | 26 release_callback_(std::move(release_callback)) { |
27 DCHECK(texture_mailbox_.IsTexture()); | 27 DCHECK(texture_mailbox_.IsTexture()); |
28 } | 28 } |
29 | 29 |
30 CopyOutputResult::~CopyOutputResult() { | 30 CopyOutputResult::~CopyOutputResult() { |
31 if (release_callback_) | 31 if (release_callback_) |
32 release_callback_->Run(gpu::SyncToken(), false); | 32 release_callback_->Run(gpu::SyncToken(), false); |
33 } | 33 } |
34 | 34 |
35 scoped_ptr<SkBitmap> CopyOutputResult::TakeBitmap() { | 35 std::unique_ptr<SkBitmap> CopyOutputResult::TakeBitmap() { |
36 return std::move(bitmap_); | 36 return std::move(bitmap_); |
37 } | 37 } |
38 | 38 |
39 void CopyOutputResult::TakeTexture( | 39 void CopyOutputResult::TakeTexture( |
40 TextureMailbox* texture_mailbox, | 40 TextureMailbox* texture_mailbox, |
41 scoped_ptr<SingleReleaseCallback>* release_callback) { | 41 std::unique_ptr<SingleReleaseCallback>* release_callback) { |
42 *texture_mailbox = texture_mailbox_; | 42 *texture_mailbox = texture_mailbox_; |
43 *release_callback = std::move(release_callback_); | 43 *release_callback = std::move(release_callback_); |
44 | 44 |
45 texture_mailbox_ = TextureMailbox(); | 45 texture_mailbox_ = TextureMailbox(); |
46 } | 46 } |
47 | 47 |
48 } // namespace cc | 48 } // namespace cc |
OLD | NEW |