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

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

Issue 2810813004: Hide fullscreen rotation jank (Closed)
Patch Set: Refactor jank logic. Make RWHVA a WebContentsObserver to observe fullscreen state 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 c5cf9d70df876c9abfbee6658f456b7abaafd833..ee69c278547a82e812a6c89740ba5f59e82be939 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.h
+++ b/content/browser/renderer_host/render_widget_host_view_android.h
@@ -29,6 +29,7 @@
#include "content/browser/renderer_host/text_input_manager.h"
#include "content/common/content_export.h"
#include "content/public/browser/readback_types.h"
+#include "content/public/browser/web_contents_observer.h"
#include "gpu/command_buffer/common/mailbox.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/android/delegated_frame_host_android.h"
@@ -70,6 +71,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid
public ui::TouchSelectionControllerClient,
public content::ContentViewCoreImplObserver,
public content::TextInputManager::Observer,
+ public content::WebContentsObserver,
Khushal 2017/06/07 05:36:01 You can not use WebContentsObserver here. renderer
steimel 2017/06/13 23:15:44 Done.
public ui::DelegatedFrameHostAndroid::Client,
public cc::BeginFrameObserver {
public:
@@ -204,6 +206,10 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid
void OnAttachedToWindow() override;
void OnDetachedFromWindow() override;
+ // content::WebContentsObserver implementation.
+ void DidToggleFullscreenModeForTab(bool entered_fullscreen,
+ bool will_cause_resize) override;
+
// viz::FrameEvictor implementation
void EvictDelegatedFrame() override;
@@ -236,6 +242,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid
// Non-virtual methods
void SetContentViewCore(ContentViewCoreImpl* content_view_core);
SkColor GetCachedBackgroundColor() const;
+ bool can_use_static_layer() const { return !fullscreen_transitioning_; }
void SendKeyEvent(const NativeWebKeyboardEvent& event);
void SendMouseEvent(const ui::MotionEventAndroid&, int action_button);
void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event);
@@ -345,6 +352,10 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid
void CreateOverscrollControllerIfPossible();
+ bool HasFullscreenTransitionJank(const cc::CompositorFrame& frame) const;
mlamouri (slow - plz ping) 2017/06/12 13:10:07 nit: that name is quite confusing as we don't know
steimel 2017/06/13 23:15:44 Refactoring replaced all three of these functions
+ void HideFullscreenTransitionJank();
mlamouri (slow - plz ping) 2017/06/12 13:10:07 nit: maybe drop "jank"?
steimel 2017/06/13 23:15:44 Same as above
+ void EndFullscreenTransition();
mlamouri (slow - plz ping) 2017/06/12 13:10:07 Can we re-use this for non-fullscreen transitions?
steimel 2017/06/13 23:15:44 The new function should be re-useable
+
// The model object.
RenderWidgetHostImpl* host_;
@@ -424,6 +435,9 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid
float prev_top_shown_pix_;
float prev_bottom_shown_pix_;
+ bool fullscreen_transitioning_ = false;
+ bool awaiting_resize_ = false;
+
cc::mojom::MojoCompositorFrameSinkClient* renderer_compositor_frame_sink_ =
nullptr;

Powered by Google App Engine
This is Rietveld 408576698