OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/gpu/mailbox_output_surface.h" | 5 #include "content/renderer/gpu/mailbox_output_surface.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "cc/output/compositor_frame.h" | 8 #include "cc/output/compositor_frame.h" |
9 #include "cc/output/compositor_frame_ack.h" | 9 #include "cc/output/compositor_frame_ack.h" |
10 #include "cc/output/gl_frame_data.h" | 10 #include "cc/output/gl_frame_data.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 // If it does not return a mailbox, it discarded the frontbuffer which is | 190 // If it does not return a mailbox, it discarded the frontbuffer which is |
191 // the oldest texture we sent. | 191 // the oldest texture we sent. |
192 uint32 texture_id = pending_textures_.front().texture_id; | 192 uint32 texture_id = pending_textures_.front().texture_id; |
193 if (texture_id) | 193 if (texture_id) |
194 context3d_->deleteTexture(texture_id); | 194 context3d_->deleteTexture(texture_id); |
195 pending_textures_.pop_front(); | 195 pending_textures_.pop_front(); |
196 } | 196 } |
197 CompositorOutputSurface::OnSwapAck(ack); | 197 CompositorOutputSurface::OnSwapAck(ack); |
198 } | 198 } |
199 | 199 |
200 void MailboxOutputSurface::SwapBuffers(const cc::LatencyInfo&) { | 200 void MailboxOutputSurface::SwapBuffers(const ui::LatencyInfo&) { |
201 } | 201 } |
202 | 202 |
203 void MailboxOutputSurface::PostSubBuffer(gfx::Rect rect, | 203 void MailboxOutputSurface::PostSubBuffer(gfx::Rect rect, |
204 const cc::LatencyInfo&) { | 204 const ui::LatencyInfo&) { |
205 NOTIMPLEMENTED() | 205 NOTIMPLEMENTED() |
206 << "Partial swap not supported with composite-to-mailbox yet."; | 206 << "Partial swap not supported with composite-to-mailbox yet."; |
207 | 207 |
208 // The browser only copies damage correctly for two buffers in use. | 208 // The browser only copies damage correctly for two buffers in use. |
209 DCHECK(GetNumAcksPending() < 2); | 209 DCHECK(GetNumAcksPending() < 2); |
210 } | 210 } |
211 | 211 |
212 void MailboxOutputSurface::ConsumeTexture(const TransferableFrame& frame) { | 212 void MailboxOutputSurface::ConsumeTexture(const TransferableFrame& frame) { |
213 DCHECK(!frame.mailbox.IsZero()); | 213 DCHECK(!frame.mailbox.IsZero()); |
214 if (frame.sync_point) | 214 if (frame.sync_point) |
215 context3d_->waitSyncPoint(frame.sync_point); | 215 context3d_->waitSyncPoint(frame.sync_point); |
216 | 216 |
217 context3d_->bindTexture(GL_TEXTURE_2D, frame.texture_id); | 217 context3d_->bindTexture(GL_TEXTURE_2D, frame.texture_id); |
218 context3d_->consumeTextureCHROMIUM(GL_TEXTURE_2D, frame.mailbox.name); | 218 context3d_->consumeTextureCHROMIUM(GL_TEXTURE_2D, frame.mailbox.name); |
219 } | 219 } |
220 | 220 |
221 size_t MailboxOutputSurface::GetNumAcksPending() { | 221 size_t MailboxOutputSurface::GetNumAcksPending() { |
222 DCHECK(pending_textures_.size()); | 222 DCHECK(pending_textures_.size()); |
223 return pending_textures_.size() - 1; | 223 return pending_textures_.size() - 1; |
224 } | 224 } |
225 | 225 |
226 } // namespace content | 226 } // namespace content |
OLD | NEW |