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

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

Issue 15435003: cc: Add CopyAsBitmapRequest class to hold the readback callback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nolint Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « cc/output/copy_output_request.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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "cc/output/copy_output_request.h"
6
7 #include "base/callback_helpers.h"
8 #include "base/logging.h"
9 #include "third_party/skia/include/core/SkBitmap.h"
10
11 namespace cc {
12
13 CopyOutputRequest::CopyOutputRequest(const CopyAsBitmapCallback& callback)
14 : bitmap_callback_(callback) {}
15
16 CopyOutputRequest::~CopyOutputRequest() {
17 SendEmptyResult();
18 }
19
20 void CopyOutputRequest::SendEmptyResult() {
21 if (!bitmap_callback_.is_null())
22 base::ResetAndReturn(&bitmap_callback_).Run(scoped_ptr<SkBitmap>());
23 }
24
25 void CopyOutputRequest::SendBitmapResult(scoped_ptr<SkBitmap> bitmap) {
26 DCHECK(HasBitmapRequest());
27 base::ResetAndReturn(&bitmap_callback_).Run(bitmap.Pass());
28 }
29
30 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/copy_output_request.h ('k') | cc/output/direct_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698