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

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

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/layers/layer_impl.cc ('k') | cc/output/copy_output_request.cc » ('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 #ifndef CC_OUTPUT_COPY_OUTPUT_REQUEST_H_
6 #define CC_OUTPUT_COPY_OUTPUT_REQUEST_H_
7
8 #include "base/callback.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "cc/base/cc_export.h"
11
12 class SkBitmap;
13
14 namespace cc {
15
16 class CC_EXPORT CopyOutputRequest {
17 public:
18 typedef base::Callback<void(scoped_ptr<SkBitmap>)> CopyAsBitmapCallback;
19
20 static scoped_ptr<CopyOutputRequest> CreateBitmapRequest(
21 const CopyAsBitmapCallback& bitmap_callback) {
22 return make_scoped_ptr(new CopyOutputRequest(bitmap_callback));
23 }
24
25 ~CopyOutputRequest();
26
27 bool IsEmpty() const { return !HasBitmapRequest(); }
28 bool HasBitmapRequest() const { return !bitmap_callback_.is_null(); }
29
30 void SendEmptyResult();
31 void SendBitmapResult(scoped_ptr<SkBitmap> bitmap);
32
33 bool Equals(const CopyOutputRequest& other) const {
34 return bitmap_callback_.Equals(other.bitmap_callback_);
35 }
36
37 private:
38 explicit CopyOutputRequest(const CopyAsBitmapCallback& callback);
39
40 CopyAsBitmapCallback bitmap_callback_;
41 };
42
43 } // namespace cc
44
45 #endif // CC_OUTPUT_COPY_OUTPUT_REQUEST_H_
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/output/copy_output_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698