diff options
author | Bo Liu <boliu@google.com> | 2014-10-16 16:06:23 -0700 |
---|---|---|
committer | Bo Liu <boliu@google.com> | 2014-10-17 12:33:44 -0700 |
commit | a58a97cfa653525933d0240146369842c959d014 (patch) | |
tree | 7e617225726050530944d9bd779cc6ced06fb6e0 | |
parent | 28b8b2c8a91ea1b119027795dbd2fe666f1bb9ad (diff) | |
download | chromium_org-a58a97cfa653525933d0240146369842c959d014.tar.gz |
Fork: Invalidate when obtaining valid draw constraints
The problem is NeedsForceInvalidateOnNextDrawGL doesn't really work
because a pending invalid might have already happened and got skipped.
BUG: 18009042
Change-Id: I9897f5ececa6d4509e7aceabd5bcbc4ce05f665e
-rw-r--r-- | android_webview/browser/browser_view_renderer.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/android_webview/browser/browser_view_renderer.cc b/android_webview/browser/browser_view_renderer.cc index 4ebd5e9948..e6500940ed 100644 --- a/android_webview/browser/browser_view_renderer.cc +++ b/android_webview/browser/browser_view_renderer.cc @@ -240,7 +240,8 @@ bool BrowserViewRenderer::OnDrawHardware(jobject java_canvas) { if (!compositor_) return false; - if (last_on_draw_global_visible_rect_.IsEmpty()) { + if (last_on_draw_global_visible_rect_.IsEmpty() && + !parent_draw_constraints_.surface_rect.IsEmpty()) { shared_renderer_state_->SetForceInvalidateOnNextDrawGL(true); return client_->RequestDrawGL(java_canvas, false); } @@ -278,10 +279,12 @@ bool BrowserViewRenderer::OnDrawHardware(jobject java_canvas) { // applied onto the layer so global visible rect does not make sense here. // In this case, just use the surface rect for tiling. gfx::Rect viewport_rect_for_tile_priority; - if (parent_draw_constraints_.is_layer) + if (parent_draw_constraints_.is_layer || + last_on_draw_global_visible_rect_.IsEmpty()) { viewport_rect_for_tile_priority = parent_draw_constraints_.surface_rect; - else + } else { viewport_rect_for_tile_priority = last_on_draw_global_visible_rect_; + } scoped_ptr<cc::CompositorFrame> frame = compositor_->DemandDrawHw(surface_size, @@ -309,6 +312,7 @@ void BrowserViewRenderer::UpdateParentDrawConstraints() { !parent_draw_constraints_.Equals( shared_renderer_state_->ParentDrawConstraints())) { shared_renderer_state_->SetForceInvalidateOnNextDrawGL(false); + client_->PostInvalidate(); EnsureContinuousInvalidation(true); } } @@ -733,6 +737,7 @@ void BrowserViewRenderer::FallbackTickFired() { DCHECK(block_invalidates_); if (compositor_needs_continuous_invalidate_ && compositor_) { ForceFakeCompositeSW(); + client_->PostInvalidate(); } else { // Pretend we just composited to unblock further invalidates. DidComposite(); |