OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 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 #ifndef CC_SURFACES_SURFACE_REF_H_ | |
6 #define CC_SURFACES_SURFACE_REF_H_ | |
7 | |
8 #include "cc/output/compositor_frame_metadata.h" | |
9 #include "cc/surfaces/surface_ref_base.h" | |
10 #include "cc/surfaces/surface_sequence.h" | |
11 #include "cc/surfaces/surface_sequence_generator.h" | |
12 #include "cc/trees/layer_tree_host.h" | |
13 | |
14 namespace cc { | |
15 | |
16 template <class T> | |
17 class SurfaceRefWithSequence : public SurfaceRefBase<T> { | |
18 protected: | |
19 void BlockImpl() override { | |
Fady Samuel
2016/11/30 19:51:29
Why is this called block?
| |
20 DCHECK(this->host()); | |
21 seq_ = this->host()->GetSurfaceSequenceGenerator()->CreateSurfaceSequence(); | |
22 DCHECK(seq_.is_valid()); | |
23 RequireSequence(seq_); | |
24 } | |
25 | |
26 void AllowImpl() override { | |
Fady Samuel
2016/11/30 19:51:29
Why is this called allow?
| |
27 DCHECK(seq_.is_valid()); | |
28 SatisfySequence(seq_); | |
29 } | |
30 | |
31 virtual void RequireSequence(const SurfaceSequence&) = 0; | |
32 virtual void SatisfySequence(const SurfaceSequence&) = 0; | |
33 | |
34 void DelegateLockImpl(CompositorFrameMetadata* metadata) override { | |
Fady Samuel
2016/11/30 19:51:29
Why is this called DelegateLockImpl? I don't under
| |
35 DCHECK(seq_.is_valid()); | |
36 metadata->satisfies_sequences.push_back(seq_.sequence); | |
37 } | |
38 | |
39 private: | |
40 SurfaceSequence seq_; | |
41 }; | |
42 | |
43 } // namespace cc | |
44 | |
45 #endif // CC_SURFACES_SURFACE_REF_H_ | |
OLD | NEW |