Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: cc/surfaces/surface_embedding_base.cc

Issue 2514033002: Introducing SurfaceReferenceFactory (Closed)
Patch Set: ref Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698