blob: 0582404f32e2fc496877640b382be17112add25a [file] [log] [blame]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001/*
2 * Copyright 2019 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkAutoreleasePool_DEFINED
9#define SkAutoreleasePool_DEFINED
10
11/*
12 * Helper class for managing an autorelease pool for Metal. On other platforms this will
13 * do nothing so there's no need to #ifdef it out.
14 */
15#ifdef SK_METAL
16class AutoreleasePool {
17public:
18 AutoreleasePool();
19 ~AutoreleasePool();
20
21 void drain();
22
23private:
24 void* fPool;
25};
26#else
27class AutoreleasePool {
28public:
29 AutoreleasePool() {}
30 ~AutoreleasePool() = default;
31
32 void drain() {}
33};
34#endif
35
36#endif