summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorscottmg@google.com <scottmg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-01 23:29:37 +0000
committerscottmg@google.com <scottmg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-01 23:29:37 +0000
commit6d2435e693624bfa671666c30359bc8bf669ec9b (patch)
treeffaf20ae1a43f4db68fe3c0fcb0c8becb12073d4 /content
parentacbbf0078eced7c26d19c68736812430db91d48e (diff)
downloadchromium_src-6d2435e693624bfa671666c30359bc8bf669ec9b.zip
chromium_src-6d2435e693624bfa671666c30359bc8bf669ec9b.tar.gz
chromium_src-6d2435e693624bfa671666c30359bc8bf669ec9b.tar.bz2
Revert 120111 - Defer render_widget draw until host window is available
In accelerated compositing mode we can't start rendering until the native window (HWND/gtk widget) are created on Windows and GTK without aura. For most render_widgets the code today is racy, but for window.open() and similar creation paths this is a race that we pretty much always lose. This defers the first DoDeferredUpdate on a render_widget until its host_window_ is available. Also defers querying for GL_CHROMIUM_supports_swapbuffers_callback extension until the first draw, since the context isn't ready until the host window is available. BUG=106815 TEST=start with --force-compositing-mode and --show-fps-counter, load up a page that uses window.open() to open a popup, and confirm that the popup is in compositing mode Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=119977 Review URL: http://codereview.chromium.org/9225050 TBR=jamesr@chromium.org Review URL: https://chromiumcodereview.appspot.com/9307043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120130 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/renderer/render_view_impl.cc21
-rw-r--r--content/renderer/render_view_impl.h7
-rw-r--r--content/renderer/render_widget.cc14
3 files changed, 9 insertions, 33 deletions
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 69bfb28..c8eb610 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -397,8 +397,6 @@ RenderViewImpl::RenderViewImpl(
cached_is_main_frame_pinned_to_right_(false),
cached_has_main_frame_horizontal_scrollbar_(false),
cached_has_main_frame_vertical_scrollbar_(false),
- context_has_swapbuffers_complete_callback_(false),
- queried_for_swapbuffers_complete_callback_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)),
geolocation_dispatcher_(NULL),
speech_input_dispatcher_(NULL),
@@ -4497,21 +4495,12 @@ bool RenderViewImpl::SupportsAsynchronousSwapBuffers() {
if (WebWidgetHandlesCompositorScheduling())
return false;
- if (queried_for_swapbuffers_complete_callback_)
- return context_has_swapbuffers_complete_callback_;
-
- queried_for_swapbuffers_complete_callback_ = true;
-
WebKit::WebGraphicsContext3D* context = webview()->graphicsContext3D();
- if (context) {
- context->makeContextCurrent();
- std::string extensions(context->getRequestableExtensionsCHROMIUM().utf8());
- context_has_swapbuffers_complete_callback_ =
- extensions.find("GL_CHROMIUM_swapbuffers_complete_callback")
- != std::string::npos;
- }
-
- return context_has_swapbuffers_complete_callback_;
+ if (!context)
+ return false;
+ std::string extensions(context->getRequestableExtensionsCHROMIUM().utf8());
+ return extensions.find("GL_CHROMIUM_swapbuffers_complete_callback") !=
+ std::string::npos;
}
void RenderViewImpl::OnSetFocus(bool enable) {
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index 083ab85..b892a80 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -1135,13 +1135,6 @@ class RenderViewImpl : public RenderWidget,
std::set<gfx::PluginWindowHandle> fake_plugin_window_handles_;
#endif
- // When this view is composited, the context used for compositing may or may
- // not support the GL_CHROMIUM_swapbuffers_complete_callback extension. Since
- // querying for the existence of this extension is expensive we cache the
- // result. These are used to implement SupportsAsynchronousSwapBuffers().
- bool context_has_swapbuffers_complete_callback_;
- bool queried_for_swapbuffers_complete_callback_;
-
// Helper objects ------------------------------------------------------------
RendererWebCookieJarImpl cookie_jar_;
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 6b16fa7..3df2a99 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -175,8 +175,6 @@ void RenderWidget::CompleteInit(gfx::NativeViewId parent_hwnd) {
host_window_ = parent_hwnd;
- DoDeferredUpdate();
-
Send(new ViewHostMsg_RenderViewReady(routing_id_));
}
@@ -739,11 +737,6 @@ void RenderWidget::DoDeferredUpdate() {
if (!webwidget_)
return;
-
- if (!host_window_) {
- TRACE_EVENT0("renderer", "EarlyOut_NoHostWindow");
- return;
- }
if (update_reply_pending_) {
TRACE_EVENT0("renderer", "EarlyOut_UpdateReplyPending");
return;
@@ -762,9 +755,6 @@ void RenderWidget::DoDeferredUpdate() {
return;
}
- if (is_accelerated_compositing_active_)
- using_asynchronous_swapbuffers_ = SupportsAsynchronousSwapBuffers();
-
// Tracking of frame rate jitter
base::TimeTicks frame_begin_ticks = base::TimeTicks::Now();
AnimateIfNeeded();
@@ -1020,6 +1010,10 @@ void RenderWidget::didActivateCompositor(int compositor_identifier) {
is_accelerated_compositing_active_ = true;
Send(new ViewHostMsg_DidActivateAcceleratedCompositing(
routing_id_, is_accelerated_compositing_active_));
+
+ // Note: asynchronous swapbuffer support currently only matters if
+ // compositing scheduling happens on the RenderWidget.
+ using_asynchronous_swapbuffers_ = SupportsAsynchronousSwapBuffers();
}
void RenderWidget::didDeactivateCompositor() {