You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
640 B
37 lines
640 B
/*
|
|
* Copyright 2019 Google LLC
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#ifndef SkAutoreleasePool_DEFINED
|
|
#define SkAutoreleasePool_DEFINED
|
|
|
|
/*
|
|
* Helper class for managing an autorelease pool for Metal. On other platforms this will
|
|
* do nothing so there's no need to #ifdef it out.
|
|
*/
|
|
#ifdef SK_METAL
|
|
class AutoreleasePool {
|
|
public:
|
|
AutoreleasePool();
|
|
~AutoreleasePool();
|
|
|
|
void drain();
|
|
|
|
private:
|
|
void* fPool;
|
|
};
|
|
#else
|
|
class AutoreleasePool {
|
|
public:
|
|
AutoreleasePool() {}
|
|
~AutoreleasePool() = default;
|
|
|
|
void drain() {}
|
|
};
|
|
#endif
|
|
|
|
#endif
|