OLD | NEW |
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 "cc/output/output_surface.h" | 5 #include "cc/output/output_surface.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 if (size == surface_size_ && scale_factor == device_scale_factor_) | 219 if (size == surface_size_ && scale_factor == device_scale_factor_) |
220 return; | 220 return; |
221 | 221 |
222 surface_size_ = size; | 222 surface_size_ = size; |
223 device_scale_factor_ = scale_factor; | 223 device_scale_factor_ = scale_factor; |
224 if (context_provider_) { | 224 if (context_provider_) { |
225 context_provider_->ContextGL()->ResizeCHROMIUM( | 225 context_provider_->ContextGL()->ResizeCHROMIUM( |
226 size.width(), size.height(), scale_factor); | 226 size.width(), size.height(), scale_factor); |
227 } | 227 } |
228 if (software_device_) | 228 if (software_device_) |
229 software_device_->Resize(size); | 229 software_device_->Resize(size, scale_factor); |
230 } | 230 } |
231 | 231 |
232 gfx::Size OutputSurface::SurfaceSize() const { | 232 gfx::Size OutputSurface::SurfaceSize() const { |
233 return surface_size_; | 233 return surface_size_; |
234 } | 234 } |
235 | 235 |
236 void OutputSurface::BindFramebuffer() { | 236 void OutputSurface::BindFramebuffer() { |
237 DCHECK(context_provider_); | 237 DCHECK(context_provider_); |
238 context_provider_->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); | 238 context_provider_->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); |
239 } | 239 } |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", | 350 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", |
351 "bytes_limit_when_visible", policy.bytes_limit_when_visible); | 351 "bytes_limit_when_visible", policy.bytes_limit_when_visible); |
352 // Just ignore the memory manager when it says to set the limit to zero | 352 // Just ignore the memory manager when it says to set the limit to zero |
353 // bytes. This will happen when the memory manager thinks that the renderer | 353 // bytes. This will happen when the memory manager thinks that the renderer |
354 // is not visible (which the renderer knows better). | 354 // is not visible (which the renderer knows better). |
355 if (policy.bytes_limit_when_visible) | 355 if (policy.bytes_limit_when_visible) |
356 client_->SetMemoryPolicy(policy); | 356 client_->SetMemoryPolicy(policy); |
357 } | 357 } |
358 | 358 |
359 } // namespace cc | 359 } // namespace cc |
OLD | NEW |