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

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

Issue 551023002: aw: Skip hardware onDraw when visible rect is empty (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unrelated change Created 6 years, 3 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
« no previous file with comments | « no previous file | android_webview/browser/hardware_renderer.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 "android_webview/browser/shared_renderer_state.h" 8 #include "android_webview/browser/shared_renderer_state.h"
9 #include "android_webview/common/aw_switches.h" 9 #include "android_webview/common/aw_switches.h"
10 #include "android_webview/public/browser/draw_gl.h" 10 #include "android_webview/public/browser/draw_gl.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 } 257 }
258 258
259 // Perform a software draw 259 // Perform a software draw
260 return OnDrawSoftware(java_canvas); 260 return OnDrawSoftware(java_canvas);
261 } 261 }
262 262
263 bool BrowserViewRenderer::OnDrawHardware(jobject java_canvas) { 263 bool BrowserViewRenderer::OnDrawHardware(jobject java_canvas) {
264 if (!compositor_) 264 if (!compositor_)
265 return false; 265 return false;
266 266
267 if (last_on_draw_global_visible_rect_.IsEmpty())
268 return client_->RequestDrawGL(java_canvas, false);
269
267 if (!hardware_enabled_) { 270 if (!hardware_enabled_) {
268 hardware_enabled_ = compositor_->InitializeHwDraw(); 271 hardware_enabled_ = compositor_->InitializeHwDraw();
269 if (hardware_enabled_) { 272 if (hardware_enabled_) {
270 tile_manager_key_ = GlobalTileManager::GetInstance()->PushBack(this); 273 tile_manager_key_ = GlobalTileManager::GetInstance()->PushBack(this);
271 gpu::GLInProcessContext* share_context = compositor_->GetShareContext(); 274 gpu::GLInProcessContext* share_context = compositor_->GetShareContext();
272 DCHECK(share_context); 275 DCHECK(share_context);
273 shared_renderer_state_->SetSharedContext(share_context); 276 shared_renderer_state_->SetSharedContext(share_context);
274 } 277 }
275 } 278 }
276 if (!hardware_enabled_) 279 if (!hardware_enabled_)
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 base::StringAppendF(&str, 818 base::StringAppendF(&str,
816 "surface width height: [%d %d] ", 819 "surface width height: [%d %d] ",
817 draw_info->width, 820 draw_info->width,
818 draw_info->height); 821 draw_info->height);
819 base::StringAppendF(&str, "is_layer: %d ", draw_info->is_layer); 822 base::StringAppendF(&str, "is_layer: %d ", draw_info->is_layer);
820 } 823 }
821 return str; 824 return str;
822 } 825 }
823 826
824 } // namespace android_webview 827 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/hardware_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698