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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 InputEventAckState ack_result) override; | 142 InputEventAckState ack_result) override; |
143 InputEventAckState FilterInputEvent( | 143 InputEventAckState FilterInputEvent( |
144 const blink::WebInputEvent& input_event) override; | 144 const blink::WebInputEvent& input_event) override; |
145 void OnSetNeedsFlushInput() override; | 145 void OnSetNeedsFlushInput() override; |
146 void GestureEventAck(const blink::WebGestureEvent& event, | 146 void GestureEventAck(const blink::WebGestureEvent& event, |
147 InputEventAckState ack_result) override; | 147 InputEventAckState ack_result) override; |
148 BrowserAccessibilityManager* CreateBrowserAccessibilityManager( | 148 BrowserAccessibilityManager* CreateBrowserAccessibilityManager( |
149 BrowserAccessibilityDelegate* delegate, bool for_root_frame) override; | 149 BrowserAccessibilityDelegate* delegate, bool for_root_frame) override; |
150 bool LockMouse() override; | 150 bool LockMouse() override; |
151 void UnlockMouse() override; | 151 void UnlockMouse() override; |
152 void OnSwapCompositorFrame( | 152 void OnSwapCompositorFrame(uint32_t output_surface_id, |
153 uint32_t output_surface_id, | 153 cc::CompositorFrame frame) override; |
154 std::unique_ptr<cc::CompositorFrame> frame) override; | |
155 void ClearCompositorFrame() override; | 154 void ClearCompositorFrame() override; |
156 void DidOverscroll(const DidOverscrollParams& params) override; | 155 void DidOverscroll(const DidOverscrollParams& params) override; |
157 void DidStopFlinging() override; | 156 void DidStopFlinging() override; |
158 uint32_t GetSurfaceIdNamespace() override; | 157 uint32_t GetSurfaceIdNamespace() override; |
159 void ShowDisambiguationPopup(const gfx::Rect& rect_pixels, | 158 void ShowDisambiguationPopup(const gfx::Rect& rect_pixels, |
160 const SkBitmap& zoomed_bitmap) override; | 159 const SkBitmap& zoomed_bitmap) override; |
161 std::unique_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget() | 160 std::unique_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget() |
162 override; | 161 override; |
163 void LockCompositingSurface() override; | 162 void LockCompositingSurface() override; |
164 void UnlockCompositingSurface() override; | 163 void UnlockCompositingSurface() override; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 void SetTextSurroundingSelectionCallback( | 258 void SetTextSurroundingSelectionCallback( |
260 const TextSurroundingSelectionCallback& callback); | 259 const TextSurroundingSelectionCallback& callback); |
261 | 260 |
262 static void OnContextLost(); | 261 static void OnContextLost(); |
263 | 262 |
264 private: | 263 private: |
265 void RunAckCallbacks(cc::SurfaceDrawStatus status); | 264 void RunAckCallbacks(cc::SurfaceDrawStatus status); |
266 | 265 |
267 void DestroyDelegatedContent(); | 266 void DestroyDelegatedContent(); |
268 void CheckOutputSurfaceChanged(uint32_t output_surface_id); | 267 void CheckOutputSurfaceChanged(uint32_t output_surface_id); |
269 void SubmitCompositorFrame(std::unique_ptr<cc::CompositorFrame> frame_data); | 268 void SubmitCompositorFrame(cc::CompositorFrame frame_data); |
270 void SwapDelegatedFrame(uint32_t output_surface_id, | 269 void SwapDelegatedFrame(uint32_t output_surface_id, |
271 std::unique_ptr<cc::CompositorFrame> frame_data); | 270 cc::CompositorFrame frame_data); |
272 void SendDelegatedFrameAck(uint32_t output_surface_id); | 271 void SendDelegatedFrameAck(uint32_t output_surface_id); |
273 void SendReturnedDelegatedResources(uint32_t output_surface_id); | 272 void SendReturnedDelegatedResources(uint32_t output_surface_id); |
274 | 273 |
275 void OnFrameMetadataUpdated( | 274 void OnFrameMetadataUpdated( |
276 const cc::CompositorFrameMetadata& frame_metadata); | 275 const cc::CompositorFrameMetadata& frame_metadata); |
277 | 276 |
278 void ShowInternal(); | 277 void ShowInternal(); |
279 void HideInternal(); | 278 void HideInternal(); |
280 void AttachLayers(); | 279 void AttachLayers(); |
281 void RemoveLayers(); | 280 void RemoveLayers(); |
(...skipping 16 matching lines...) Expand all Loading... |
298 const ReadbackRequestCallback& callback, | 297 const ReadbackRequestCallback& callback, |
299 const SkColorType color_type); | 298 const SkColorType color_type); |
300 | 299 |
301 // If we have locks on a frame during a ContentViewCore swap or a context | 300 // If we have locks on a frame during a ContentViewCore swap or a context |
302 // lost, the frame is no longer valid and we can safely release all the locks. | 301 // lost, the frame is no longer valid and we can safely release all the locks. |
303 // Use this method to release all the locks. | 302 // Use this method to release all the locks. |
304 void ReleaseLocksOnSurface(); | 303 void ReleaseLocksOnSurface(); |
305 | 304 |
306 // Drop any incoming frames from the renderer when there are locks on the | 305 // Drop any incoming frames from the renderer when there are locks on the |
307 // current frame. | 306 // current frame. |
308 void RetainFrame(uint32_t output_surface_id, | 307 void RetainFrame(uint32_t output_surface_id, cc::CompositorFrame frame); |
309 std::unique_ptr<cc::CompositorFrame> frame); | |
310 | 308 |
311 void InternalSwapCompositorFrame(uint32_t output_surface_id, | 309 void InternalSwapCompositorFrame(uint32_t output_surface_id, |
312 std::unique_ptr<cc::CompositorFrame> frame); | 310 cc::CompositorFrame frame); |
313 void OnLostResources(); | 311 void OnLostResources(); |
314 | 312 |
315 enum VSyncRequestType { | 313 enum VSyncRequestType { |
316 FLUSH_INPUT = 1 << 0, | 314 FLUSH_INPUT = 1 << 0, |
317 BEGIN_FRAME = 1 << 1, | 315 BEGIN_FRAME = 1 << 1, |
318 PERSISTENT_BEGIN_FRAME = 1 << 2 | 316 PERSISTENT_BEGIN_FRAME = 1 << 2 |
319 }; | 317 }; |
320 void RequestVSyncUpdate(uint32_t requests); | 318 void RequestVSyncUpdate(uint32_t requests); |
321 void StartObservingRootWindow(); | 319 void StartObservingRootWindow(); |
322 void StopObservingRootWindow(); | 320 void StopObservingRootWindow(); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 | 384 |
387 const bool using_browser_compositor_; | 385 const bool using_browser_compositor_; |
388 std::unique_ptr<SynchronousCompositorHost> sync_compositor_; | 386 std::unique_ptr<SynchronousCompositorHost> sync_compositor_; |
389 | 387 |
390 std::unique_ptr<DelegatedFrameEvictor> frame_evictor_; | 388 std::unique_ptr<DelegatedFrameEvictor> frame_evictor_; |
391 | 389 |
392 size_t locks_on_frame_count_; | 390 size_t locks_on_frame_count_; |
393 bool observing_root_window_; | 391 bool observing_root_window_; |
394 | 392 |
395 struct LastFrameInfo { | 393 struct LastFrameInfo { |
396 LastFrameInfo(uint32_t output_id, | 394 LastFrameInfo(uint32_t output_id, cc::CompositorFrame output_frame); |
397 std::unique_ptr<cc::CompositorFrame> output_frame); | |
398 ~LastFrameInfo(); | 395 ~LastFrameInfo(); |
399 uint32_t output_surface_id; | 396 uint32_t output_surface_id; |
400 std::unique_ptr<cc::CompositorFrame> frame; | 397 cc::CompositorFrame frame; |
401 }; | 398 }; |
402 | 399 |
403 std::unique_ptr<LastFrameInfo> last_frame_info_; | 400 std::unique_ptr<LastFrameInfo> last_frame_info_; |
404 | 401 |
405 TextSurroundingSelectionCallback text_surrounding_selection_callback_; | 402 TextSurroundingSelectionCallback text_surrounding_selection_callback_; |
406 | 403 |
407 // The last scroll offset of the view. | 404 // The last scroll offset of the view. |
408 gfx::Vector2dF last_scroll_offset_; | 405 gfx::Vector2dF last_scroll_offset_; |
409 | 406 |
410 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; | 407 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; |
411 | 408 |
412 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 409 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
413 }; | 410 }; |
414 | 411 |
415 } // namespace content | 412 } // namespace content |
416 | 413 |
417 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 414 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
OLD | NEW |