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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 returned_textures_.pop(); | 111 returned_textures_.pop(); |
112 } | 112 } |
113 | 113 |
114 if (fbo_) { | 114 if (fbo_) { |
115 gl->BindFramebuffer(GL_FRAMEBUFFER, fbo_); | 115 gl->BindFramebuffer(GL_FRAMEBUFFER, fbo_); |
116 gl->DeleteFramebuffers(1, &fbo_); | 116 gl->DeleteFramebuffers(1, &fbo_); |
117 fbo_ = 0; | 117 fbo_ = 0; |
118 } | 118 } |
119 } | 119 } |
120 | 120 |
121 void MailboxOutputSurface::Reshape(gfx::Size size, float scale_factor) { | 121 void MailboxOutputSurface::Reshape(const gfx::Size& size, float scale_factor) { |
122 if (size == surface_size_) | 122 if (size == surface_size_) |
123 return; | 123 return; |
124 | 124 |
125 surface_size_ = size; | 125 surface_size_ = size; |
126 device_scale_factor_ = scale_factor; | 126 device_scale_factor_ = scale_factor; |
127 DiscardBackbuffer(); | 127 DiscardBackbuffer(); |
128 EnsureBackbuffer(); | 128 EnsureBackbuffer(); |
129 } | 129 } |
130 | 130 |
131 void MailboxOutputSurface::BindFramebuffer() { | 131 void MailboxOutputSurface::BindFramebuffer() { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 pending_textures_.push_back(current_backing_); | 206 pending_textures_.push_back(current_backing_); |
207 current_backing_ = TransferableFrame(); | 207 current_backing_ = TransferableFrame(); |
208 } | 208 } |
209 | 209 |
210 size_t MailboxOutputSurface::GetNumAcksPending() { | 210 size_t MailboxOutputSurface::GetNumAcksPending() { |
211 DCHECK(pending_textures_.size()); | 211 DCHECK(pending_textures_.size()); |
212 return pending_textures_.size() - 1; | 212 return pending_textures_.size() - 1; |
213 } | 213 } |
214 | 214 |
215 } // namespace content | 215 } // namespace content |
OLD | NEW |