diff options
author | 2013-03-15 18:08:09 +0000 | |
---|---|---|
committer | 2013-03-15 18:08:09 +0000 | |
commit | d9ef3a21d4b4c51c4798547505a76a891d50673a (patch) | |
tree | d427c051cb4077571a171b7de8f9a46c829afd2f /src/lazy/SkPurgeableMemoryBlock_common.cpp | |
parent | 35e15633805081c8978c18910cb25ed53f06f6c2 (diff) |
Create a platform-dependent object for accessing purgeable memory.
Siphoned off from https://codereview.chromium.org/12433020/
Create a Skia class which can provide purgeable memory in a platform-
dependent way. Include an implementation for Ashmem and Mac/iOS.
Review URL: https://codereview.chromium.org/12645006
git-svn-id: http://skia.googlecode.com/svn/trunk@8176 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/lazy/SkPurgeableMemoryBlock_common.cpp')
-rw-r--r-- | src/lazy/SkPurgeableMemoryBlock_common.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lazy/SkPurgeableMemoryBlock_common.cpp b/src/lazy/SkPurgeableMemoryBlock_common.cpp new file mode 100644 index 0000000000..6ac9b822c6 --- /dev/null +++ b/src/lazy/SkPurgeableMemoryBlock_common.cpp @@ -0,0 +1,17 @@ +/* + * Copyright 2013 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "SkPurgeableMemoryBlock.h" + +SkPurgeableMemoryBlock* SkPurgeableMemoryBlock::Create(size_t size) { + SkASSERT(IsSupported()); + if (!IsSupported()) { + return NULL; + } + return SkNEW_ARGS(SkPurgeableMemoryBlock, (size)); +} + |