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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 void SendEmptyResult(); | 77 void SendEmptyResult(); |
78 void SendBitmapResult(std::unique_ptr<SkBitmap> bitmap); | 78 void SendBitmapResult(std::unique_ptr<SkBitmap> bitmap); |
79 void SendTextureResult( | 79 void SendTextureResult( |
80 const gfx::Size& size, | 80 const gfx::Size& size, |
81 const TextureMailbox& texture_mailbox, | 81 const TextureMailbox& texture_mailbox, |
82 std::unique_ptr<SingleReleaseCallback> release_callback); | 82 std::unique_ptr<SingleReleaseCallback> release_callback); |
83 | 83 |
84 void SendResult(std::unique_ptr<CopyOutputResult> result); | 84 void SendResult(std::unique_ptr<CopyOutputResult> result); |
85 | 85 |
| 86 void set_result_callback(CopyOutputRequestCallback result_callback) { |
| 87 result_callback_ = result_callback; |
| 88 } |
| 89 |
| 90 const CopyOutputRequestCallback& result_callback() { |
| 91 return result_callback_; |
| 92 } |
| 93 |
86 private: | 94 private: |
87 friend struct mojo::StructTraits<mojom::CopyOutputRequestDataView, | 95 friend struct mojo::StructTraits<mojom::CopyOutputRequestDataView, |
88 std::unique_ptr<CopyOutputRequest>>; | 96 std::unique_ptr<CopyOutputRequest>>; |
89 | 97 |
90 CopyOutputRequest(); | 98 CopyOutputRequest(); |
91 CopyOutputRequest(bool force_bitmap_result, | 99 CopyOutputRequest(bool force_bitmap_result, |
92 const CopyOutputRequestCallback& result_callback); | 100 const CopyOutputRequestCallback& result_callback); |
93 | 101 |
94 base::Optional<base::UnguessableToken> source_; | 102 base::Optional<base::UnguessableToken> source_; |
95 bool force_bitmap_result_; | 103 bool force_bitmap_result_; |
96 base::Optional<gfx::Rect> area_; | 104 base::Optional<gfx::Rect> area_; |
97 base::Optional<TextureMailbox> texture_mailbox_; | 105 base::Optional<TextureMailbox> texture_mailbox_; |
98 CopyOutputRequestCallback result_callback_; | 106 CopyOutputRequestCallback result_callback_; |
99 | 107 |
100 DISALLOW_COPY_AND_ASSIGN(CopyOutputRequest); | 108 DISALLOW_COPY_AND_ASSIGN(CopyOutputRequest); |
101 }; | 109 }; |
102 | 110 |
103 } // namespace cc | 111 } // namespace cc |
104 | 112 |
105 #endif // CC_OUTPUT_COPY_OUTPUT_REQUEST_H_ | 113 #endif // CC_OUTPUT_COPY_OUTPUT_REQUEST_H_ |
OLD | NEW |