OLD | NEW |
(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_ |
OLD | NEW |