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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.h

Issue 415773007: Android:Allow a read-back request to wait for a first frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed the review comments. Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7601adc1fa752a5ef6551c50d25171c5a68f824d..7ed5bcbf664cfb6c8eddf7a922e37d1f178e2b2f 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_; }
+ const gfx::Rect GetCaptureRect() { return src_subrect_; }
+ 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.
// -----------------------------------------------------------------------------
@@ -317,6 +340,9 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid
float GetDpiScale() const;
+ // Handles all unprocessed and pending readback requests.
+ void AbortPendingReadbackRequests();
+
// The model object.
RenderWidgetHostImpl* host_;
@@ -393,6 +419,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);
};
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698