Chromium Code Reviews| Index: cc/surfaces/sequence_surface_reference_factory.h |
| diff --git a/cc/surfaces/sequence_surface_reference_factory.h b/cc/surfaces/sequence_surface_reference_factory.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..818ebc55c6e0255d9610e45618f4987e311bcb88 |
| --- /dev/null |
| +++ b/cc/surfaces/sequence_surface_reference_factory.h |
| @@ -0,0 +1,44 @@ |
| +// Copyright 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. |
| + |
| +#ifndef CC_SURFACES_SEQUENCE_SURFACE_REFERENCE_FACTORY_H_ |
| +#define CC_SURFACES_SEQUENCE_SURFACE_REFERENCE_FACTORY_H_ |
| + |
| +#include "cc/output/compositor_frame_metadata.h" |
| +#include "cc/surfaces/surface_reference_base.h" |
| +#include "cc/surfaces/surface_reference_factory.h" |
| +#include "cc/surfaces/surfaces_export.h" |
| + |
| +namespace cc { |
| + |
| +// A surface reference factory that generates references which internally |
| +// use SurfaceSequence. |
| +class CC_SURFACES_EXPORT SequenceSurfaceReferenceFactory |
| + : public NON_EXPORTED_BASE(SurfaceReferenceFactory) { |
| + public: |
| + std::unique_ptr<SurfaceReferenceBase> CreateReference( |
| + SurfaceReferenceOwner* owner, |
| + const SurfaceId& surface_id) const override; |
| + |
| + SequenceSurfaceReferenceFactory() = default; |
|
kylechar
2016/12/14 20:51:53
Constructor is usually the first method.
Saman Sami
2016/12/14 21:54:22
Done.
|
| + |
| + protected: |
| + ~SequenceSurfaceReferenceFactory() override = default; |
| + |
| + private: |
| + virtual void RequireSequence(const SurfaceId& surface_id, |
| + const SurfaceSequence& sequence) const = 0; |
| + virtual void SatisfySequence(const SurfaceSequence& sequence) const = 0; |
| + |
| + // SurfaceReferenceFactory implementation: |
| + void DestroyReference(SurfaceReferenceBase* surface_ref, |
| + CompositorFrameMetadata* metadata) const override; |
| + void DestroyReference(SurfaceReferenceBase* surface_ref) const override; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(SequenceSurfaceReferenceFactory); |
| +}; |
| + |
| +} // namespace cc |
| + |
| +#endif // CC_SURFACES_SEQUENCE_SURFACE_REFERENCE_FACTORY_H_ |