diff options
author | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-08 16:46:02 +0000 |
---|---|---|
committer | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-08 16:46:02 +0000 |
commit | 19e43c508e0b6a61a24c859b80d3a2b315a4e6f7 (patch) | |
tree | 5c398d872582e5f8adb4539f5f7cbce863108531 /android_webview/browser | |
parent | b7c90dc0a432855f614f3cca5cd85f6536b1f988 (diff) | |
download | chromium_src-19e43c508e0b6a61a24c859b80d3a2b315a4e6f7.zip chromium_src-19e43c508e0b6a61a24c859b80d3a2b315a4e6f7.tar.gz chromium_src-19e43c508e0b6a61a24c859b80d3a2b315a4e6f7.tar.bz2 |
Hook up android webview synchronous compositor GL init
BUG=230197
Review URL: https://chromiumcodereview.appspot.com/16613002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205072 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/browser')
-rw-r--r-- | android_webview/browser/in_process_view_renderer.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/android_webview/browser/in_process_view_renderer.cc b/android_webview/browser/in_process_view_renderer.cc index 353d4c0..29969da 100644 --- a/android_webview/browser/in_process_view_renderer.cc +++ b/android_webview/browser/in_process_view_renderer.cc @@ -9,6 +9,7 @@ #include "android_webview/public/browser/draw_gl.h" #include "android_webview/public/browser/draw_sw.h" #include "base/android/jni_android.h" +#include "base/command_line.h" #include "base/debug/trace_event.h" #include "base/logging.h" #include "content/public/browser/android/content_view_core.h" @@ -316,8 +317,8 @@ void InProcessViewRenderer::WebContentsGone() { bool InProcessViewRenderer::PrepareDrawGL(int x, int y) { // No harm in updating |hw_rendering_scroll_| even if we return false. hw_rendering_scroll_ = gfx::Point(x, y); - return attached_to_window_ && compositor_ && compositor_->IsHwReady() && - !hardware_failed_; + return attached_to_window_ && compositor_ && !hardware_failed_ && + CommandLine::ForCurrentProcess()->HasSwitch("testing-webview-gl-mode"); } void InProcessViewRenderer::DrawGL(AwDrawGLInfo* draw_info) { @@ -334,9 +335,12 @@ void InProcessViewRenderer::DrawGL(AwDrawGLInfo* draw_info) { GLStateRestore state_restore; if (attached_to_window_ && compositor_ && !hardware_initialized_) { - // TODO(boliu): Actually initialize the compositor GL path. + hardware_failed_ = !compositor_->InitializeHwDraw(); hardware_initialized_ = true; egl_context_at_init_ = current_context; + + if (hardware_failed_) + return; } if (draw_info->mode == AwDrawGLInfo::kModeProcess) |