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

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

Issue 2810813004: Hide fullscreen rotation jank (Closed)
Patch Set: Clear thumbnail cache instead of hiding static layer. Break out results of changing fullscreen stat… Created 3 years, 6 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 6846edce443679b5027edc4a970db758f0052c54..4faf5180a21cdc0956c31323442b89028912063c 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.h
+++ b/content/browser/renderer_host/render_widget_host_view_android.h
@@ -161,6 +161,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid
std::unique_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget()
override;
void OnDidNavigateMainFrameToNewPage() override;
+ void OnFullscreenStateChanged(bool entered_fullscreen) override;
void SetNeedsBeginFrames(bool needs_begin_frames) override;
cc::FrameSinkId GetFrameSinkId() override;
cc::FrameSinkId FrameSinkIdAtPoint(cc::SurfaceHittestDelegate* delegate,
@@ -238,6 +239,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid
// Non-virtual methods
void SetContentViewCore(ContentViewCoreImpl* content_view_core);
SkColor GetCachedBackgroundColor() const;
+ void ClearThumbnailPlaceholder();
void SendKeyEvent(const NativeWebKeyboardEvent& event);
void SendMouseEvent(const ui::MotionEventAndroid&, int action_button);
void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event);
@@ -304,6 +306,14 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid
cc::SurfaceId SurfaceIdForTesting() const override;
private:
+ enum class FullscreenState {
+ kNotFullscreen,
+ kEnteringFullscreen,
+ kFullscreen,
+ kExitingFullscreen,
+ kFullscreenRotation,
+ };
+
void RunAckCallbacks();
void SendReclaimCompositorResources(bool is_swap_ack);
@@ -349,6 +359,10 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid
WebContentsAccessibilityAndroid* GetWebContentsAccessibilityAndroid() const;
+ void UpdateFullscreenStateAndEvictFrameIfNeeded();
+ void UpdateFullscreenState();
+ bool IsInFullscreenTransition() const;
+
// The model object.
RenderWidgetHostImpl* host_;
@@ -428,6 +442,21 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid
float prev_top_shown_pix_;
float prev_bottom_shown_pix_;
+ FullscreenState fullscreen_state_ = FullscreenState::kNotFullscreen;
+
+ // While we could simply take a mismatch in fullscreen states as the trigger
+ // for a transition, and assume the transition to have finished once the
+ // fullscreen states and sizes match, we have cases where we reach this
+ // consistent state before the physical backing size changes. Therefore we
+ // defer assuming the transition to be completed until a resize event is
+ // received, which is marked by |fullscreen_transition_awaiting_resize_|.
+ //
+ // Note that this assumes that every transition will be followed by a change
+ // in the view's physical backing size.
+ bool fullscreen_transition_awaiting_resize_ = false;
aelias_OOO_until_Jul13 2017/06/22 02:52:06 Ping again when you make progress on removing this
steimel 2017/06/29 00:38:51 According to Khushal, the discussion on crbug.com/
aelias_OOO_until_Jul13 2017/06/29 01:05:18 The initial concerns expressed by me and Bo didn't
+ bool current_frame_is_fullscreen_ = false;
+ bool web_contents_is_fullscreen_ = false;
+
cc::mojom::MojoCompositorFrameSinkClient* renderer_compositor_frame_sink_ =
nullptr;

Powered by Google App Engine
This is Rietveld 408576698