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

Side by Side Diff: android_webview/browser/browser_view_renderer.cc

Issue 1002013003: Unit Test for WebView animating in and out of screen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "android_webview/browser/browser_view_renderer.h" 5 #include "android_webview/browser/browser_view_renderer.h"
6 6
7 #include "android_webview/browser/browser_view_renderer_client.h" 7 #include "android_webview/browser/browser_view_renderer_client.h"
8 #include "base/auto_reset.h" 8 #include "base/auto_reset.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 if (!hardware_enabled_) { 209 if (!hardware_enabled_) {
210 TRACE_EVENT0("android_webview", "InitializeHwDraw"); 210 TRACE_EVENT0("android_webview", "InitializeHwDraw");
211 hardware_enabled_ = compositor_->InitializeHwDraw(); 211 hardware_enabled_ = compositor_->InitializeHwDraw();
212 } 212 }
213 if (!hardware_enabled_) { 213 if (!hardware_enabled_) {
214 TRACE_EVENT_INSTANT0("android_webview", "EarlyOut_HardwareNotEnabled", 214 TRACE_EVENT_INSTANT0("android_webview", "EarlyOut_HardwareNotEnabled",
215 TRACE_EVENT_SCOPE_THREAD); 215 TRACE_EVENT_SCOPE_THREAD);
216 return false; 216 return false;
217 } 217 }
218 218
219 if (last_on_draw_global_visible_rect_.IsEmpty()) {
220 // WebView could be offscreen. Need to make sure WebView invalidates when
221 // it is animated into the screen again.
222 shared_renderer_state_.SetForceInvalidateOnNextDrawGLOnUI(true);
223 }
224
219 ReturnResourceFromParent(); 225 ReturnResourceFromParent();
220 if (shared_renderer_state_.HasCompositorFrameOnUI()) { 226 if (shared_renderer_state_.HasCompositorFrameOnUI()) {
221 TRACE_EVENT_INSTANT0("android_webview", 227 TRACE_EVENT_INSTANT0("android_webview",
222 "EarlyOut_PreviousFrameUnconsumed", 228 "EarlyOut_PreviousFrameUnconsumed",
223 TRACE_EVENT_SCOPE_THREAD); 229 TRACE_EVENT_SCOPE_THREAD);
224 DidSkipCompositeInDraw(); 230 DidSkipCompositeInDraw();
225 return true; 231 return true;
226 } 232 }
227 233
228 scoped_ptr<cc::CompositorFrame> frame = CompositeHw(); 234 scoped_ptr<cc::CompositorFrame> frame = CompositeHw();
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 base::StringAppendF(&str, 790 base::StringAppendF(&str,
785 "overscroll_rounding_error_: %s ", 791 "overscroll_rounding_error_: %s ",
786 overscroll_rounding_error_.ToString().c_str()); 792 overscroll_rounding_error_.ToString().c_str());
787 base::StringAppendF( 793 base::StringAppendF(
788 &str, "on_new_picture_enable: %d ", on_new_picture_enable_); 794 &str, "on_new_picture_enable: %d ", on_new_picture_enable_);
789 base::StringAppendF(&str, "clear_view: %d ", clear_view_); 795 base::StringAppendF(&str, "clear_view: %d ", clear_view_);
790 return str; 796 return str;
791 } 797 }
792 798
793 } // namespace android_webview 799 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698