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

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: added a unit test for PictureLayerImpl 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 582908eb39e699abb54e00ef9294bbd8fe0acc98..aeb8fd17adfc497390da775602b2b772d3ecba8b 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"
boliu 2014/07/29 19:02:42 remove both
+#include "content/public/browser/android/synchronous_compositor.h"
namespace android_webview {
@@ -51,6 +53,18 @@ void SharedRendererState::ClientRequestDrawGLOnUIThread() {
}
}
+void SharedRendererState::ClientPostInvalidateIfNeeded() {
+ ui_loop_->PostTask(
+ FROM_HERE,
+ base::Bind(&SharedRendererState::ClientPostInvalidateIfNeededOnUIThread,
+ ui_thread_weak_ptr_));
+}
+
+void SharedRendererState::ClientPostInvalidateIfNeededOnUIThread() {
+ DCHECK(ui_loop_->BelongsToCurrentThread());
+ client_on_ui_->EnsureContinuousInvalidation(true);
+}
+
void SharedRendererState::SetDrawGLInput(scoped_ptr<DrawGLInput> input) {
base::AutoLock lock(lock_);
DCHECK(!draw_gl_input_.get());
@@ -62,6 +76,23 @@ 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;
+ }
+
+ // No need to hold the lock_ during the post task.
+ ClientPostInvalidateIfNeeded();
+}
+
+const ParentCompositorDrawConstraints&
+SharedRendererState::ParentDrawConstraints() const {
+ base::AutoLock lock(lock_);
+ return parent_draw_constraints_;
+}
+
void SharedRendererState::SetInsideHardwareRelease(bool inside) {
base::AutoLock lock(lock_);
inside_hardware_release_ = inside;

Powered by Google App Engine
This is Rietveld 408576698