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

Unified Diff: android_webview/browser/shared_renderer_state.cc

Issue 394113002: Tiling priorities in Android Webview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
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 8845b761cd252c16592d4480003288e53b07de09..c293c4784584c0e3a8db70bcec62008fd9435504 100644
--- a/android_webview/browser/shared_renderer_state.cc
+++ b/android_webview/browser/shared_renderer_state.cc
@@ -7,6 +7,8 @@
#include "android_webview/browser/browser_view_renderer_client.h"
#include "base/bind.h"
#include "base/location.h"
+#include "cc/output/compositor_frame.h"
+#include "content/public/browser/android/synchronous_compositor.h"
namespace android_webview {
@@ -51,6 +53,22 @@ void SharedRendererState::ClientRequestDrawGLOnUIThread() {
}
}
+void SharedRendererState::ClientPostInvalidate() {
+ if (ui_loop_->BelongsToCurrentThread()) {
+ ClientPostInvalidateOnUIThread();
+ } else {
+ ui_loop_->PostTask(
+ FROM_HERE,
+ base::Bind(&SharedRendererState::ClientPostInvalidateOnUIThread,
+ ui_thread_weak_ptr_));
+ }
+}
+
+void SharedRendererState::ClientPostInvalidateOnUIThread() {
+ DCHECK(ui_loop_->BelongsToCurrentThread());
+ client_on_ui_->PostInvalidate();
+}
+
void SharedRendererState::SetDrawGLInput(scoped_ptr<DrawGLInput> input) {
base::AutoLock lock(lock_);
DCHECK(!draw_gl_input_.get());
@@ -62,6 +80,20 @@ scoped_ptr<DrawGLInput> SharedRendererState::PassDrawGLInput() {
return draw_gl_input_.Pass();
}
+void SharedRendererState::PostExternalDrawConstraintsToChildCompositor(
+ const ParentCompositorDrawConstraints& parent_draw_constraints) {
+ base::AutoLock lock(lock_);
+ parent_draw_constraints_ = parent_draw_constraints;
+
+ ClientPostInvalidate();
+}
+
+const ParentCompositorDrawConstraints&
+SharedRendererState::ParentDrawConstraints() const {
+ base::AutoLock lock(lock_);
+ return parent_draw_constraints_;
+}
+
void SharedRendererState::SetHardwareAllowed(bool allowed) {
base::AutoLock lock(lock_);
hardware_allowed_ = allowed;

Powered by Google App Engine
This is Rietveld 408576698