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

Unified Diff: content/renderer/render_widget.cc

Issue 8139020: Turning the threaded compositor into a runtime option. This CL (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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
« no previous file with comments | « content/renderer/render_widget.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
===================================================================
--- content/renderer/render_widget.cc (revision 104391)
+++ content/renderer/render_widget.cc (working copy)
@@ -326,11 +326,7 @@
if (!is_accelerated_compositing_active_) {
didInvalidateRect(gfx::Rect(size_.width(), size_.height()));
} else {
-#ifdef WTF_USE_THREADED_COMPOSITING
- webwidget_->composite(false);
-#else
scheduleComposite();
-#endif
}
}
@@ -929,9 +925,9 @@
Send(new ViewHostMsg_DidActivateAcceleratedCompositing(
routing_id_, is_accelerated_compositing_active_));
-#ifndef WTF_USE_THREADED_COMPOSITING
+ // Note: asynchronous swapbuffer support currently only matters if
+ // compositing scheduling happens on the RenderWidget.
using_asynchronous_swapbuffers_ = SupportsAsynchronousSwapBuffers();
-#endif
}
void RenderWidget::didDeactivateCompositor() {
@@ -941,24 +937,22 @@
Send(new ViewHostMsg_DidActivateAcceleratedCompositing(
routing_id_, is_accelerated_compositing_active_));
-#ifndef WTF_USE_THREADED_COMPOSITING
if (using_asynchronous_swapbuffers_)
using_asynchronous_swapbuffers_ = false;
-#endif
}
void RenderWidget::scheduleComposite() {
-#if WTF_USE_THREADED_COMPOSITING
- NOTREACHED();
-#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));
-#endif
+ if (WebWidgetHandlesCompositorScheduling())
+ webwidget_->composite(false);
+ 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::scheduleAnimation() {
@@ -1227,13 +1221,7 @@
set_next_paint_is_repaint_ack();
if (is_accelerated_compositing_active_) {
-#ifndef WTF_USE_THREADED_COMPOSITING
scheduleComposite();
-#else
-#ifdef WEBWIDGET_HAS_THREADED_COMPOSITING_CHANGES
- webwidget_->composite(false);
-#endif
-#endif
} else {
gfx::Rect repaint_rect(size_to_paint.width(), size_to_paint.height());
didInvalidateRect(repaint_rect);
@@ -1414,3 +1402,7 @@
bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) {
return false;
}
+
+bool RenderWidget::WebWidgetHandlesCompositorScheduling() const {
+ return false;
+}
« no previous file with comments | « content/renderer/render_widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698