summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsunnyps <sunnyps@chromium.org>2015-06-08 15:07:33 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-08 22:08:06 +0000
commit39c5af24ab4e14ece3d7c97b7c4d027151ede176 (patch)
tree7d5e3e8a06c7a51d0b911349d4476461e69de3f8
parent3dba19a90208ee9c5890cffda0490c517cbdf43e (diff)
downloadchromium_src-39c5af24ab4e14ece3d7c97b7c4d027151ede176.zip
chromium_src-39c5af24ab4e14ece3d7c97b7c4d027151ede176.tar.gz
chromium_src-39c5af24ab4e14ece3d7c97b7c4d027151ede176.tar.bz2
Explicitly set max_pending_frames = 1 for renderer output surfaces.
All configurations of CompositorOutputSurface have max_pending_frames set to 1 but it's hard to see that unless you look at all of it's subclasses. In particular both MailboxOutputSurface and DelegatedCompositorOutputSurface set max_pending_frames to 1 and so does the CompositorOutputSurface when using a SoftwareDevice. These are all the configurations of CompositorOutputSurface that exist. Review URL: https://codereview.chromium.org/1161283003 Cr-Commit-Position: refs/heads/master@{#333356}
-rw-r--r--content/renderer/gpu/compositor_output_surface.cc3
-rw-r--r--content/renderer/gpu/delegated_compositor_output_surface.cc1
-rw-r--r--content/renderer/gpu/mailbox_output_surface.cc1
-rw-r--r--content/renderer/gpu/render_widget_compositor.cc2
-rw-r--r--content/renderer/gpu/render_widget_compositor_unittest.cc5
5 files changed, 6 insertions, 6 deletions
diff --git a/content/renderer/gpu/compositor_output_surface.cc b/content/renderer/gpu/compositor_output_surface.cc
index 3695a18..c8270a6 100644
--- a/content/renderer/gpu/compositor_output_surface.cc
+++ b/content/renderer/gpu/compositor_output_surface.cc
@@ -60,10 +60,9 @@ CompositorOutputSurface::CompositorOutputSurface(
DCHECK(output_surface_filter_.get());
DCHECK(frame_swap_message_queue_.get());
DetachFromThread();
+ capabilities_.max_frames_pending = 1;
message_sender_ = RenderThreadImpl::current()->sync_message_filter();
DCHECK(message_sender_.get());
- if (OutputSurface::software_device())
- capabilities_.max_frames_pending = 1;
}
CompositorOutputSurface::~CompositorOutputSurface() {
diff --git a/content/renderer/gpu/delegated_compositor_output_surface.cc b/content/renderer/gpu/delegated_compositor_output_surface.cc
index d767ce4..6d02fab 100644
--- a/content/renderer/gpu/delegated_compositor_output_surface.cc
+++ b/content/renderer/gpu/delegated_compositor_output_surface.cc
@@ -21,7 +21,6 @@ DelegatedCompositorOutputSurface::DelegatedCompositorOutputSurface(
swap_frame_message_queue,
true) {
capabilities_.delegated_rendering = true;
- capabilities_.max_frames_pending = 1;
}
} // namespace content
diff --git a/content/renderer/gpu/mailbox_output_surface.cc b/content/renderer/gpu/mailbox_output_surface.cc
index dbf7acb..a715663 100644
--- a/content/renderer/gpu/mailbox_output_surface.cc
+++ b/content/renderer/gpu/mailbox_output_surface.cc
@@ -41,7 +41,6 @@ MailboxOutputSurface::MailboxOutputSurface(
is_backbuffer_discarded_(false),
format_(format) {
pending_textures_.push_back(TransferableFrame());
- capabilities_.max_frames_pending = 1;
capabilities_.uses_default_gl_framebuffer = false;
}
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc
index 99f2121..280b55e 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -904,6 +904,8 @@ void RenderWidgetCompositor::RequestNewOutputSurface() {
return;
}
+ DCHECK_EQ(surface->capabilities().max_frames_pending, 1);
+
layer_tree_host_->SetOutputSurface(surface.Pass());
}
diff --git a/content/renderer/gpu/render_widget_compositor_unittest.cc b/content/renderer/gpu/render_widget_compositor_unittest.cc
index 35774b7..b8ab096 100644
--- a/content/renderer/gpu/render_widget_compositor_unittest.cc
+++ b/content/renderer/gpu/render_widget_compositor_unittest.cc
@@ -142,11 +142,12 @@ class RenderWidgetCompositorOutputSurface : public RenderWidgetCompositor {
cc::TestWebGraphicsContext3D::Create();
// Image support required for synchronous compositing.
context->set_support_image(true);
- return cc::FakeOutputSurface::Create3d(context.Pass());
+ // Create delegating surface so that max_pending_frames = 1.
+ return cc::FakeOutputSurface::CreateDelegating3d(context.Pass());
}
return use_null_output_surface_
? nullptr
- : make_scoped_ptr(new cc::FailureOutputSurface(false));
+ : make_scoped_ptr(new cc::FailureOutputSurface(true));
}
// Force a new output surface to be created.