| 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/compositor_frame_sink.h" | 5 #include "cc/output/compositor_frame_sink.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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 if (context_provider_.get()) { | 69 if (context_provider_.get()) { |
| 70 context_provider_->SetLostContextCallback( | 70 context_provider_->SetLostContextCallback( |
| 71 ContextProvider::LostContextCallback()); | 71 ContextProvider::LostContextCallback()); |
| 72 } | 72 } |
| 73 // Destroy the ContextProvider on the bound thread. | 73 // Destroy the ContextProvider on the bound thread. |
| 74 context_provider_ = nullptr; | 74 context_provider_ = nullptr; |
| 75 client_ = nullptr; | 75 client_ = nullptr; |
| 76 } | 76 } |
| 77 | 77 |
| 78 // We don't post tasks bound to the client directly since they might run | |
| 79 // after the CompositorFrameSink has been destroyed. | |
| 80 void CompositorFrameSink::OnSwapBuffersComplete() { | |
| 81 client_->DidSwapBuffersComplete(); | |
| 82 } | |
| 83 | |
| 84 void CompositorFrameSink::DidLoseCompositorFrameSink() { | 78 void CompositorFrameSink::DidLoseCompositorFrameSink() { |
| 85 TRACE_EVENT0("cc", "CompositorFrameSink::DidLoseCompositorFrameSink"); | 79 TRACE_EVENT0("cc", "CompositorFrameSink::DidLoseCompositorFrameSink"); |
| 86 client_->DidLoseCompositorFrameSink(); | 80 client_->DidLoseCompositorFrameSink(); |
| 87 } | 81 } |
| 88 | 82 |
| 89 } // namespace cc | 83 } // namespace cc |
| OLD | NEW |