| 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 #ifndef CC_OUTPUT_COPY_OUTPUT_REQUEST_H_ | 5 #ifndef CC_OUTPUT_COPY_OUTPUT_REQUEST_H_ |
| 6 #define CC_OUTPUT_COPY_OUTPUT_REQUEST_H_ | 6 #define CC_OUTPUT_COPY_OUTPUT_REQUEST_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
| 11 #include "ui/gfx/rect.h" | 11 #include "ui/gfx/rect.h" |
| 12 | 12 |
| 13 class SkBitmap; | 13 class SkBitmap; |
| 14 | 14 |
| 15 namespace cc { | 15 namespace cc { |
| 16 class CopyOutputResult; | 16 class CopyOutputResult; |
| 17 class ScopedReleaseCallback; |
| 17 class TextureMailbox; | 18 class TextureMailbox; |
| 18 | 19 |
| 19 class CC_EXPORT CopyOutputRequest { | 20 class CC_EXPORT CopyOutputRequest { |
| 20 public: | 21 public: |
| 21 typedef base::Callback<void(scoped_ptr<CopyOutputResult> result)> | 22 typedef base::Callback<void(scoped_ptr<CopyOutputResult> result)> |
| 22 CopyOutputRequestCallback; | 23 CopyOutputRequestCallback; |
| 23 | 24 |
| 24 static scoped_ptr<CopyOutputRequest> CreateEmptyRequest() { | 25 static scoped_ptr<CopyOutputRequest> CreateEmptyRequest() { |
| 25 return make_scoped_ptr(new CopyOutputRequest); | 26 return make_scoped_ptr(new CopyOutputRequest); |
| 26 } | 27 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 54 void set_area(gfx::Rect area) { | 55 void set_area(gfx::Rect area) { |
| 55 has_area_ = true; | 56 has_area_ = true; |
| 56 area_ = area; | 57 area_ = area; |
| 57 } | 58 } |
| 58 bool has_area() const { return has_area_; } | 59 bool has_area() const { return has_area_; } |
| 59 gfx::Rect area() const { return area_; } | 60 gfx::Rect area() const { return area_; } |
| 60 | 61 |
| 61 void SendEmptyResult(); | 62 void SendEmptyResult(); |
| 62 void SendBitmapResult(scoped_ptr<SkBitmap> bitmap); | 63 void SendBitmapResult(scoped_ptr<SkBitmap> bitmap); |
| 63 void SendTextureResult(gfx::Size size, | 64 void SendTextureResult(gfx::Size size, |
| 64 scoped_ptr<TextureMailbox> texture_mailbox); | 65 const TextureMailbox& texture_mailbox, |
| 66 ScopedReleaseCallback release_callback); |
| 65 | 67 |
| 66 void SendResult(scoped_ptr<CopyOutputResult> result); | 68 void SendResult(scoped_ptr<CopyOutputResult> result); |
| 67 | 69 |
| 68 bool Equals(const CopyOutputRequest& other) const { | 70 bool Equals(const CopyOutputRequest& other) const { |
| 69 return result_callback_.Equals(other.result_callback_) && | 71 return result_callback_.Equals(other.result_callback_) && |
| 70 force_bitmap_result_ == other.force_bitmap_result_; | 72 force_bitmap_result_ == other.force_bitmap_result_; |
| 71 } | 73 } |
| 72 | 74 |
| 73 private: | 75 private: |
| 74 CopyOutputRequest(); | 76 CopyOutputRequest(); |
| 75 explicit CopyOutputRequest(bool force_bitmap_result, | 77 explicit CopyOutputRequest(bool force_bitmap_result, |
| 76 const CopyOutputRequestCallback& result_callback); | 78 const CopyOutputRequestCallback& result_callback); |
| 77 | 79 |
| 78 bool force_bitmap_result_; | 80 bool force_bitmap_result_; |
| 79 bool has_area_; | 81 bool has_area_; |
| 80 gfx::Rect area_; | 82 gfx::Rect area_; |
| 81 CopyOutputRequestCallback result_callback_; | 83 CopyOutputRequestCallback result_callback_; |
| 82 }; | 84 }; |
| 83 | 85 |
| 84 } // namespace cc | 86 } // namespace cc |
| 85 | 87 |
| 86 #endif // CC_OUTPUT_COPY_OUTPUT_REQUEST_H_ | 88 #endif // CC_OUTPUT_COPY_OUTPUT_REQUEST_H_ |
| OLD | NEW |