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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 FROM_HERE, base::Bind(&OutputSurface::OnSwapBuffersComplete, | 241 FROM_HERE, base::Bind(&OutputSurface::OnSwapBuffersComplete, |
242 weak_ptr_factory_.GetWeakPtr())); | 242 weak_ptr_factory_.GetWeakPtr())); |
243 } | 243 } |
244 | 244 |
245 // We don't post tasks bound to the client directly since they might run | 245 // We don't post tasks bound to the client directly since they might run |
246 // after the OutputSurface has been destroyed. | 246 // after the OutputSurface has been destroyed. |
247 void OutputSurface::OnSwapBuffersComplete() { | 247 void OutputSurface::OnSwapBuffersComplete() { |
248 client_->DidSwapBuffersComplete(); | 248 client_->DidSwapBuffersComplete(); |
249 } | 249 } |
250 | 250 |
| 251 void OutputSurface::DidReceiveTextureInUseResponses( |
| 252 const gpu::TextureInUseResponses& responses) { |
| 253 client_->DidReceiveTextureInUseResponses(responses); |
| 254 } |
| 255 |
251 void OutputSurface::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { | 256 void OutputSurface::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { |
252 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", | 257 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", |
253 "bytes_limit_when_visible", policy.bytes_limit_when_visible); | 258 "bytes_limit_when_visible", policy.bytes_limit_when_visible); |
254 // Just ignore the memory manager when it says to set the limit to zero | 259 // Just ignore the memory manager when it says to set the limit to zero |
255 // bytes. This will happen when the memory manager thinks that the renderer | 260 // bytes. This will happen when the memory manager thinks that the renderer |
256 // is not visible (which the renderer knows better). | 261 // is not visible (which the renderer knows better). |
257 if (policy.bytes_limit_when_visible) | 262 if (policy.bytes_limit_when_visible) |
258 client_->SetMemoryPolicy(policy); | 263 client_->SetMemoryPolicy(policy); |
259 } | 264 } |
260 | 265 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 if (context_provider_.get()) { | 333 if (context_provider_.get()) { |
329 context_provider_->SetLostContextCallback( | 334 context_provider_->SetLostContextCallback( |
330 ContextProvider::LostContextCallback()); | 335 ContextProvider::LostContextCallback()); |
331 } | 336 } |
332 context_provider_ = nullptr; | 337 context_provider_ = nullptr; |
333 client_ = nullptr; | 338 client_ = nullptr; |
334 weak_ptr_factory_.InvalidateWeakPtrs(); | 339 weak_ptr_factory_.InvalidateWeakPtrs(); |
335 } | 340 } |
336 | 341 |
337 } // namespace cc | 342 } // namespace cc |
OLD | NEW |