Index: content/browser/renderer_host/render_widget_host_view_android.h |
diff --git a/content/browser/renderer_host/render_widget_host_view_android.h b/content/browser/renderer_host/render_widget_host_view_android.h |
index 3a05e27ae3b71c31e8e12a98212ea313a4eb14d7..9d9b7daa15956a14cbd26b4331415c3649e61405 100644 |
--- a/content/browser/renderer_host/render_widget_host_view_android.h |
+++ b/content/browser/renderer_host/render_widget_host_view_android.h |
@@ -58,6 +58,29 @@ class RenderWidgetHostImpl; |
struct DidOverscrollParams; |
struct NativeWebKeyboardEvent; |
+class ReadbackRequest { |
+ public: |
+ explicit ReadbackRequest( |
+ float scale, |
+ SkColorType color_type, |
+ gfx::Rect src_subrect, |
+ const base::Callback<void(bool, const SkBitmap&)>& result_callback); |
+ ~ReadbackRequest(); |
+ float GetScale() { return scale_; } |
+ SkColorType GetColorFormat() { return color_type_; } |
+ gfx::Rect GetCaptureRect() { return src_subrect_; } |
no sievers
2014/08/19 17:47:08
nit: const gfx::Rect&
sivag
2014/08/20 07:10:54
Done.
|
+ const base::Callback<void(bool, const SkBitmap&)>& GetResultCallback() { |
+ return result_callback_; |
+ } |
+ |
+ private: |
+ ReadbackRequest(); |
+ float scale_; |
+ SkColorType color_type_; |
+ gfx::Rect src_subrect_; |
+ base::Callback<void(bool, const SkBitmap&)> result_callback_; |
+}; |
+ |
// ----------------------------------------------------------------------------- |
// See comments in render_widget_host_view.h about this class and its members. |
// ----------------------------------------------------------------------------- |
@@ -316,6 +339,9 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid |
float GetDpiScale() const; |
+ // Handles all unprocessed and pending readback requests. |
+ void AbortPendingReadbackRequests(); |
+ |
// The model object. |
RenderWidgetHostImpl* host_; |
@@ -396,6 +422,9 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid |
TextSurroundingSelectionCallback text_surrounding_selection_callback_; |
+ // List of readbackrequests waiting for arrival of a valid frame. |
+ std::queue<ReadbackRequest> readbacks_waiting_for_frame_; |
+ |
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
}; |