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

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

Issue 778643003: aw: Add more trace events to drawing functions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | android_webview/browser/deferred_gpu_command_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/debug/trace_event_argument.h" 10 #include "base/debug/trace_event_argument.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 void BrowserViewRenderer::PrepareToDraw(const gfx::Vector2d& scroll, 138 void BrowserViewRenderer::PrepareToDraw(const gfx::Vector2d& scroll,
139 const gfx::Rect& global_visible_rect) { 139 const gfx::Rect& global_visible_rect) {
140 last_on_draw_scroll_offset_ = scroll; 140 last_on_draw_scroll_offset_ = scroll;
141 last_on_draw_global_visible_rect_ = global_visible_rect; 141 last_on_draw_global_visible_rect_ = global_visible_rect;
142 } 142 }
143 143
144 bool BrowserViewRenderer::OnDrawHardware() { 144 bool BrowserViewRenderer::OnDrawHardware() {
145 TRACE_EVENT0("android_webview", "BrowserViewRenderer::OnDrawHardware"); 145 TRACE_EVENT0("android_webview", "BrowserViewRenderer::OnDrawHardware");
146 shared_renderer_state_.InitializeHardwareDrawIfNeededOnUI(); 146 shared_renderer_state_.InitializeHardwareDrawIfNeededOnUI();
147 if (!compositor_) 147 if (!compositor_) {
148 TRACE_EVENT_INSTANT0("android_webview", "EarlyOut_NoCompositor",
149 TRACE_EVENT_SCOPE_THREAD);
148 return false; 150 return false;
151 }
149 152
150 shared_renderer_state_.SetScrollOffsetOnUI(last_on_draw_scroll_offset_); 153 shared_renderer_state_.SetScrollOffsetOnUI(last_on_draw_scroll_offset_);
151 154
152 if (!hardware_enabled_) { 155 if (!hardware_enabled_) {
156 TRACE_EVENT0("android_webview", "InitializeHwDraw");
153 hardware_enabled_ = compositor_->InitializeHwDraw(); 157 hardware_enabled_ = compositor_->InitializeHwDraw();
154 } 158 }
155 if (!hardware_enabled_) 159 if (!hardware_enabled_) {
160 TRACE_EVENT_INSTANT0("android_webview", "EarlyOut_HardwareNotEnabled",
161 TRACE_EVENT_SCOPE_THREAD);
156 return false; 162 return false;
163 }
157 164
158 if (last_on_draw_global_visible_rect_.IsEmpty() && 165 if (last_on_draw_global_visible_rect_.IsEmpty() &&
159 parent_draw_constraints_.surface_rect.IsEmpty()) { 166 parent_draw_constraints_.surface_rect.IsEmpty()) {
160 TRACE_EVENT_INSTANT0("android_webview", 167 TRACE_EVENT_INSTANT0("android_webview",
161 "EarlyOut_EmptyVisibleRect", 168 "EarlyOut_EmptyVisibleRect",
162 TRACE_EVENT_SCOPE_THREAD); 169 TRACE_EVENT_SCOPE_THREAD);
163 shared_renderer_state_.SetForceInvalidateOnNextDrawGLOnUI(true); 170 shared_renderer_state_.SetForceInvalidateOnNextDrawGLOnUI(true);
164 return true; 171 return true;
165 } 172 }
166 173
167 ReturnResourceFromParent(); 174 ReturnResourceFromParent();
168 if (shared_renderer_state_.HasCompositorFrameOnUI()) { 175 if (shared_renderer_state_.HasCompositorFrameOnUI()) {
169 TRACE_EVENT_INSTANT0("android_webview", 176 TRACE_EVENT_INSTANT0("android_webview",
170 "EarlyOut_PreviousFrameUnconsumed", 177 "EarlyOut_PreviousFrameUnconsumed",
171 TRACE_EVENT_SCOPE_THREAD); 178 TRACE_EVENT_SCOPE_THREAD);
172 DidSkipCompositeInDraw(); 179 DidSkipCompositeInDraw();
173 return true; 180 return true;
174 } 181 }
175 182
176 scoped_ptr<cc::CompositorFrame> frame = CompositeHw(); 183 scoped_ptr<cc::CompositorFrame> frame = CompositeHw();
177 if (!frame.get()) 184 if (!frame.get()) {
185 TRACE_EVENT_INSTANT0("android_webview", "NoNewFrame",
186 TRACE_EVENT_SCOPE_THREAD);
178 return false; 187 return false;
188 }
179 189
180 shared_renderer_state_.SetCompositorFrameOnUI(frame.Pass(), false); 190 shared_renderer_state_.SetCompositorFrameOnUI(frame.Pass(), false);
181 return true; 191 return true;
182 } 192 }
183 193
184 scoped_ptr<cc::CompositorFrame> BrowserViewRenderer::CompositeHw() { 194 scoped_ptr<cc::CompositorFrame> BrowserViewRenderer::CompositeHw() {
185 compositor_->SetMemoryPolicy(CalculateDesiredMemoryPolicy()); 195 compositor_->SetMemoryPolicy(CalculateDesiredMemoryPolicy());
186 196
187 parent_draw_constraints_ = 197 parent_draw_constraints_ =
188 shared_renderer_state_.GetParentDrawConstraintsOnUI(); 198 shared_renderer_state_.GetParentDrawConstraintsOnUI();
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 base::StringAppendF(&str, 732 base::StringAppendF(&str,
723 "overscroll_rounding_error_: %s ", 733 "overscroll_rounding_error_: %s ",
724 overscroll_rounding_error_.ToString().c_str()); 734 overscroll_rounding_error_.ToString().c_str());
725 base::StringAppendF( 735 base::StringAppendF(
726 &str, "on_new_picture_enable: %d ", on_new_picture_enable_); 736 &str, "on_new_picture_enable: %d ", on_new_picture_enable_);
727 base::StringAppendF(&str, "clear_view: %d ", clear_view_); 737 base::StringAppendF(&str, "clear_view: %d ", clear_view_);
728 return str; 738 return str;
729 } 739 }
730 740
731 } // namespace android_webview 741 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/deferred_gpu_command_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698