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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.h

Issue 174323003: Expose locks for CopyFromCompositingSurface/CopyFromBackingStore API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix android clang bot try 2 Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_view_android.h
diff --git a/content/browser/renderer_host/render_widget_host_view_android.h b/content/browser/renderer_host/render_widget_host_view_android.h
index 37879af679bc6c3cb7d8dd889577a61e9fb242de..58383f044d1afc4beee035e5d9dfd58825290a2d 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.h
+++ b/content/browser/renderer_host/render_widget_host_view_android.h
@@ -175,6 +175,8 @@ class RenderWidgetHostViewAndroid
const SkBitmap& zoomed_bitmap) OVERRIDE;
virtual scoped_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget()
OVERRIDE;
+ virtual void LockCompositingSurface() OVERRIDE;
+ virtual void UnlockCompositingSurface() OVERRIDE;
// Implementation of BrowserAccessibilityDelegate:
virtual void SetAccessibilityFocus(int acc_obj_id) OVERRIDE;
@@ -220,9 +222,6 @@ class RenderWidgetHostViewAndroid
void OnSetNeedsBeginFrame(bool enabled);
void OnSmartClipDataExtracted(const base::string16& result);
- void LockResources();
- void UnlockResources();
-
long GetNativeImeAdapter();
void WasResized();
@@ -297,6 +296,19 @@ class RenderWidgetHostViewAndroid
bool IsReadbackConfigSupported(SkBitmap::Config bitmap_config);
+ // If we have locks on a frame during a ContentViewCore swap or a context
+ // lost, the frame is no longer valid and we can safely release all the locks.
+ // Use this method to release all the locks.
+ void ReleaseLocksOnSurface();
+
+ // Drop any incoming frames from the renderer when there are locks on the
+ // current frame.
+ void RetainFrame(uint32 output_surface_id,
+ scoped_ptr<cc::CompositorFrame> frame);
+
+ void InternalSwapCompositorFrame(uint32 output_surface_id,
+ scoped_ptr<cc::CompositorFrame> frame);
+
// The model object.
RenderWidgetHostImpl* host_;
@@ -362,6 +374,18 @@ class RenderWidgetHostViewAndroid
bool using_delegated_renderer_;
+ size_t locks_on_frame_count_;
+
+ struct LastFrameInfo {
+ LastFrameInfo(uint32 output_id,
+ scoped_ptr<cc::CompositorFrame> output_frame);
+ ~LastFrameInfo();
+ uint32 output_surface_id;
+ scoped_ptr<cc::CompositorFrame> frame;
+ };
+
+ scoped_ptr<LastFrameInfo> last_frame_info_;
+
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid);
};

Powered by Google App Engine
This is Rietveld 408576698