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

Unified Diff: android_webview/browser/in_process_view_renderer.cc

Issue 16613002: Hook up android webview synchronous compositor GL init (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: why is gcc so tolerant of errors?! Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/android/in_process/synchronous_compositor_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/in_process_view_renderer.cc
diff --git a/android_webview/browser/in_process_view_renderer.cc b/android_webview/browser/in_process_view_renderer.cc
index 353d4c0231aa9bd6ee37cf1af69c319eedafd964..29969da207a9bdb61de798eda1fb020e09604957 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)
« no previous file with comments | « no previous file | content/browser/android/in_process/synchronous_compositor_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698