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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 size.width(), size.height(), scale_factor); | 369 size.width(), size.height(), scale_factor); |
370 } | 370 } |
371 if (software_device_) | 371 if (software_device_) |
372 software_device_->Resize(size); | 372 software_device_->Resize(size); |
373 } | 373 } |
374 | 374 |
375 gfx::Size OutputSurface::SurfaceSize() const { | 375 gfx::Size OutputSurface::SurfaceSize() const { |
376 return surface_size_; | 376 return surface_size_; |
377 } | 377 } |
378 | 378 |
| 379 float OutputSurface::SurfaceScaleFactor() const { return device_scale_factor_; } |
| 380 |
379 void OutputSurface::BindFramebuffer() { | 381 void OutputSurface::BindFramebuffer() { |
380 DCHECK(context_provider_); | 382 DCHECK(context_provider_); |
381 context_provider_->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); | 383 context_provider_->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); |
382 } | 384 } |
383 | 385 |
384 void OutputSurface::SwapBuffers(CompositorFrame* frame) { | 386 void OutputSurface::SwapBuffers(CompositorFrame* frame) { |
385 if (frame->software_frame_data) { | 387 if (frame->software_frame_data) { |
386 PostSwapBuffersComplete(); | 388 PostSwapBuffersComplete(); |
387 DidSwapBuffers(); | 389 DidSwapBuffers(); |
388 return; | 390 return; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", | 488 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", |
487 "bytes_limit_when_visible", policy.bytes_limit_when_visible); | 489 "bytes_limit_when_visible", policy.bytes_limit_when_visible); |
488 // Just ignore the memory manager when it says to set the limit to zero | 490 // Just ignore the memory manager when it says to set the limit to zero |
489 // bytes. This will happen when the memory manager thinks that the renderer | 491 // bytes. This will happen when the memory manager thinks that the renderer |
490 // is not visible (which the renderer knows better). | 492 // is not visible (which the renderer knows better). |
491 if (policy.bytes_limit_when_visible) | 493 if (policy.bytes_limit_when_visible) |
492 client_->SetMemoryPolicy(policy); | 494 client_->SetMemoryPolicy(policy); |
493 } | 495 } |
494 | 496 |
495 } // namespace cc | 497 } // namespace cc |
OLD | NEW |