OLD | NEW |
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 } | 53 } |
54 | 54 |
55 namespace content { | 55 namespace content { |
56 class ContentViewCoreImpl; | 56 class ContentViewCoreImpl; |
57 class OverscrollControllerAndroid; | 57 class OverscrollControllerAndroid; |
58 class RenderWidgetHost; | 58 class RenderWidgetHost; |
59 class RenderWidgetHostImpl; | 59 class RenderWidgetHostImpl; |
60 struct DidOverscrollParams; | 60 struct DidOverscrollParams; |
61 struct NativeWebKeyboardEvent; | 61 struct NativeWebKeyboardEvent; |
62 | 62 |
63 class ReadbackRequest { | |
64 public: | |
65 explicit ReadbackRequest(float scale, | |
66 SkColorType color_type, | |
67 gfx::Rect src_subrect, | |
68 ReadbackRequestCallback& result_callback); | |
69 ~ReadbackRequest(); | |
70 float GetScale() { return scale_; } | |
71 SkColorType GetColorFormat() { return color_type_; } | |
72 const gfx::Rect GetCaptureRect() { return src_subrect_; } | |
73 ReadbackRequestCallback& GetResultCallback() { return result_callback_; } | |
74 | |
75 private: | |
76 ReadbackRequest(); | |
77 float scale_; | |
78 SkColorType color_type_; | |
79 gfx::Rect src_subrect_; | |
80 ReadbackRequestCallback result_callback_; | |
81 }; | |
82 | |
83 // ----------------------------------------------------------------------------- | 63 // ----------------------------------------------------------------------------- |
84 // See comments in render_widget_host_view.h about this class and its members. | 64 // See comments in render_widget_host_view.h about this class and its members. |
85 // ----------------------------------------------------------------------------- | 65 // ----------------------------------------------------------------------------- |
86 class CONTENT_EXPORT RenderWidgetHostViewAndroid | 66 class CONTENT_EXPORT RenderWidgetHostViewAndroid |
87 : public RenderWidgetHostViewBase, | 67 : public RenderWidgetHostViewBase, |
88 public cc::DelegatedFrameResourceCollectionClient, | 68 public cc::DelegatedFrameResourceCollectionClient, |
89 public cc::SurfaceFactoryClient, | 69 public cc::SurfaceFactoryClient, |
90 public ui::GestureProviderClient, | 70 public ui::GestureProviderClient, |
91 public ui::WindowAndroidObserver, | 71 public ui::WindowAndroidObserver, |
92 public DelegatedFrameEvictorClient, | 72 public DelegatedFrameEvictorClient, |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 FLUSH_INPUT = 1 << 0, | 310 FLUSH_INPUT = 1 << 0, |
331 BEGIN_FRAME = 1 << 1, | 311 BEGIN_FRAME = 1 << 1, |
332 PERSISTENT_BEGIN_FRAME = 1 << 2 | 312 PERSISTENT_BEGIN_FRAME = 1 << 2 |
333 }; | 313 }; |
334 void RequestVSyncUpdate(uint32 requests); | 314 void RequestVSyncUpdate(uint32 requests); |
335 void StartObservingRootWindow(); | 315 void StartObservingRootWindow(); |
336 void StopObservingRootWindow(); | 316 void StopObservingRootWindow(); |
337 void SendBeginFrame(base::TimeTicks frame_time, base::TimeDelta vsync_period); | 317 void SendBeginFrame(base::TimeTicks frame_time, base::TimeDelta vsync_period); |
338 bool Animate(base::TimeTicks frame_time); | 318 bool Animate(base::TimeTicks frame_time); |
339 | 319 |
340 // Handles all unprocessed and pending readback requests. | |
341 void AbortPendingReadbackRequests(); | |
342 | |
343 // The model object. | 320 // The model object. |
344 RenderWidgetHostImpl* host_; | 321 RenderWidgetHostImpl* host_; |
345 | 322 |
346 bool use_surfaces_; | 323 bool use_surfaces_; |
347 | 324 |
348 // Used to control action dispatch at the next |OnVSync()| call. | 325 // Used to control action dispatch at the next |OnVSync()| call. |
349 uint32 outstanding_vsync_requests_; | 326 uint32 outstanding_vsync_requests_; |
350 | 327 |
351 bool is_showing_; | 328 bool is_showing_; |
352 | 329 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 scoped_ptr<cc::CompositorFrame> output_frame); | 388 scoped_ptr<cc::CompositorFrame> output_frame); |
412 ~LastFrameInfo(); | 389 ~LastFrameInfo(); |
413 uint32 output_surface_id; | 390 uint32 output_surface_id; |
414 scoped_ptr<cc::CompositorFrame> frame; | 391 scoped_ptr<cc::CompositorFrame> frame; |
415 }; | 392 }; |
416 | 393 |
417 scoped_ptr<LastFrameInfo> last_frame_info_; | 394 scoped_ptr<LastFrameInfo> last_frame_info_; |
418 | 395 |
419 TextSurroundingSelectionCallback text_surrounding_selection_callback_; | 396 TextSurroundingSelectionCallback text_surrounding_selection_callback_; |
420 | 397 |
421 // List of readbackrequests waiting for arrival of a valid frame. | |
422 std::queue<ReadbackRequest> readbacks_waiting_for_frame_; | |
423 | |
424 // The last scroll offset of the view. | 398 // The last scroll offset of the view. |
425 gfx::Vector2dF last_scroll_offset_; | 399 gfx::Vector2dF last_scroll_offset_; |
426 | 400 |
427 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; | 401 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; |
428 | 402 |
429 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 403 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
430 }; | 404 }; |
431 | 405 |
432 } // namespace content | 406 } // namespace content |
433 | 407 |
434 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 408 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
OLD | NEW |