| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkDiscardableMemory_DEFINED | 8 #ifndef SkDiscardableMemory_DEFINED |
| 9 #define SkDiscardableMemory_DEFINED | 9 #define SkDiscardableMemory_DEFINED |
| 10 | 10 |
| 11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
| 12 | 12 |
| 13 /** | 13 /** |
| 14 * Interface for discardable memory. Implementation is provided by the | 14 * Interface for discardable memory. Implementation is provided by the |
| 15 * embedder. | 15 * embedder. |
| 16 */ | 16 */ |
| 17 class SkDiscardableMemory { | 17 class SK_API SkDiscardableMemory { |
| 18 | 18 |
| 19 public: | 19 public: |
| 20 /** | 20 /** |
| 21 * Factory method that creates, initializes and locks an SkDiscardableMemor
y | 21 * Factory method that creates, initializes and locks an SkDiscardableMemor
y |
| 22 * object. If either of these steps fails, a NULL pointer will be returned. | 22 * object. If either of these steps fails, a NULL pointer will be returned. |
| 23 */ | 23 */ |
| 24 static SkDiscardableMemory* Create(size_t bytes); | 24 static SkDiscardableMemory* Create(size_t bytes); |
| 25 | 25 |
| 26 /** Must not be called while locked. | 26 /** Must not be called while locked. |
| 27 */ | 27 */ |
| (...skipping 17 matching lines...) Expand all Loading... |
| 45 virtual void* data() = 0; | 45 virtual void* data() = 0; |
| 46 | 46 |
| 47 /** | 47 /** |
| 48 * Unlock the memory so that it can be purged by the system. Must be called | 48 * Unlock the memory so that it can be purged by the system. Must be called |
| 49 * after every successful lock call. | 49 * after every successful lock call. |
| 50 */ | 50 */ |
| 51 virtual void unlock() = 0; | 51 virtual void unlock() = 0; |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 #endif | 54 #endif |
| OLD | NEW |