diff options
author | hush@chromium.org <hush@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-31 09:09:33 +0000 |
---|---|---|
committer | hush@chromium.org <hush@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-31 09:09:33 +0000 |
commit | bd5324590122e686c34a66b1bbf7acbfc3fc73da (patch) | |
tree | 0f858d11bd9e26259206661e64be29be364e3caf /android_webview/browser/shared_renderer_state.cc | |
parent | 81314fe02b07b543a360ed442ef0085583bf4397 (diff) | |
download | chromium_src-bd5324590122e686c34a66b1bbf7acbfc3fc73da.zip chromium_src-bd5324590122e686c34a66b1bbf7acbfc3fc73da.tar.gz chromium_src-bd5324590122e686c34a66b1bbf7acbfc3fc73da.tar.bz2 |
Tiling priorities in Android Webview.
Use the parent compositor's clip and transform for tile
priorities in child compositor.
When the transform matrix changes in parent compositor
(hardware_renderer.cc), it posts the matrix and the clip to
the child compositor. (The parent clip is in screen space
and the parent matrix transforms from webview space to
screen space) Child compositor will use them for tile
prioritization.
In child compositor during updating tile priority, the clip
from parent is transformed from screen space to view space,
then from view space to content space. Then the result rect
will intersect with content_bounds() and the intersection
is used as tile priority input.
BUG=372073
Review URL: https://codereview.chromium.org/394113002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286731 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/browser/shared_renderer_state.cc')
-rw-r--r-- | android_webview/browser/shared_renderer_state.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/android_webview/browser/shared_renderer_state.cc b/android_webview/browser/shared_renderer_state.cc index 582908e..200e2ab 100644 --- a/android_webview/browser/shared_renderer_state.cc +++ b/android_webview/browser/shared_renderer_state.cc @@ -51,6 +51,11 @@ void SharedRendererState::ClientRequestDrawGLOnUIThread() { } } +void SharedRendererState::UpdateParentDrawConstraintsOnUIThread() { + DCHECK(ui_loop_->BelongsToCurrentThread()); + client_on_ui_->UpdateParentDrawConstraints(); +} + void SharedRendererState::SetDrawGLInput(scoped_ptr<DrawGLInput> input) { base::AutoLock lock(lock_); DCHECK(!draw_gl_input_.get()); @@ -62,6 +67,26 @@ 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. + ui_loop_->PostTask( + FROM_HERE, + base::Bind(&SharedRendererState::UpdateParentDrawConstraintsOnUIThread, + ui_thread_weak_ptr_)); +} + +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; |