OLD | NEW |
(Empty) | |
| 1 // Copyright 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 #ifndef CC_SURFACES_SURFACE_REFERENCE_FACTORY_H_ |
| 6 #define CC_SURFACES_SURFACE_REFERENCE_FACTORY_H_ |
| 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 #include "cc/surfaces/surface_id.h" |
| 10 #include "cc/surfaces/surface_reference_base.h" |
| 11 #include "cc/surfaces/surface_reference_owner.h" |
| 12 |
| 13 namespace cc { |
| 14 |
| 15 class SurfaceReferenceBase; |
| 16 class CompositorFrameMetadata; |
| 17 |
| 18 class SurfaceReferenceFactory |
| 19 : public base::RefCounted<SurfaceReferenceFactory> { |
| 20 public: |
| 21 virtual std::unique_ptr<SurfaceReferenceBase> CreateReference( |
| 22 SurfaceReferenceOwner* owner, |
| 23 const SurfaceId& surface_id) const = 0; |
| 24 |
| 25 protected: |
| 26 virtual ~SurfaceReferenceFactory() = default; |
| 27 |
| 28 private: |
| 29 friend class base::RefCounted<SurfaceReferenceFactory>; |
| 30 virtual void DestroyReference(SurfaceReferenceBase* surface_ref) const = 0; |
| 31 virtual void DestroyReference(SurfaceReferenceBase* surface_ref, |
| 32 CompositorFrameMetadata* metadata) const = 0; |
| 33 friend class SurfaceReferenceBase; |
| 34 }; |
| 35 |
| 36 } // namespace cc |
| 37 |
| 38 #endif // CC_SURFACES_SURFACE_REFERENCE_FACTORY_H_ |
OLD | NEW |