diff options
author | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-18 08:40:50 +0000 |
---|---|---|
committer | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-18 08:40:50 +0000 |
commit | a27fd608c58f889a91dafd5837808dc4752f5c78 (patch) | |
tree | 24f09af131b741bb6c0877de1437ff61bb01ab3c /android_webview | |
parent | 81e8334cbf20d94a76c4bf2b4b2836d3b9d806c9 (diff) | |
download | chromium_src-a27fd608c58f889a91dafd5837808dc4752f5c78.zip chromium_src-a27fd608c58f889a91dafd5837808dc4752f5c78.tar.gz chromium_src-a27fd608c58f889a91dafd5837808dc4752f5c78.tar.bz2 |
[Android WebView] Cancel fallback tick when not needed
DrawGL can be called without OnDraw, so if FallbackTickFired can be
called if DrawGL sets continuous_invalidate_ to false.
Add a DCHECK that FallbackTickFired does not run unnecessarily.
BUG=
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/19567003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212290 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview')
-rw-r--r-- | android_webview/browser/in_process_view_renderer.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/android_webview/browser/in_process_view_renderer.cc b/android_webview/browser/in_process_view_renderer.cc index 55b3aa6..4a78b56 100644 --- a/android_webview/browser/in_process_view_renderer.cc +++ b/android_webview/browser/in_process_view_renderer.cc @@ -239,6 +239,10 @@ void InProcessViewRenderer::DrawGL(AwDrawGLInfo* draw_info) { if (draw_info->mode == AwDrawGLInfo::kModeProcess) return; + // DrawGL may be called without OnDraw, so cancel |fallback_tick_| here as + // well just to be safe. + fallback_tick_.Cancel(); + if (last_egl_context_ != current_context) { // TODO(boliu): Handle context lost TRACE_EVENT_INSTANT0( @@ -252,7 +256,6 @@ void InProcessViewRenderer::DrawGL(AwDrawGLInfo* draw_info) { return; } - gfx::Transform transform; transform.matrix().setColMajorf(draw_info->transform); transform.Translate(scroll_at_start_of_frame_.x(), @@ -605,6 +608,10 @@ void InProcessViewRenderer::FallbackTickFired() { "InProcessViewRenderer::FallbackTickFired", "continuous_invalidate_", continuous_invalidate_); + + // This should only be called if OnDraw or DrawGL did not come in time, which + // means block_invalidates_ must still be true. + DCHECK(block_invalidates_); if (continuous_invalidate_ && compositor_) { SkDevice device(SkBitmap::kARGB_8888_Config, 1, 1); SkCanvas canvas(&device); |