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

Side by Side Diff: content/renderer/gpu/compositor_software_output_device.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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/compositor_software_output_device.h" 5 #include "content/renderer/gpu/compositor_software_output_device.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "cc/output/software_frame_data.h" 8 #include "cc/output/software_frame_data.h"
9 #include "content/renderer/render_process.h" 9 #include "content/renderer/render_process.h"
10 #include "third_party/skia/include/core/SkBitmapDevice.h" 10 #include "third_party/skia/include/core/SkBitmapDevice.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 for (size_t i = 0; i < buffers_.size(); ++i) { 90 for (size_t i = 0; i < buffers_.size(); ++i) {
91 size_t index = (hint + i) % buffers_.size(); 91 size_t index = (hint + i) % buffers_.size();
92 if (buffers_[index]->free()) 92 if (buffers_[index]->free())
93 return index; 93 return index;
94 } 94 }
95 95
96 buffers_.push_back(CreateBuffer()); 96 buffers_.push_back(CreateBuffer());
97 return buffers_.size() - 1; 97 return buffers_.size() - 1;
98 } 98 }
99 99
100 void CompositorSoftwareOutputDevice::Resize(gfx::Size viewport_size) { 100 void CompositorSoftwareOutputDevice::Resize(const gfx::Size& viewport_size) {
101 DCHECK(CalledOnValidThread()); 101 DCHECK(CalledOnValidThread());
102 102
103 if (viewport_size_ == viewport_size) 103 if (viewport_size_ == viewport_size)
104 return; 104 return;
105 105
106 // Keep non-ACKed buffers in awaiting_ack_ until they get acknowledged. 106 // Keep non-ACKed buffers in awaiting_ack_ until they get acknowledged.
107 for (size_t i = 0; i < buffers_.size(); ++i) { 107 for (size_t i = 0; i < buffers_.size(); ++i) {
108 if (!buffers_[i]->free()) { 108 if (!buffers_[i]->free()) {
109 awaiting_ack_.push_back(buffers_[i]); 109 awaiting_ack_.push_back(buffers_[i]);
110 buffers_[i] = NULL; 110 buffers_[i] = NULL;
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 return; 223 return;
224 } else { 224 } else {
225 it = std::find_if(awaiting_ack_.begin(), awaiting_ack_.end(), 225 it = std::find_if(awaiting_ack_.begin(), awaiting_ack_.end(),
226 CompareById(id)); 226 CompareById(id));
227 DCHECK(it != awaiting_ack_.end()); 227 DCHECK(it != awaiting_ack_.end());
228 awaiting_ack_.erase(it); 228 awaiting_ack_.erase(it);
229 } 229 }
230 } 230 }
231 231
232 } // namespace content 232 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/gpu/compositor_software_output_device.h ('k') | content/renderer/gpu/mailbox_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698