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

Side by Side Diff: cc/output/copy_output_result.cc

Issue 142863008: Revert of [#7] Pass gfx structs by const ref (gfx::Size) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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 unified diff | Download patch
« no previous file with comments | « cc/output/copy_output_result.h ('k') | cc/output/direct_renderer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/single_release_callback.h" 8 #include "cc/resources/single_release_callback.h"
9 #include "cc/resources/texture_mailbox.h" 9 #include "cc/resources/texture_mailbox.h"
10 #include "third_party/skia/include/core/SkBitmap.h" 10 #include "third_party/skia/include/core/SkBitmap.h"
11 11
12 namespace cc { 12 namespace cc {
13 13
14 CopyOutputResult::CopyOutputResult() {} 14 CopyOutputResult::CopyOutputResult() {}
15 15
16 CopyOutputResult::CopyOutputResult(scoped_ptr<SkBitmap> bitmap) 16 CopyOutputResult::CopyOutputResult(scoped_ptr<SkBitmap> bitmap)
17 : size_(bitmap->width(), bitmap->height()), 17 : size_(bitmap->width(), bitmap->height()),
18 bitmap_(bitmap.Pass()) { 18 bitmap_(bitmap.Pass()) {
19 DCHECK(bitmap_); 19 DCHECK(bitmap_);
20 } 20 }
21 21
22 CopyOutputResult::CopyOutputResult( 22 CopyOutputResult::CopyOutputResult(
23 const gfx::Size& size, 23 gfx::Size size,
24 const TextureMailbox& texture_mailbox, 24 const TextureMailbox& texture_mailbox,
25 scoped_ptr<SingleReleaseCallback> release_callback) 25 scoped_ptr<SingleReleaseCallback> release_callback)
26 : size_(size), 26 : size_(size),
27 texture_mailbox_(texture_mailbox), 27 texture_mailbox_(texture_mailbox),
28 release_callback_(release_callback.Pass()) { 28 release_callback_(release_callback.Pass()) {
29 DCHECK(texture_mailbox_.IsTexture()); 29 DCHECK(texture_mailbox_.IsTexture());
30 } 30 }
31 31
32 CopyOutputResult::~CopyOutputResult() { 32 CopyOutputResult::~CopyOutputResult() {
33 if (release_callback_) 33 if (release_callback_)
34 release_callback_->Run(0, false); 34 release_callback_->Run(0, false);
35 } 35 }
36 36
37 scoped_ptr<SkBitmap> CopyOutputResult::TakeBitmap() { 37 scoped_ptr<SkBitmap> CopyOutputResult::TakeBitmap() {
38 return bitmap_.Pass(); 38 return bitmap_.Pass();
39 } 39 }
40 40
41 void CopyOutputResult::TakeTexture( 41 void CopyOutputResult::TakeTexture(
42 TextureMailbox* texture_mailbox, 42 TextureMailbox* texture_mailbox,
43 scoped_ptr<SingleReleaseCallback>* release_callback) { 43 scoped_ptr<SingleReleaseCallback>* release_callback) {
44 *texture_mailbox = texture_mailbox_; 44 *texture_mailbox = texture_mailbox_;
45 *release_callback = release_callback_.Pass(); 45 *release_callback = release_callback_.Pass();
46 46
47 texture_mailbox_ = TextureMailbox(); 47 texture_mailbox_ = TextureMailbox();
48 } 48 }
49 49
50 } // namespace cc 50 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/copy_output_result.h ('k') | cc/output/direct_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698