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

Side by Side 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: Move explicit constructor body to cc files. 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
7 7
8 #include <map> 8 #include <map>
9 #include <queue> 9 #include <queue>
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 52
53 namespace content { 53 namespace content {
54 class ContentViewCoreImpl; 54 class ContentViewCoreImpl;
55 class OverscrollGlow; 55 class OverscrollGlow;
56 class RenderWidgetHost; 56 class RenderWidgetHost;
57 class RenderWidgetHostImpl; 57 class RenderWidgetHostImpl;
58 struct DidOverscrollParams; 58 struct DidOverscrollParams;
59 struct NativeWebKeyboardEvent; 59 struct NativeWebKeyboardEvent;
60 60
61 class ReadbackRequest {
62 public:
63 explicit ReadbackRequest(
64 float scale,
65 SkColorType color_type,
66 gfx::Rect src_subrect,
67 const base::Callback<void(bool, const SkBitmap&)>& result_callback);
68 ~ReadbackRequest();
69 float GetScale() { return scale_; }
70 SkColorType GetColorFormat() { return color_type_; }
71 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.
72 const base::Callback<void(bool, const SkBitmap&)>& GetResultCallback() {
73 return result_callback_;
74 }
75
76 private:
77 ReadbackRequest();
78 float scale_;
79 SkColorType color_type_;
80 gfx::Rect src_subrect_;
81 base::Callback<void(bool, const SkBitmap&)> result_callback_;
82 };
83
61 // ----------------------------------------------------------------------------- 84 // -----------------------------------------------------------------------------
62 // See comments in render_widget_host_view.h about this class and its members. 85 // See comments in render_widget_host_view.h about this class and its members.
63 // ----------------------------------------------------------------------------- 86 // -----------------------------------------------------------------------------
64 class CONTENT_EXPORT RenderWidgetHostViewAndroid 87 class CONTENT_EXPORT RenderWidgetHostViewAndroid
65 : public RenderWidgetHostViewBase, 88 : public RenderWidgetHostViewBase,
66 public cc::DelegatedFrameResourceCollectionClient, 89 public cc::DelegatedFrameResourceCollectionClient,
67 public ImageTransportFactoryAndroidObserver, 90 public ImageTransportFactoryAndroidObserver,
68 public ui::GestureProviderClient, 91 public ui::GestureProviderClient,
69 public ui::WindowAndroidObserver, 92 public ui::WindowAndroidObserver,
70 public DelegatedFrameEvictorClient, 93 public DelegatedFrameEvictorClient,
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 void InternalSwapCompositorFrame(uint32 output_surface_id, 332 void InternalSwapCompositorFrame(uint32 output_surface_id,
310 scoped_ptr<cc::CompositorFrame> frame); 333 scoped_ptr<cc::CompositorFrame> frame);
311 334
312 bool Animate(base::TimeTicks frame_time); 335 bool Animate(base::TimeTicks frame_time);
313 336
314 void OnContentScrollingChange(); 337 void OnContentScrollingChange();
315 bool IsContentScrolling() const; 338 bool IsContentScrolling() const;
316 339
317 float GetDpiScale() const; 340 float GetDpiScale() const;
318 341
342 // Handles all unprocessed and pending readback requests.
343 void AbortPendingReadbackRequests();
344
319 // The model object. 345 // The model object.
320 RenderWidgetHostImpl* host_; 346 RenderWidgetHostImpl* host_;
321 347
322 // Used to track whether this render widget needs a BeginFrame. 348 // Used to track whether this render widget needs a BeginFrame.
323 bool needs_begin_frame_; 349 bool needs_begin_frame_;
324 350
325 bool is_showing_; 351 bool is_showing_;
326 352
327 // ContentViewCoreImpl is our interface to the view system. 353 // ContentViewCoreImpl is our interface to the view system.
328 ContentViewCoreImpl* content_view_core_; 354 ContentViewCoreImpl* content_view_core_;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 scoped_ptr<cc::CompositorFrame> output_frame); 415 scoped_ptr<cc::CompositorFrame> output_frame);
390 ~LastFrameInfo(); 416 ~LastFrameInfo();
391 uint32 output_surface_id; 417 uint32 output_surface_id;
392 scoped_ptr<cc::CompositorFrame> frame; 418 scoped_ptr<cc::CompositorFrame> frame;
393 }; 419 };
394 420
395 scoped_ptr<LastFrameInfo> last_frame_info_; 421 scoped_ptr<LastFrameInfo> last_frame_info_;
396 422
397 TextSurroundingSelectionCallback text_surrounding_selection_callback_; 423 TextSurroundingSelectionCallback text_surrounding_selection_callback_;
398 424
425 // List of readbackrequests waiting for arrival of a valid frame.
426 std::queue<ReadbackRequest> readbacks_waiting_for_frame_;
427
399 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); 428 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid);
400 }; 429 };
401 430
402 } // namespace content 431 } // namespace content
403 432
404 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 433 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698