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

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

Issue 388633003: aw: Add command switch to disable hardware acceleration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rewrite, force-auxiliary-bitmap Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | android_webview/common/aw_switches.h » ('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/public/browser/draw_gl.h" 10 #include "android_webview/public/browser/draw_gl.h"
10 #include "base/android/jni_android.h" 11 #include "base/android/jni_android.h"
11 #include "base/auto_reset.h" 12 #include "base/auto_reset.h"
12 #include "base/command_line.h" 13 #include "base/command_line.h"
13 #include "base/debug/trace_event.h" 14 #include "base/debug/trace_event.h"
14 #include "base/json/json_writer.h" 15 #include "base/json/json_writer.h"
15 #include "base/logging.h" 16 #include "base/logging.h"
16 #include "base/strings/string_number_conversions.h" 17 #include "base/strings/string_number_conversions.h"
17 #include "base/strings/stringprintf.h" 18 #include "base/strings/stringprintf.h"
18 #include "cc/output/compositor_frame.h" 19 #include "cc/output/compositor_frame.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 bool is_hardware_canvas, 218 bool is_hardware_canvas,
218 const gfx::Vector2d& scroll, 219 const gfx::Vector2d& scroll,
219 const gfx::Rect& global_visible_rect, 220 const gfx::Rect& global_visible_rect,
220 const gfx::Rect& clip) { 221 const gfx::Rect& clip) {
221 last_on_draw_scroll_offset_ = scroll; 222 last_on_draw_scroll_offset_ = scroll;
222 last_on_draw_global_visible_rect_ = global_visible_rect; 223 last_on_draw_global_visible_rect_ = global_visible_rect;
223 224
224 if (clear_view_) 225 if (clear_view_)
225 return false; 226 return false;
226 227
227 if (is_hardware_canvas && attached_to_window_) 228 if (is_hardware_canvas && attached_to_window_ &&
229 !switches::ForceAuxiliaryBitmap()) {
228 return OnDrawHardware(java_canvas); 230 return OnDrawHardware(java_canvas);
231 }
232
229 // Perform a software draw 233 // Perform a software draw
230 return DrawSWInternal(java_canvas, clip); 234 return DrawSWInternal(java_canvas, clip);
231 } 235 }
232 236
233 bool BrowserViewRenderer::OnDrawHardware(jobject java_canvas) { 237 bool BrowserViewRenderer::OnDrawHardware(jobject java_canvas) {
234 if (!compositor_) 238 if (!compositor_)
235 return false; 239 return false;
236 240
237 if (!hardware_enabled_) { 241 if (!hardware_enabled_) {
238 hardware_enabled_ = compositor_->InitializeHwDraw(); 242 hardware_enabled_ = compositor_->InitializeHwDraw();
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 base::StringAppendF(&str, 757 base::StringAppendF(&str,
754 "surface width height: [%d %d] ", 758 "surface width height: [%d %d] ",
755 draw_info->width, 759 draw_info->width,
756 draw_info->height); 760 draw_info->height);
757 base::StringAppendF(&str, "is_layer: %d ", draw_info->is_layer); 761 base::StringAppendF(&str, "is_layer: %d ", draw_info->is_layer);
758 } 762 }
759 return str; 763 return str;
760 } 764 }
761 765
762 } // namespace android_webview 766 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | android_webview/common/aw_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698