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

Side by Side Diff: content/renderer/gpu/mailbox_output_surface.cc

Issue 145313006: [#7] Pass gfx structs by const ref (gfx::Size) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 10 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 unified diff | Download patch
« no previous file with comments | « content/renderer/gpu/mailbox_output_surface.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/renderer/gpu/mailbox_output_surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698