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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 software_device_->EnsureBackbuffer(); | 348 software_device_->EnsureBackbuffer(); |
349 } | 349 } |
350 | 350 |
351 void OutputSurface::DiscardBackbuffer() { | 351 void OutputSurface::DiscardBackbuffer() { |
352 if (context_provider_) | 352 if (context_provider_) |
353 context_provider_->ContextGL()->DiscardBackbufferCHROMIUM(); | 353 context_provider_->ContextGL()->DiscardBackbufferCHROMIUM(); |
354 if (software_device_) | 354 if (software_device_) |
355 software_device_->DiscardBackbuffer(); | 355 software_device_->DiscardBackbuffer(); |
356 } | 356 } |
357 | 357 |
358 void OutputSurface::Reshape(gfx::Size size, float scale_factor) { | 358 void OutputSurface::Reshape(const gfx::Size& size, float scale_factor) { |
359 if (size == surface_size_ && scale_factor == device_scale_factor_) | 359 if (size == surface_size_ && scale_factor == device_scale_factor_) |
360 return; | 360 return; |
361 | 361 |
362 surface_size_ = size; | 362 surface_size_ = size; |
363 device_scale_factor_ = scale_factor; | 363 device_scale_factor_ = scale_factor; |
364 if (context_provider_) { | 364 if (context_provider_) { |
365 context_provider_->ContextGL()->ResizeCHROMIUM( | 365 context_provider_->ContextGL()->ResizeCHROMIUM( |
366 size.width(), size.height(), scale_factor); | 366 size.width(), size.height(), scale_factor); |
367 } | 367 } |
368 if (software_device_) | 368 if (software_device_) |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", | 483 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", |
484 "bytes_limit_when_visible", policy.bytes_limit_when_visible); | 484 "bytes_limit_when_visible", policy.bytes_limit_when_visible); |
485 // Just ignore the memory manager when it says to set the limit to zero | 485 // Just ignore the memory manager when it says to set the limit to zero |
486 // bytes. This will happen when the memory manager thinks that the renderer | 486 // bytes. This will happen when the memory manager thinks that the renderer |
487 // is not visible (which the renderer knows better). | 487 // is not visible (which the renderer knows better). |
488 if (policy.bytes_limit_when_visible) | 488 if (policy.bytes_limit_when_visible) |
489 client_->SetMemoryPolicy(policy); | 489 client_->SetMemoryPolicy(policy); |
490 } | 490 } |
491 | 491 |
492 } // namespace cc | 492 } // namespace cc |
OLD | NEW |