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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 InputEventAckState ack_result) override; | 143 InputEventAckState ack_result) override; |
144 InputEventAckState FilterInputEvent( | 144 InputEventAckState FilterInputEvent( |
145 const blink::WebInputEvent& input_event) override; | 145 const blink::WebInputEvent& input_event) override; |
146 void OnSetNeedsFlushInput() override; | 146 void OnSetNeedsFlushInput() override; |
147 void GestureEventAck(const blink::WebGestureEvent& event, | 147 void GestureEventAck(const blink::WebGestureEvent& event, |
148 InputEventAckState ack_result) override; | 148 InputEventAckState ack_result) override; |
149 BrowserAccessibilityManager* CreateBrowserAccessibilityManager( | 149 BrowserAccessibilityManager* CreateBrowserAccessibilityManager( |
150 BrowserAccessibilityDelegate* delegate, bool for_root_frame) override; | 150 BrowserAccessibilityDelegate* delegate, bool for_root_frame) override; |
151 bool LockMouse() override; | 151 bool LockMouse() override; |
152 void UnlockMouse() override; | 152 void UnlockMouse() override; |
153 void OnSwapCompositorFrame(uint32_t output_surface_id, | 153 void OnSwapCompositorFrame(uint32_t compositor_frame_sink_id, |
154 cc::CompositorFrame frame) override; | 154 cc::CompositorFrame frame) override; |
155 void ClearCompositorFrame() override; | 155 void ClearCompositorFrame() override; |
156 void DidOverscroll(const ui::DidOverscrollParams& params) override; | 156 void DidOverscroll(const ui::DidOverscrollParams& params) override; |
157 void DidStopFlinging() override; | 157 void DidStopFlinging() override; |
158 uint32_t GetSurfaceClientId() override; | 158 uint32_t GetSurfaceClientId() override; |
159 void ShowDisambiguationPopup(const gfx::Rect& rect_pixels, | 159 void ShowDisambiguationPopup(const gfx::Rect& rect_pixels, |
160 const SkBitmap& zoomed_bitmap) override; | 160 const SkBitmap& zoomed_bitmap) override; |
161 std::unique_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget() | 161 std::unique_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget() |
162 override; | 162 override; |
163 void LockCompositingSurface() override; | 163 void LockCompositingSurface() override; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 void OnShowingPastePopup(const gfx::PointF& point); | 239 void OnShowingPastePopup(const gfx::PointF& point); |
240 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip); | 240 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip); |
241 | 241 |
242 void SynchronousFrameMetadata(cc::CompositorFrameMetadata frame_metadata); | 242 void SynchronousFrameMetadata(cc::CompositorFrameMetadata frame_metadata); |
243 | 243 |
244 static void OnContextLost(); | 244 static void OnContextLost(); |
245 | 245 |
246 private: | 246 private: |
247 void RunAckCallbacks(); | 247 void RunAckCallbacks(); |
248 | 248 |
249 void CheckOutputSurfaceChanged(uint32_t output_surface_id); | 249 void CheckCompositorFrameSinkChanged(uint32_t compositor_frame_sink_id); |
250 void SubmitCompositorFrame(cc::CompositorFrame frame_data); | 250 void SubmitCompositorFrame(cc::CompositorFrame frame_data); |
251 void SendReclaimCompositorResources(uint32_t output_surface_id, | 251 void SendReclaimCompositorResources(uint32_t compositor_frame_sink_id, |
252 bool is_swap_ack); | 252 bool is_swap_ack); |
253 | 253 |
254 void OnFrameMetadataUpdated(const cc::CompositorFrameMetadata& frame_metadata, | 254 void OnFrameMetadataUpdated(const cc::CompositorFrameMetadata& frame_metadata, |
255 bool is_transparent); | 255 bool is_transparent); |
256 | 256 |
257 void ShowInternal(); | 257 void ShowInternal(); |
258 void HideInternal(); | 258 void HideInternal(); |
259 void AttachLayers(); | 259 void AttachLayers(); |
260 void RemoveLayers(); | 260 void RemoveLayers(); |
261 | 261 |
(...skipping 14 matching lines...) Expand all Loading... |
276 const ReadbackRequestCallback& callback, | 276 const ReadbackRequestCallback& callback, |
277 const SkColorType color_type); | 277 const SkColorType color_type); |
278 | 278 |
279 // If we have locks on a frame during a ContentViewCore swap or a context | 279 // If we have locks on a frame during a ContentViewCore swap or a context |
280 // lost, the frame is no longer valid and we can safely release all the locks. | 280 // lost, the frame is no longer valid and we can safely release all the locks. |
281 // Use this method to release all the locks. | 281 // Use this method to release all the locks. |
282 void ReleaseLocksOnSurface(); | 282 void ReleaseLocksOnSurface(); |
283 | 283 |
284 // Drop any incoming frames from the renderer when there are locks on the | 284 // Drop any incoming frames from the renderer when there are locks on the |
285 // current frame. | 285 // current frame. |
286 void RetainFrame(uint32_t output_surface_id, cc::CompositorFrame frame); | 286 void RetainFrame(uint32_t compositor_frame_sink_id, |
| 287 cc::CompositorFrame frame); |
287 | 288 |
288 void InternalSwapCompositorFrame(uint32_t output_surface_id, | 289 void InternalSwapCompositorFrame(uint32_t compositor_frame_sink_id, |
289 cc::CompositorFrame frame); | 290 cc::CompositorFrame frame); |
290 void DestroyDelegatedContent(); | 291 void DestroyDelegatedContent(); |
291 void OnLostResources(); | 292 void OnLostResources(); |
292 | 293 |
293 void ReturnResources(const cc::ReturnedResourceArray& resources); | 294 void ReturnResources(const cc::ReturnedResourceArray& resources); |
294 | 295 |
295 enum VSyncRequestType { | 296 enum VSyncRequestType { |
296 FLUSH_INPUT = 1 << 0, | 297 FLUSH_INPUT = 1 << 0, |
297 BEGIN_FRAME = 1 << 1, | 298 BEGIN_FRAME = 1 << 1, |
298 PERSISTENT_BEGIN_FRAME = 1 << 2 | 299 PERSISTENT_BEGIN_FRAME = 1 << 2 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 | 333 |
333 // Manages the Compositor Frames received from the renderer. | 334 // Manages the Compositor Frames received from the renderer. |
334 std::unique_ptr<ui::DelegatedFrameHostAndroid> delegated_frame_host_; | 335 std::unique_ptr<ui::DelegatedFrameHostAndroid> delegated_frame_host_; |
335 | 336 |
336 cc::ReturnedResourceArray surface_returned_resources_; | 337 cc::ReturnedResourceArray surface_returned_resources_; |
337 | 338 |
338 // The most recent surface size that was pushed to the surface layer. | 339 // The most recent surface size that was pushed to the surface layer. |
339 gfx::Size current_surface_size_; | 340 gfx::Size current_surface_size_; |
340 | 341 |
341 // The output surface id of the last received frame. | 342 // The output surface id of the last received frame. |
342 uint32_t last_output_surface_id_; | 343 uint32_t last_compositor_frame_sink_id_; |
343 | |
344 | 344 |
345 std::queue<base::Closure> ack_callbacks_; | 345 std::queue<base::Closure> ack_callbacks_; |
346 | 346 |
347 // Used to control and render overscroll-related effects. | 347 // Used to control and render overscroll-related effects. |
348 std::unique_ptr<OverscrollControllerAndroid> overscroll_controller_; | 348 std::unique_ptr<OverscrollControllerAndroid> overscroll_controller_; |
349 | 349 |
350 // Provides gesture synthesis given a stream of touch events (derived from | 350 // Provides gesture synthesis given a stream of touch events (derived from |
351 // Android MotionEvent's) and touch event acks. | 351 // Android MotionEvent's) and touch event acks. |
352 ui::FilteredGestureProvider gesture_provider_; | 352 ui::FilteredGestureProvider gesture_provider_; |
353 | 353 |
354 // Handles gesture based text selection | 354 // Handles gesture based text selection |
355 StylusTextSelector stylus_text_selector_; | 355 StylusTextSelector stylus_text_selector_; |
356 | 356 |
357 // Manages selection handle rendering and manipulation. | 357 // Manages selection handle rendering and manipulation. |
358 // This will always be NULL if |content_view_core_| is NULL. | 358 // This will always be NULL if |content_view_core_| is NULL. |
359 std::unique_ptr<ui::TouchSelectionController> selection_controller_; | 359 std::unique_ptr<ui::TouchSelectionController> selection_controller_; |
360 | 360 |
361 // Bounds to use if we have no backing ContentViewCore | 361 // Bounds to use if we have no backing ContentViewCore |
362 gfx::Rect default_bounds_; | 362 gfx::Rect default_bounds_; |
363 | 363 |
364 const bool using_browser_compositor_; | 364 const bool using_browser_compositor_; |
365 std::unique_ptr<SynchronousCompositorHost> sync_compositor_; | 365 std::unique_ptr<SynchronousCompositorHost> sync_compositor_; |
366 | 366 |
367 std::unique_ptr<DelegatedFrameEvictor> frame_evictor_; | 367 std::unique_ptr<DelegatedFrameEvictor> frame_evictor_; |
368 | 368 |
369 size_t locks_on_frame_count_; | 369 size_t locks_on_frame_count_; |
370 bool observing_root_window_; | 370 bool observing_root_window_; |
371 | 371 |
372 struct LastFrameInfo { | 372 struct LastFrameInfo { |
373 LastFrameInfo(uint32_t output_id, cc::CompositorFrame output_frame); | 373 LastFrameInfo(uint32_t compositor_frame_sink_id, |
| 374 cc::CompositorFrame output_frame); |
374 ~LastFrameInfo(); | 375 ~LastFrameInfo(); |
375 uint32_t output_surface_id; | 376 uint32_t compositor_frame_sink_id; |
376 cc::CompositorFrame frame; | 377 cc::CompositorFrame frame; |
377 }; | 378 }; |
378 | 379 |
379 std::unique_ptr<LastFrameInfo> last_frame_info_; | 380 std::unique_ptr<LastFrameInfo> last_frame_info_; |
380 | 381 |
381 // The last scroll offset of the view. | 382 // The last scroll offset of the view. |
382 gfx::Vector2dF last_scroll_offset_; | 383 gfx::Vector2dF last_scroll_offset_; |
383 | 384 |
384 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; | 385 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; |
385 | 386 |
386 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 387 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
387 }; | 388 }; |
388 | 389 |
389 } // namespace content | 390 } // namespace content |
390 | 391 |
391 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 392 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
OLD | NEW |