OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "cc/surfaces/surface_embedding_base.h" |
| 6 |
| 7 namespace cc { |
| 8 |
| 9 void SurfaceRef::Destroy() { |
| 10 if (!factory_) |
| 11 return; |
| 12 factory_->DestroyReference(this); |
| 13 factory_ = nullptr; |
| 14 } |
| 15 |
| 16 void SurfaceRef::Destroy(CompositorFrameMetadata* metadata) { |
| 17 if (!factory_) |
| 18 return; |
| 19 factory_->DestroyReference(this, metadata); |
| 20 factory_ = nullptr; |
| 21 } |
| 22 |
| 23 bool SurfaceRef::IsDestroyed() const { |
| 24 return factory_ == nullptr; |
| 25 } |
| 26 |
| 27 SurfaceRef::~SurfaceRef() { |
| 28 Destroy(); |
| 29 } |
| 30 |
| 31 SurfaceRef::SurfaceRef(const SurfaceEmbedding* factory) : factory_(factory) {} |
| 32 |
| 33 SequenceSurfaceRef::SequenceSurfaceRef(const SurfaceEmbedding* factory, |
| 34 const SurfaceSequence& seq) |
| 35 : SurfaceRef(factory), seq_(seq) {} |
| 36 |
| 37 } // namespace cc |
OLD | NEW |