Index: cc/surfaces/surface_embedding.cc |
diff --git a/cc/surfaces/surface_embedding.cc b/cc/surfaces/surface_embedding.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..682fff02c623c4a4b04a29d496b3f16dd82b8495 |
--- /dev/null |
+++ b/cc/surfaces/surface_embedding.cc |
@@ -0,0 +1,31 @@ |
+// Copyright (c) 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "cc/surfaces/surface_embedding.h" |
+ |
+namespace cc { |
+ |
+void SurfaceEmbeddingUsingSequence::DestroyReference( |
+ SurfaceRef* surface_ref, |
+ CompositorFrameMetadata* metadata) const { |
+ SequenceSurfaceRef* ref = static_cast<SequenceSurfaceRef*>(surface_ref); |
Fady Samuel
2016/12/12 16:12:00
nit: Comment explaining why this is safe.
|
+ metadata->satisfies_sequences.push_back(ref->seq().sequence); |
+} |
+ |
+void SurfaceEmbeddingUsingSequence::DestroyReference( |
+ SurfaceRef* surface_ref) const { |
+ SequenceSurfaceRef* ref = static_cast<SequenceSurfaceRef*>(surface_ref); |
Fady Samuel
2016/12/12 16:12:00
nit: comment explaining why this is safe.
|
+ SatisfySequence(ref->seq()); |
Fady Samuel
2016/12/12 16:12:00
Does this need to be a separate method?
Saman Sami
2016/12/12 23:25:30
It's nicer when it is. Someone has already done th
|
+} |
+ |
+SurfaceRefPtr SurfaceEmbeddingUsingSequence::CreateReference( |
+ SurfaceReferenceOwner* owner, |
+ const SurfaceId& id) const { |
+ SurfaceSequence seq = |
+ owner->GetSurfaceSequenceGenerator()->CreateSurfaceSequence(); |
+ RequireSequence(id, seq); |
Fady Samuel
2016/12/12 16:12:00
Does this need to be a separate method? This just
|
+ return base::MakeUnique<SequenceSurfaceRef>(this, seq); |
+} |
+ |
+} // namespace cc |