From 673cf0160d7b5e520841a65f4425f8be1a48fbb1 Mon Sep 17 00:00:00 2001 From: hush Date: Wed, 24 Sep 2014 17:20:01 -0700 Subject: Android WebView: fix missing an invalidate When webview translates into the screen from offscreen by calling WebView#SetTranslateX/Y, onDrawHardware is called with an empty global visible rect. When the webview is still offscreen, Android frameworks won't call DrawGL on WebView, which means the "parent draw constraints" stored in hardware renderer won't contain the draw constraints when the webview is offscreen. When webview gets an ondraw with an empty global visible rect, we need to make sure the parent draw constraints of the corresponding DrawGL is always posted back to child compositor and triggers an invalidate. BUG=417479 Review URL: https://codereview.chromium.org/603633003 Cr-Commit-Position: refs/heads/master@{#296589} --- android_webview/browser/shared_renderer_state.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'android_webview/browser/shared_renderer_state.h') diff --git a/android_webview/browser/shared_renderer_state.h b/android_webview/browser/shared_renderer_state.h index 7e79332a..2074049 100644 --- a/android_webview/browser/shared_renderer_state.h +++ b/android_webview/browser/shared_renderer_state.h @@ -58,13 +58,18 @@ class SharedRendererState { scoped_ptr PassDrawGLInput(); bool IsInsideHardwareRelease() const; - void UpdateDrawConstraints( + // Returns true if the draw constraints are updated. + bool UpdateDrawConstraints( const ParentCompositorDrawConstraints& parent_draw_constraints); void PostExternalDrawConstraintsToChildCompositor( const ParentCompositorDrawConstraints& parent_draw_constraints); const ParentCompositorDrawConstraints ParentDrawConstraints() const; + void SetForceInvalidateOnNextDrawGL( + bool needs_force_invalidate_on_next_draw_gl); + bool NeedsForceInvalidateOnNextDrawGL() const; + void InsertReturnedResources(const cc::ReturnedResourceArray& resources); void SwapReturnedResources(cc::ReturnedResourceArray* resources); bool ReturnedResourcesEmpty() const; @@ -87,6 +92,7 @@ class SharedRendererState { mutable base::Lock lock_; scoped_ptr draw_gl_input_; bool inside_hardware_release_; + bool needs_force_invalidate_on_next_draw_gl_; ParentCompositorDrawConstraints parent_draw_constraints_; cc::ReturnedResourceArray returned_resources_; base::Closure request_draw_gl_closure_; -- cgit v1.1