summaryrefslogtreecommitdiffstats
path: root/android_webview/browser/shared_renderer_state.cc
diff options
context:
space:
mode:
authorboliu <boliu@chromium.org>2015-03-18 17:29:26 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-19 00:32:56 +0000
commitb887d327fde64c810e34ef78e6bf4006adee441b (patch)
tree3f46e7c6eec9febc9be784344a5565e1dc679a10 /android_webview/browser/shared_renderer_state.cc
parentcd1401c2d863a44ea405a313e94d8fcbfbfb7ada (diff)
downloadchromium_src-b887d327fde64c810e34ef78e6bf4006adee441b.zip
chromium_src-b887d327fde64c810e34ef78e6bf4006adee441b.tar.gz
chromium_src-b887d327fde64c810e34ef78e6bf4006adee441b.tar.bz2
Remove android webview rendering cruft
Remove pipelining and blocking the pipeline in different stages. The underlying issue it was trying to workaround is fixed in Android, and it involves a lot of complexity and was a source of bugs. Also remove special handling when viewport is empty, as this is handled correctly now. Add back the IsEmpty corner case workaround by passing some frame metadata with ChildFrame. BUG= Review URL: https://codereview.chromium.org/1001643004 Cr-Commit-Position: refs/heads/master@{#321250}
Diffstat (limited to 'android_webview/browser/shared_renderer_state.cc')
-rw-r--r--android_webview/browser/shared_renderer_state.cc79
1 files changed, 16 insertions, 63 deletions
diff --git a/android_webview/browser/shared_renderer_state.cc b/android_webview/browser/shared_renderer_state.cc
index 119b7fd..1d9874e 100644
--- a/android_webview/browser/shared_renderer_state.cc
+++ b/android_webview/browser/shared_renderer_state.cc
@@ -5,6 +5,7 @@
#include "android_webview/browser/shared_renderer_state.h"
#include "android_webview/browser/browser_view_renderer.h"
+#include "android_webview/browser/child_frame.h"
#include "android_webview/browser/deferred_gpu_command_service.h"
#include "android_webview/browser/hardware_renderer.h"
#include "android_webview/browser/scoped_app_gl_state_restore.h"
@@ -88,9 +89,7 @@ SharedRendererState::SharedRendererState(
: ui_loop_(ui_loop),
browser_view_renderer_(browser_view_renderer),
renderer_manager_key_(GLViewRendererManager::GetInstance()->NullKey()),
- force_commit_(false),
inside_hardware_release_(false),
- needs_force_invalidate_on_next_draw_gl_(false),
weak_factory_on_ui_thread_(this) {
DCHECK(ui_loop_->BelongsToCurrentThread());
DCHECK(browser_view_renderer_);
@@ -157,68 +156,34 @@ gfx::Vector2d SharedRendererState::GetScrollOffsetOnRT() {
return scroll_offset_;
}
-bool SharedRendererState::HasCompositorFrameOnUI() const {
+void SharedRendererState::SetCompositorFrameOnUI(scoped_ptr<ChildFrame> frame) {
base::AutoLock lock(lock_);
- return compositor_frame_.get();
+ DCHECK(!child_frame_.get());
+ child_frame_ = frame.Pass();
}
-void SharedRendererState::SetCompositorFrameOnUI(
- scoped_ptr<cc::CompositorFrame> frame,
- bool force_commit) {
+scoped_ptr<ChildFrame> SharedRendererState::PassCompositorFrameOnRT() {
base::AutoLock lock(lock_);
- DCHECK(!compositor_frame_.get());
- compositor_frame_ = frame.Pass();
- force_commit_ = force_commit;
+ return child_frame_.Pass();
}
-scoped_ptr<cc::CompositorFrame> SharedRendererState::PassCompositorFrameOnRT() {
+scoped_ptr<ChildFrame> SharedRendererState::PassUncommittedFrameOnUI() {
base::AutoLock lock(lock_);
- return compositor_frame_.Pass();
-}
-
-scoped_ptr<cc::CompositorFrame>
-SharedRendererState::PassUncommittedFrameOnUI() {
- base::AutoLock lock(lock_);
- return compositor_frame_.Pass();
-}
-
-bool SharedRendererState::ForceCommitOnRT() const {
- base::AutoLock lock(lock_);
- return force_commit_;
-}
-
-bool SharedRendererState::UpdateDrawConstraintsOnRT(
- const ParentCompositorDrawConstraints& parent_draw_constraints) {
- base::AutoLock lock(lock_);
- if (needs_force_invalidate_on_next_draw_gl_ ||
- !parent_draw_constraints_.Equals(parent_draw_constraints)) {
- parent_draw_constraints_ = parent_draw_constraints;
- return true;
- }
-
- return false;
+ return child_frame_.Pass();
}
void SharedRendererState::PostExternalDrawConstraintsToChildCompositorOnRT(
const ParentCompositorDrawConstraints& parent_draw_constraints) {
- if (UpdateDrawConstraintsOnRT(parent_draw_constraints)) {
- // No need to hold the lock_ during the post task.
- ui_loop_->PostTask(
- FROM_HERE,
- base::Bind(&SharedRendererState::UpdateParentDrawConstraintsOnUI,
- ui_thread_weak_ptr_));
+ {
+ base::AutoLock lock(lock_);
+ parent_draw_constraints_ = parent_draw_constraints;
}
-}
-void SharedRendererState::DidSkipCommitFrameOnRT() {
- ui_loop_->PostTask(FROM_HERE,
- base::Bind(&SharedRendererState::DidSkipCommitFrameOnUI,
- ui_thread_weak_ptr_));
-}
-
-void SharedRendererState::DidSkipCommitFrameOnUI() {
- DCHECK(ui_loop_->BelongsToCurrentThread());
- browser_view_renderer_->DidSkipCommitFrame();
+ // No need to hold the lock_ during the post task.
+ ui_loop_->PostTask(
+ FROM_HERE,
+ base::Bind(&SharedRendererState::UpdateParentDrawConstraintsOnUI,
+ ui_thread_weak_ptr_));
}
ParentCompositorDrawConstraints
@@ -227,18 +192,6 @@ SharedRendererState::GetParentDrawConstraintsOnUI() const {
return parent_draw_constraints_;
}
-void SharedRendererState::SetForceInvalidateOnNextDrawGLOnUI(
- bool needs_force_invalidate_on_next_draw_gl) {
- base::AutoLock lock(lock_);
- needs_force_invalidate_on_next_draw_gl_ =
- needs_force_invalidate_on_next_draw_gl;
-}
-
-bool SharedRendererState::NeedsForceInvalidateOnNextDrawGLOnUI() const {
- base::AutoLock lock(lock_);
- return needs_force_invalidate_on_next_draw_gl_;
-}
-
void SharedRendererState::SetInsideHardwareRelease(bool inside) {
base::AutoLock lock(lock_);
inside_hardware_release_ = inside;