| 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 15 matching lines...) Expand all Loading... |
| 26 #include "ui/gfx/frame_time.h" | 26 #include "ui/gfx/frame_time.h" |
| 27 #include "ui/gfx/geometry/rect.h" | 27 #include "ui/gfx/geometry/rect.h" |
| 28 #include "ui/gfx/geometry/size.h" | 28 #include "ui/gfx/geometry/size.h" |
| 29 | 29 |
| 30 using std::set; | 30 using std::set; |
| 31 using std::string; | 31 using std::string; |
| 32 using std::vector; | 32 using std::vector; |
| 33 | 33 |
| 34 namespace cc { | 34 namespace cc { |
| 35 | 35 |
| 36 OutputSurface::OutputSurface(scoped_refptr<ContextProvider> context_provider) | 36 OutputSurface::OutputSurface( |
| 37 const scoped_refptr<ContextProvider>& context_provider) |
| 37 : client_(NULL), | 38 : client_(NULL), |
| 38 context_provider_(context_provider), | 39 context_provider_(context_provider), |
| 39 device_scale_factor_(-1), | 40 device_scale_factor_(-1), |
| 40 external_stencil_test_enabled_(false), | 41 external_stencil_test_enabled_(false), |
| 41 weak_ptr_factory_(this) { | 42 weak_ptr_factory_(this) { |
| 42 } | 43 } |
| 43 | 44 |
| 44 OutputSurface::OutputSurface(scoped_ptr<SoftwareOutputDevice> software_device) | 45 OutputSurface::OutputSurface(scoped_ptr<SoftwareOutputDevice> software_device) |
| 45 : client_(NULL), | 46 : client_(NULL), |
| 46 software_device_(software_device.Pass()), | 47 software_device_(software_device.Pass()), |
| 47 device_scale_factor_(-1), | 48 device_scale_factor_(-1), |
| 48 external_stencil_test_enabled_(false), | 49 external_stencil_test_enabled_(false), |
| 49 weak_ptr_factory_(this) { | 50 weak_ptr_factory_(this) { |
| 50 } | 51 } |
| 51 | 52 |
| 52 OutputSurface::OutputSurface(scoped_refptr<ContextProvider> context_provider, | 53 OutputSurface::OutputSurface( |
| 53 scoped_ptr<SoftwareOutputDevice> software_device) | 54 const scoped_refptr<ContextProvider>& context_provider, |
| 55 scoped_ptr<SoftwareOutputDevice> software_device) |
| 54 : client_(NULL), | 56 : client_(NULL), |
| 55 context_provider_(context_provider), | 57 context_provider_(context_provider), |
| 56 software_device_(software_device.Pass()), | 58 software_device_(software_device.Pass()), |
| 57 device_scale_factor_(-1), | 59 device_scale_factor_(-1), |
| 58 external_stencil_test_enabled_(false), | 60 external_stencil_test_enabled_(false), |
| 59 weak_ptr_factory_(this) { | 61 weak_ptr_factory_(this) { |
| 60 } | 62 } |
| 61 | 63 |
| 62 void OutputSurface::CommitVSyncParameters(base::TimeTicks timebase, | 64 void OutputSurface::CommitVSyncParameters(base::TimeTicks timebase, |
| 63 base::TimeDelta interval) { | 65 base::TimeDelta interval) { |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", | 264 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", |
| 263 "bytes_limit_when_visible", policy.bytes_limit_when_visible); | 265 "bytes_limit_when_visible", policy.bytes_limit_when_visible); |
| 264 // Just ignore the memory manager when it says to set the limit to zero | 266 // Just ignore the memory manager when it says to set the limit to zero |
| 265 // bytes. This will happen when the memory manager thinks that the renderer | 267 // bytes. This will happen when the memory manager thinks that the renderer |
| 266 // is not visible (which the renderer knows better). | 268 // is not visible (which the renderer knows better). |
| 267 if (policy.bytes_limit_when_visible) | 269 if (policy.bytes_limit_when_visible) |
| 268 client_->SetMemoryPolicy(policy); | 270 client_->SetMemoryPolicy(policy); |
| 269 } | 271 } |
| 270 | 272 |
| 271 } // namespace cc | 273 } // namespace cc |
| OLD | NEW |