OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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_SCOPED_SURFACE_REFERENCE_H_ |
| 6 #define CC_SURFACES_SCOPED_SURFACE_REFERENCE_H_ |
| 7 |
| 8 #include "cc/surfaces/scoped_surface_reference_base.h" |
| 9 #include "cc/surfaces/surface_reference.h" |
| 10 #include "cc/surfaces/surface_reference_factory.h" |
| 11 |
| 12 namespace cc { |
| 13 |
| 14 // A SurfaceReference that automatically removes itself when it goes out of |
| 15 // scope. |
| 16 class ScopedSurfaceReference : public ScopedSurfaceReferenceBase { |
| 17 public: |
| 18 ScopedSurfaceReference(scoped_refptr<const SurfaceReferenceFactory> factory, |
| 19 const SurfaceReference& surface_reference); |
| 20 |
| 21 ~ScopedSurfaceReference() override; |
| 22 |
| 23 const SurfaceReference& surface_reference() const { |
| 24 return surface_reference_; |
| 25 } |
| 26 |
| 27 private: |
| 28 const SurfaceReference surface_reference_; |
| 29 |
| 30 DISALLOW_COPY_AND_ASSIGN(ScopedSurfaceReference); |
| 31 }; |
| 32 |
| 33 } // namespace cc |
| 34 |
| 35 #endif // CC_SURFACES_SCOPED_SURFACE_REFERENCE_H_ |
OLD | NEW |