| 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 size.width(), size.height(), scale_factor); | 350 size.width(), size.height(), scale_factor); |
| 351 } | 351 } |
| 352 if (software_device_) | 352 if (software_device_) |
| 353 software_device_->Resize(size); | 353 software_device_->Resize(size); |
| 354 } | 354 } |
| 355 | 355 |
| 356 gfx::Size OutputSurface::SurfaceSize() const { | 356 gfx::Size OutputSurface::SurfaceSize() const { |
| 357 return surface_size_; | 357 return surface_size_; |
| 358 } | 358 } |
| 359 | 359 |
| 360 float OutputSurface::SurfaceScaleFactor() const { |
| 361 return device_scale_factor_; |
| 362 } |
| 363 |
| 360 void OutputSurface::BindFramebuffer() { | 364 void OutputSurface::BindFramebuffer() { |
| 361 DCHECK(context_provider_); | 365 DCHECK(context_provider_); |
| 362 context_provider_->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); | 366 context_provider_->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); |
| 363 } | 367 } |
| 364 | 368 |
| 365 void OutputSurface::SwapBuffers(CompositorFrame* frame) { | 369 void OutputSurface::SwapBuffers(CompositorFrame* frame) { |
| 366 if (frame->software_frame_data) { | 370 if (frame->software_frame_data) { |
| 367 PostSwapBuffersComplete(); | 371 PostSwapBuffersComplete(); |
| 368 DidSwapBuffers(); | 372 DidSwapBuffers(); |
| 369 return; | 373 return; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", | 472 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", |
| 469 "bytes_limit_when_visible", policy.bytes_limit_when_visible); | 473 "bytes_limit_when_visible", policy.bytes_limit_when_visible); |
| 470 // Just ignore the memory manager when it says to set the limit to zero | 474 // Just ignore the memory manager when it says to set the limit to zero |
| 471 // bytes. This will happen when the memory manager thinks that the renderer | 475 // bytes. This will happen when the memory manager thinks that the renderer |
| 472 // is not visible (which the renderer knows better). | 476 // is not visible (which the renderer knows better). |
| 473 if (policy.bytes_limit_when_visible) | 477 if (policy.bytes_limit_when_visible) |
| 474 client_->SetMemoryPolicy(policy); | 478 client_->SetMemoryPolicy(policy); |
| 475 } | 479 } |
| 476 | 480 |
| 477 } // namespace cc | 481 } // namespace cc |
| OLD | NEW |