diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-04-01 23:50:53 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-04-01 23:50:53 +0000 |
commit | f5a9fd0ed5b41776ee632db5d4ddd528a14ae280 (patch) | |
tree | 72cb6c38b53b0e1cded0a51adab7c41ed9dfb7d4 /lazy | |
parent | c19b62f0de592b6810c3f2c7f6315c9707a0f1be (diff) | |
download | src-f5a9fd0ed5b41776ee632db5d4ddd528a14ae280.tar.gz |
Purge SkPurgeableMemoryBlock.
It was an experiment that is no longer used.
R=mtklein@google.com
Author: scroggo@google.com
Review URL: https://codereview.chromium.org/219133004
git-svn-id: http://skia.googlecode.com/svn/trunk/src@14020 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'lazy')
-rw-r--r-- | lazy/SkPurgeableMemoryBlock.h | 94 | ||||
-rw-r--r-- | lazy/SkPurgeableMemoryBlock_common.cpp | 16 |
2 files changed, 0 insertions, 110 deletions
diff --git a/lazy/SkPurgeableMemoryBlock.h b/lazy/SkPurgeableMemoryBlock.h deleted file mode 100644 index 1750ad9d..00000000 --- a/lazy/SkPurgeableMemoryBlock.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2013 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#ifndef SkPurgeableMemoryBlock_DEFINED -#define SkPurgeableMemoryBlock_DEFINED - -#include "SkTypes.h" - -class SkPurgeableMemoryBlock : public SkNoncopyable { - -public: - /** - * Whether or not this platform has an implementation for purgeable memory. - */ - static bool IsSupported(); - - /** - * Create a new purgeable memory block of 'size' bytes. Returns NULL if not supported on this - * platform or on failure. - * @param size Number of bytes requested. - * @return A new block, or NULL on failure. - */ - static SkPurgeableMemoryBlock* Create(size_t size); - -#ifdef SK_DEBUG - /** - * Whether the platform supports one shot purge of all unpinned blocks. If so, - * PurgeAllUnpinnedBlocks will be used to test a purge. Otherwise, purge will be called on - * individual blocks. - */ - static bool PlatformSupportsPurgingAllUnpinnedBlocks(); - - /** - * Purge all unpinned blocks at once, if the platform supports it. - */ - static bool PurgeAllUnpinnedBlocks(); - - // If PlatformSupportsPurgingAllUnpinnedBlocks returns true, this will not be called, so it can - // simply return false. - bool purge(); - - bool isPinned() const { return fPinned; } -#endif - - ~SkPurgeableMemoryBlock(); - - /** - * Output parameter for pin(), stating whether the data has been retained. - */ - enum PinResult { - /** - * The data has been purged, or this is the first call to pin. - */ - kUninitialized_PinResult, - - /** - * The data has been retained. The memory contains the same data it held when unpin() was - * called. - */ - kRetained_PinResult, - }; - - /** - * Pin the memory for use. Must not be called while already pinned. - * @param PinResult Whether the data was retained. Ignored on failure. - * @return Pointer to the pinned data on success. NULL on failure. - */ - void* pin(PinResult*); - - /** - * Unpin the data so it can be purged if necessary. - */ - void unpin(); - -private: - void* fAddr; - size_t fSize; - bool fPinned; -#ifdef SK_BUILD_FOR_ANDROID - int fFD; -#endif - - // Unimplemented default constructor is private, to prevent manual creation. - SkPurgeableMemoryBlock(); - - // The correct way to create a new one is from the static Create. - SkPurgeableMemoryBlock(size_t); -}; - -#endif // SkPurgeableMemoryBlock_DEFINED diff --git a/lazy/SkPurgeableMemoryBlock_common.cpp b/lazy/SkPurgeableMemoryBlock_common.cpp deleted file mode 100644 index a549c46e..00000000 --- a/lazy/SkPurgeableMemoryBlock_common.cpp +++ /dev/null @@ -1,16 +0,0 @@ -/* - * 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)); -} |