| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 uint64_t share_group_tracing_guid_; | 114 uint64_t share_group_tracing_guid_; |
| 115 | 115 |
| 116 DISALLOW_COPY_AND_ASSIGN(SkiaGpuTraceMemoryDump); | 116 DISALLOW_COPY_AND_ASSIGN(SkiaGpuTraceMemoryDump); |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 } // namespace | 119 } // namespace |
| 120 | 120 |
| 121 OutputSurface::OutputSurface( | 121 OutputSurface::OutputSurface( |
| 122 scoped_refptr<ContextProvider> context_provider, | 122 scoped_refptr<ContextProvider> context_provider, |
| 123 scoped_refptr<ContextProvider> worker_context_provider, | 123 scoped_refptr<ContextProvider> worker_context_provider, |
| 124 scoped_refptr<VulkanContextProvider> vulkan_context_provider, |
| 124 std::unique_ptr<SoftwareOutputDevice> software_device) | 125 std::unique_ptr<SoftwareOutputDevice> software_device) |
| 125 : context_provider_(std::move(context_provider)), | 126 : client_(NULL), |
| 127 context_provider_(std::move(context_provider)), |
| 126 worker_context_provider_(std::move(worker_context_provider)), | 128 worker_context_provider_(std::move(worker_context_provider)), |
| 129 vulkan_context_provider_(vulkan_context_provider), |
| 127 software_device_(std::move(software_device)), | 130 software_device_(std::move(software_device)), |
| 131 device_scale_factor_(-1), |
| 132 has_alpha_(true), |
| 133 external_stencil_test_enabled_(false), |
| 128 weak_ptr_factory_(this) { | 134 weak_ptr_factory_(this) { |
| 129 client_thread_checker_.DetachFromThread(); | 135 client_thread_checker_.DetachFromThread(); |
| 130 } | 136 } |
| 131 | 137 |
| 138 OutputSurface::OutputSurface(scoped_refptr<ContextProvider> context_provider) |
| 139 : OutputSurface(std::move(context_provider), |
| 140 nullptr, |
| 141 nullptr, |
| 142 nullptr) { |
| 143 } |
| 144 |
| 132 OutputSurface::OutputSurface( | 145 OutputSurface::OutputSurface( |
| 133 scoped_refptr<VulkanContextProvider> vulkan_context_provider) | 146 scoped_refptr<ContextProvider> context_provider, |
| 134 : vulkan_context_provider_(vulkan_context_provider), | 147 scoped_refptr<ContextProvider> worker_context_provider) |
| 135 weak_ptr_factory_(this) { | 148 : OutputSurface(std::move(context_provider), |
| 136 client_thread_checker_.DetachFromThread(); | 149 std::move(worker_context_provider), |
| 150 nullptr, |
| 151 nullptr) { |
| 152 } |
| 153 |
| 154 OutputSurface::OutputSurface( |
| 155 std::unique_ptr<SoftwareOutputDevice> software_device) |
| 156 : OutputSurface(nullptr, |
| 157 nullptr, |
| 158 nullptr, |
| 159 std::move(software_device)) { |
| 160 } |
| 161 |
| 162 OutputSurface::OutputSurface( |
| 163 scoped_refptr<ContextProvider> context_provider, |
| 164 std::unique_ptr<SoftwareOutputDevice> software_device) |
| 165 : OutputSurface(std::move(context_provider), |
| 166 nullptr, |
| 167 nullptr, |
| 168 std::move(software_device)) { |
| 137 } | 169 } |
| 138 | 170 |
| 139 // Forwarded to OutputSurfaceClient | 171 // Forwarded to OutputSurfaceClient |
| 140 void OutputSurface::SetNeedsRedrawRect(const gfx::Rect& damage_rect) { | 172 void OutputSurface::SetNeedsRedrawRect(const gfx::Rect& damage_rect) { |
| 141 TRACE_EVENT0("cc", "OutputSurface::SetNeedsRedrawRect"); | 173 TRACE_EVENT0("cc", "OutputSurface::SetNeedsRedrawRect"); |
| 142 client_->SetNeedsRedrawRect(damage_rect); | 174 client_->SetNeedsRedrawRect(damage_rect); |
| 143 } | 175 } |
| 144 | 176 |
| 145 void OutputSurface::ReclaimResources(const CompositorFrameAck* ack) { | 177 void OutputSurface::ReclaimResources(const CompositorFrameAck* ack) { |
| 146 client_->ReclaimResources(ack); | 178 client_->ReclaimResources(ack); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 if (context_provider_.get()) { | 360 if (context_provider_.get()) { |
| 329 context_provider_->SetLostContextCallback( | 361 context_provider_->SetLostContextCallback( |
| 330 ContextProvider::LostContextCallback()); | 362 ContextProvider::LostContextCallback()); |
| 331 } | 363 } |
| 332 context_provider_ = nullptr; | 364 context_provider_ = nullptr; |
| 333 client_ = nullptr; | 365 client_ = nullptr; |
| 334 weak_ptr_factory_.InvalidateWeakPtrs(); | 366 weak_ptr_factory_.InvalidateWeakPtrs(); |
| 335 } | 367 } |
| 336 | 368 |
| 337 } // namespace cc | 369 } // namespace cc |
| OLD | NEW |