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

Unified Diff: trunk/src/content/renderer/render_widget.cc

Issue 141833002: Revert 245445 "Unifies LayerTreeHost::SetNeedsUpdateLayers and S..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 11 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: trunk/src/content/renderer/render_widget.cc
===================================================================
--- trunk/src/content/renderer/render_widget.cc (revision 245527)
+++ trunk/src/content/renderer/render_widget.cc (working copy)
@@ -566,34 +566,6 @@
screen_metrics_emulator_->OnShowContextMenu(params);
}
-void RenderWidget::ScheduleAnimation() {
- if (animation_update_pending_)
- return;
-
- TRACE_EVENT0("gpu", "RenderWidget::ScheduleAnimation");
- animation_update_pending_ = true;
- if (!animation_timer_.IsRunning()) {
- animation_timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(0), this,
- &RenderWidget::AnimationCallback);
- }
-}
-
-void RenderWidget::ScheduleComposite() {
- if (is_accelerated_compositing_active_ &&
- RenderThreadImpl::current()->compositor_message_loop_proxy().get()) {
- DCHECK(compositor_);
- compositor_->setNeedsAnimate();
- } else {
- // TODO(nduca): replace with something a little less hacky. The reason this
- // hack is still used is because the Invalidate-DoDeferredUpdate loop
- // contains a lot of host-renderer synchronization logic that is still
- // important for the accelerated compositing case. The option of simply
- // duplicating all that code is less desirable than "faking out" the
- // invalidation path using a magical damage rect.
- didInvalidateRect(WebRect(0, 0, 1, 1));
- }
-}
-
void RenderWidget::ScheduleCompositeWithForcedRedraw() {
if (compositor_) {
// Regardless of whether threaded compositing is enabled, always
@@ -602,7 +574,7 @@
// non-threaded case.
compositor_->SetNeedsForcedRedraw();
}
- ScheduleComposite();
+ scheduleComposite();
}
bool RenderWidget::OnMessageReceived(const IPC::Message& message) {
@@ -839,7 +811,9 @@
if (!is_accelerated_compositing_active_) {
didInvalidateRect(gfx::Rect(size_.width(), size_.height()));
} else {
- ScheduleCompositeWithForcedRedraw();
+ if (compositor_)
+ compositor_->SetNeedsForcedRedraw();
+ scheduleComposite();
}
}
@@ -999,7 +973,7 @@
num_swapbuffers_complete_pending_ = 0;
using_asynchronous_swapbuffers_ = false;
// Schedule another frame so the compositor learns about it.
- ScheduleComposite();
+ scheduleComposite();
}
void RenderWidget::OnSwapBuffersPosted() {
@@ -1957,18 +1931,33 @@
need_update_rect_for_auto_resize_ = false;
}
-// Renamed. Staged for removal.
-void RenderWidget::scheduleAnimation() { scheduleUpdate(); }
-
-void RenderWidget::scheduleUpdate() {
- if (is_accelerated_compositing_active_) {
- DCHECK(compositor_);
- compositor_->setNeedsUpdateLayers();
+void RenderWidget::scheduleComposite() {
+ if (RenderThreadImpl::current()->compositor_message_loop_proxy().get() &&
+ compositor_) {
+ compositor_->setNeedsAnimate();
} else {
- ScheduleAnimation();
+ // TODO(nduca): replace with something a little less hacky. The reason this
+ // hack is still used is because the Invalidate-DoDeferredUpdate loop
+ // contains a lot of host-renderer synchronization logic that is still
+ // important for the accelerated compositing case. The option of simply
+ // duplicating all that code is less desirable than "faking out" the
+ // invalidation path using a magical damage rect.
+ didInvalidateRect(WebRect(0, 0, 1, 1));
}
}
+void RenderWidget::scheduleAnimation() {
+ if (animation_update_pending_)
+ return;
+
+ TRACE_EVENT0("gpu", "RenderWidget::scheduleAnimation");
+ animation_update_pending_ = true;
+ if (!animation_timer_.IsRunning()) {
+ animation_timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(0), this,
+ &RenderWidget::AnimationCallback);
+ }
+}
+
void RenderWidget::didChangeCursor(const WebCursorInfo& cursor_info) {
// TODO(darin): Eliminate this temporary.
WebCursor cursor;
@@ -2371,7 +2360,7 @@
if (!is_accelerated_compositing_active_) {
didInvalidateRect(gfx::Rect(size_.width(), size_.height()));
} else {
- ScheduleComposite();
+ scheduleComposite();
}
}
« no previous file with comments | « trunk/src/content/renderer/render_widget.h ('k') | trunk/src/content/shell/renderer/test_runner/WebTestProxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698