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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.h

Issue 2658293002: content: Remove Lock/Unlock CompositingSurface API from RWH. (Closed)
Patch Set: last_frame_info Created 3 years, 10 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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 void ClearCompositorFrame() override; 139 void ClearCompositorFrame() override;
140 void SetIsInVR(bool is_in_vr) override; 140 void SetIsInVR(bool is_in_vr) override;
141 bool IsInVR() const override; 141 bool IsInVR() const override;
142 void DidOverscroll(const ui::DidOverscrollParams& params) override; 142 void DidOverscroll(const ui::DidOverscrollParams& params) override;
143 void DidStopFlinging() override; 143 void DidStopFlinging() override;
144 cc::FrameSinkId GetFrameSinkId() override; 144 cc::FrameSinkId GetFrameSinkId() override;
145 void ShowDisambiguationPopup(const gfx::Rect& rect_pixels, 145 void ShowDisambiguationPopup(const gfx::Rect& rect_pixels,
146 const SkBitmap& zoomed_bitmap) override; 146 const SkBitmap& zoomed_bitmap) override;
147 std::unique_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget() 147 std::unique_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget()
148 override; 148 override;
149 void LockCompositingSurface() override;
150 void UnlockCompositingSurface() override;
151 void OnDidNavigateMainFrameToNewPage() override; 149 void OnDidNavigateMainFrameToNewPage() override;
152 void SetNeedsBeginFrames(bool needs_begin_frames) override; 150 void SetNeedsBeginFrames(bool needs_begin_frames) override;
153 151
154 // ui::GestureProviderClient implementation. 152 // ui::GestureProviderClient implementation.
155 void OnGestureEvent(const ui::GestureEventData& gesture) override; 153 void OnGestureEvent(const ui::GestureEventData& gesture) override;
156 154
157 // ui::WindowAndroidObserver implementation. 155 // ui::WindowAndroidObserver implementation.
158 void OnCompositingDidCommit() override {} 156 void OnCompositingDidCommit() override {}
159 void OnRootWindowVisibilityChanged(bool visible) override; 157 void OnRootWindowVisibilityChanged(bool visible) override;
160 void OnAttachCompositor() override; 158 void OnAttachCompositor() override;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 void RemoveLayers(); 270 void RemoveLayers();
273 271
274 void UpdateBackgroundColor(SkColor color); 272 void UpdateBackgroundColor(SkColor color);
275 273
276 // DevTools ScreenCast support for Android WebView. 274 // DevTools ScreenCast support for Android WebView.
277 void SynchronousCopyContents(const gfx::Rect& src_subrect_in_pixel, 275 void SynchronousCopyContents(const gfx::Rect& src_subrect_in_pixel,
278 const gfx::Size& dst_size_in_pixel, 276 const gfx::Size& dst_size_in_pixel,
279 const ReadbackRequestCallback& callback, 277 const ReadbackRequestCallback& callback,
280 const SkColorType color_type); 278 const SkColorType color_type);
281 279
282 // If we have locks on a frame during a ContentViewCore swap or a context
283 // lost, the frame is no longer valid and we can safely release all the locks.
284 // Use this method to release all the locks.
285 void ReleaseLocksOnSurface();
286
287 // Drop any incoming frames from the renderer when there are locks on the 280 // Drop any incoming frames from the renderer when there are locks on the
288 // current frame. 281 // current frame.
289 void RetainFrame(uint32_t compositor_frame_sink_id, 282 void RetainFrame(uint32_t compositor_frame_sink_id,
290 cc::CompositorFrame frame); 283 cc::CompositorFrame frame);
291 284
292 void InternalSwapCompositorFrame(uint32_t compositor_frame_sink_id, 285 void InternalSwapCompositorFrame(uint32_t compositor_frame_sink_id,
293 cc::CompositorFrame frame); 286 cc::CompositorFrame frame);
294 void DestroyDelegatedContent(); 287 void DestroyDelegatedContent();
295 void OnLostResources(); 288 void OnLostResources();
296 289
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 // Bounds to use if we have no backing ContentViewCore 367 // Bounds to use if we have no backing ContentViewCore
375 gfx::Rect default_bounds_; 368 gfx::Rect default_bounds_;
376 369
377 const bool using_browser_compositor_; 370 const bool using_browser_compositor_;
378 std::unique_ptr<SynchronousCompositorHost> sync_compositor_; 371 std::unique_ptr<SynchronousCompositorHost> sync_compositor_;
379 372
380 SynchronousCompositorClient* synchronous_compositor_client_; 373 SynchronousCompositorClient* synchronous_compositor_client_;
381 374
382 std::unique_ptr<DelegatedFrameEvictor> frame_evictor_; 375 std::unique_ptr<DelegatedFrameEvictor> frame_evictor_;
383 376
384 size_t locks_on_frame_count_;
385 bool observing_root_window_; 377 bool observing_root_window_;
386 378
387 struct LastFrameInfo {
388 LastFrameInfo(uint32_t compositor_frame_sink_id,
389 cc::CompositorFrame output_frame);
390 ~LastFrameInfo();
391 uint32_t compositor_frame_sink_id;
392 cc::CompositorFrame frame;
393 };
394
395 std::unique_ptr<LastFrameInfo> last_frame_info_;
396
397 // The last scroll offset of the view. 379 // The last scroll offset of the view.
398 gfx::Vector2dF last_scroll_offset_; 380 gfx::Vector2dF last_scroll_offset_;
399 381
400 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; 382 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_;
401 383
402 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); 384 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid);
403 }; 385 };
404 386
405 } // namespace content 387 } // namespace content
406 388
407 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 389 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698