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

Unified Diff: content/renderer/gpu/mailbox_output_surface.cc

Issue 16304003: Unified OutputSurface::SwapBuffers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to 205473 Created 7 years, 6 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/gpu/mailbox_output_surface.h ('k') | content/renderer/gpu/render_widget_compositor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/mailbox_output_surface.cc
diff --git a/content/renderer/gpu/mailbox_output_surface.cc b/content/renderer/gpu/mailbox_output_surface.cc
index d7b13ce3ad361bebff278c43c26e944a9eca233b..80e7ed22d7c61cc91fec4cd5b96f345d7bf0182a 100644
--- a/content/renderer/gpu/mailbox_output_surface.cc
+++ b/content/renderer/gpu/mailbox_output_surface.cc
@@ -22,7 +22,7 @@ MailboxOutputSurface::MailboxOutputSurface(
int32 routing_id,
WebGraphicsContext3DCommandBufferImpl* context3D,
cc::SoftwareOutputDevice* software_device)
- : CompositorOutputSurface(routing_id, context3D, software_device),
+ : CompositorOutputSurface(routing_id, context3D, software_device, true),
fbo_(0),
is_backbuffer_discarded_(false) {
pending_textures_.push_back(TransferableFrame());
@@ -123,24 +123,6 @@ void MailboxOutputSurface::BindFramebuffer() {
current_backing_.texture_id, 0);
}
-void MailboxOutputSurface::SendFrameToParentCompositor(
- cc::CompositorFrame* frame) {
- frame->gl_frame_data.reset(new GLFrameData());
-
- DCHECK(!surface_size_.IsEmpty());
- DCHECK(surface_size_ == current_backing_.size);
- DCHECK(!current_backing_.mailbox.IsZero());
-
- frame->gl_frame_data->mailbox = current_backing_.mailbox;
- frame->gl_frame_data->size = current_backing_.size;
- context3d_->flush();
- frame->gl_frame_data->sync_point = context3d_->insertSyncPoint();
- CompositorOutputSurface::SendFrameToParentCompositor(frame);
-
- pending_textures_.push_back(current_backing_);
- current_backing_ = TransferableFrame();
-}
-
void MailboxOutputSurface::OnSwapAck(const cc::CompositorFrameAck& ack) {
if (!ack.gl_frame_data->mailbox.IsZero()) {
DCHECK(!ack.gl_frame_data->size.IsEmpty());
@@ -179,16 +161,24 @@ void MailboxOutputSurface::OnSwapAck(const cc::CompositorFrameAck& ack) {
CompositorOutputSurface::OnSwapAck(ack);
}
-void MailboxOutputSurface::SwapBuffers(const ui::LatencyInfo&) {
-}
-
-void MailboxOutputSurface::PostSubBuffer(gfx::Rect rect,
- const ui::LatencyInfo&) {
- NOTIMPLEMENTED()
+void MailboxOutputSurface::SwapBuffers(cc::CompositorFrame* frame) {
+ DCHECK(frame->gl_frame_data);
+ DCHECK(frame->gl_frame_data->sub_buffer_rect.size() ==
+ frame->gl_frame_data->size)
<< "Partial swap not supported with composite-to-mailbox yet.";
- // The browser only copies damage correctly for two buffers in use.
- DCHECK(GetNumAcksPending() < 2);
+ DCHECK(!surface_size_.IsEmpty());
+ DCHECK(surface_size_ == current_backing_.size);
+ DCHECK(frame->gl_frame_data->size == current_backing_.size);
+ DCHECK(!current_backing_.mailbox.IsZero());
+
+ frame->gl_frame_data->mailbox = current_backing_.mailbox;
+ context3d_->flush();
+ frame->gl_frame_data->sync_point = context3d_->insertSyncPoint();
+ CompositorOutputSurface::SwapBuffers(frame);
+
+ pending_textures_.push_back(current_backing_);
+ current_backing_ = TransferableFrame();
}
size_t MailboxOutputSurface::GetNumAcksPending() {
« no previous file with comments | « content/renderer/gpu/mailbox_output_surface.h ('k') | content/renderer/gpu/render_widget_compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698