OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |