| 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 28 matching lines...) Expand all Loading... |
| 39 } | 39 } |
| 40 | 40 |
| 41 namespace cc { | 41 namespace cc { |
| 42 | 42 |
| 43 OutputSurface::OutputSurface( | 43 OutputSurface::OutputSurface( |
| 44 const scoped_refptr<ContextProvider>& context_provider) | 44 const scoped_refptr<ContextProvider>& context_provider) |
| 45 : client_(NULL), | 45 : client_(NULL), |
| 46 context_provider_(context_provider), | 46 context_provider_(context_provider), |
| 47 device_scale_factor_(-1), | 47 device_scale_factor_(-1), |
| 48 external_stencil_test_enabled_(false), | 48 external_stencil_test_enabled_(false), |
| 49 weak_ptr_factory_(this), | 49 gpu_latency_history_(kGpuLatencyHistorySize), |
| 50 gpu_latency_history_(kGpuLatencyHistorySize) { | 50 weak_ptr_factory_(this) { |
| 51 } | 51 } |
| 52 | 52 |
| 53 OutputSurface::OutputSurface(scoped_ptr<SoftwareOutputDevice> software_device) | 53 OutputSurface::OutputSurface(scoped_ptr<SoftwareOutputDevice> software_device) |
| 54 : client_(NULL), | 54 : client_(NULL), |
| 55 software_device_(software_device.Pass()), | 55 software_device_(software_device.Pass()), |
| 56 device_scale_factor_(-1), | 56 device_scale_factor_(-1), |
| 57 external_stencil_test_enabled_(false), | 57 external_stencil_test_enabled_(false), |
| 58 weak_ptr_factory_(this), | 58 gpu_latency_history_(kGpuLatencyHistorySize), |
| 59 gpu_latency_history_(kGpuLatencyHistorySize) { | 59 weak_ptr_factory_(this) { |
| 60 } | 60 } |
| 61 | 61 |
| 62 OutputSurface::OutputSurface( | 62 OutputSurface::OutputSurface( |
| 63 const scoped_refptr<ContextProvider>& context_provider, | 63 const scoped_refptr<ContextProvider>& context_provider, |
| 64 scoped_ptr<SoftwareOutputDevice> software_device) | 64 scoped_ptr<SoftwareOutputDevice> software_device) |
| 65 : client_(NULL), | 65 : client_(NULL), |
| 66 context_provider_(context_provider), | 66 context_provider_(context_provider), |
| 67 software_device_(software_device.Pass()), | 67 software_device_(software_device.Pass()), |
| 68 device_scale_factor_(-1), | 68 device_scale_factor_(-1), |
| 69 external_stencil_test_enabled_(false), | 69 external_stencil_test_enabled_(false), |
| 70 weak_ptr_factory_(this), | 70 gpu_latency_history_(kGpuLatencyHistorySize), |
| 71 gpu_latency_history_(kGpuLatencyHistorySize) { | 71 weak_ptr_factory_(this) { |
| 72 } | 72 } |
| 73 | 73 |
| 74 void OutputSurface::CommitVSyncParameters(base::TimeTicks timebase, | 74 void OutputSurface::CommitVSyncParameters(base::TimeTicks timebase, |
| 75 base::TimeDelta interval) { | 75 base::TimeDelta interval) { |
| 76 TRACE_EVENT2("cc", | 76 TRACE_EVENT2("cc", |
| 77 "OutputSurface::CommitVSyncParameters", | 77 "OutputSurface::CommitVSyncParameters", |
| 78 "timebase", | 78 "timebase", |
| 79 (timebase - base::TimeTicks()).InSecondsF(), | 79 (timebase - base::TimeTicks()).InSecondsF(), |
| 80 "interval", | 80 "interval", |
| 81 interval.InSecondsF()); | 81 interval.InSecondsF()); |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", | 360 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", |
| 361 "bytes_limit_when_visible", policy.bytes_limit_when_visible); | 361 "bytes_limit_when_visible", policy.bytes_limit_when_visible); |
| 362 // Just ignore the memory manager when it says to set the limit to zero | 362 // Just ignore the memory manager when it says to set the limit to zero |
| 363 // bytes. This will happen when the memory manager thinks that the renderer | 363 // bytes. This will happen when the memory manager thinks that the renderer |
| 364 // is not visible (which the renderer knows better). | 364 // is not visible (which the renderer knows better). |
| 365 if (policy.bytes_limit_when_visible) | 365 if (policy.bytes_limit_when_visible) |
| 366 client_->SetMemoryPolicy(policy); | 366 client_->SetMemoryPolicy(policy); |
| 367 } | 367 } |
| 368 | 368 |
| 369 } // namespace cc | 369 } // namespace cc |
| OLD | NEW |