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

Unified Diff: android_webview/browser/shared_renderer_state.cc

Issue 255023004: Add synchronous requestDrawGL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DCHECK Created 6 years, 8 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 | « android_webview/browser/shared_renderer_state.h ('k') | android_webview/buildbot/aosp_manifest.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/shared_renderer_state.cc
diff --git a/android_webview/browser/shared_renderer_state.cc b/android_webview/browser/shared_renderer_state.cc
index 1e824382eabebb9d079a6f43cd7596c8a61e0956..ffc91ea64767093c3f448cca631ee1b775e64fa8 100644
--- a/android_webview/browser/shared_renderer_state.cc
+++ b/android_webview/browser/shared_renderer_state.cc
@@ -20,7 +20,8 @@ SharedRendererState::SharedRendererState(
: ui_loop_(ui_loop),
client_on_ui_(client),
weak_factory_on_ui_thread_(this),
- ui_thread_weak_ptr_(weak_factory_on_ui_thread_.GetWeakPtr()) {
+ ui_thread_weak_ptr_(weak_factory_on_ui_thread_.GetWeakPtr()),
+ hardware_initialized_(false) {
DCHECK(ui_loop_->BelongsToCurrentThread());
DCHECK(client_on_ui_);
}
@@ -40,7 +41,7 @@ void SharedRendererState::ClientRequestDrawGL() {
void SharedRendererState::ClientRequestDrawGLOnUIThread() {
DCHECK(ui_loop_->BelongsToCurrentThread());
- if (!client_on_ui_->RequestDrawGL(NULL)) {
+ if (!client_on_ui_->RequestDrawGL(NULL, false)) {
LOG(ERROR) << "Failed to request GL process. Deadlock likely";
}
}
@@ -68,4 +69,37 @@ DrawGLInput SharedRendererState::GetDrawGLInput() const {
return draw_gl_input_;
}
+void SharedRendererState::ClearClosureQueue() {
+ base::AutoLock lock(lock_);
+ std::queue<base::Closure> empty;
+ std::swap(closure_queue_, empty);
+}
+
+void SharedRendererState::AppendClosure(const base::Closure& closure) {
+ base::AutoLock lock(lock_);
+ closure_queue_.push(closure);
+}
+
+base::Closure SharedRendererState::PopFrontClosure() {
+ base::Closure closure;
+
+ base::AutoLock lock(lock_);
+ if (!closure_queue_.empty()) {
+ closure = closure_queue_.front();
+ closure_queue_.pop();
+ }
+
+ return closure;
+}
+
+void SharedRendererState::SetHardwareInitialized(bool initialized) {
+ base::AutoLock lock(lock_);
+ hardware_initialized_ = initialized;
+}
+
+bool SharedRendererState::IsHardwareInitialized() const {
+ base::AutoLock lock(lock_);
+ return hardware_initialized_;
+}
+
} // namespace android_webview
« no previous file with comments | « android_webview/browser/shared_renderer_state.h ('k') | android_webview/buildbot/aosp_manifest.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698