Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 SkPixmap_DEFINED | 8 #ifndef SkPixmap_DEFINED |
| 9 #define SkPixmap_DEFINED | 9 #define SkPixmap_DEFINED |
| 10 | 10 |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 215 * alloc/tryAlloc was called. | 215 * alloc/tryAlloc was called. |
| 216 */ | 216 */ |
| 217 static size_t AllocSize(const SkImageInfo& info, size_t* rowBytes); | 217 static size_t AllocSize(const SkImageInfo& info, size_t* rowBytes); |
| 218 | 218 |
| 219 /** | 219 /** |
| 220 * Returns an SkData object wrapping the allocated pixels memory, and reset s the pixmap. | 220 * Returns an SkData object wrapping the allocated pixels memory, and reset s the pixmap. |
| 221 * If the storage hasn't been allocated, the result is NULL. | 221 * If the storage hasn't been allocated, the result is NULL. |
| 222 */ | 222 */ |
| 223 const SkData* SK_WARN_UNUSED_RESULT detachPixelsAsData(); | 223 const SkData* SK_WARN_UNUSED_RESULT detachPixelsAsData(); |
| 224 | 224 |
| 225 void release(); | |
|
reed1
2016/03/15 03:13:03
Docs? What does this do differently from reset()?
robertphillips
2016/03/16 15:31:58
Done.
| |
| 226 | |
| 225 // We wrap these so we can clear our internal storage | 227 // We wrap these so we can clear our internal storage |
| 226 | 228 |
| 227 void reset() { | 229 void reset() { |
| 228 this->freeStorage(); | 230 this->freeStorage(); |
| 229 this->INHERITED::reset(); | 231 this->INHERITED::reset(); |
| 230 } | 232 } |
| 231 void reset(const SkImageInfo& info, const void* addr, size_t rb, SkColorTabl e* ctable = NULL) { | 233 void reset(const SkImageInfo& info, const void* addr, size_t rb, SkColorTabl e* ctable = NULL) { |
| 232 this->freeStorage(); | 234 this->freeStorage(); |
| 233 this->INHERITED::reset(info, addr, rb, ctable); | 235 this->INHERITED::reset(info, addr, rb, ctable); |
| 234 } | 236 } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 294 private: | 296 private: |
| 295 void (*fUnlockProc)(void*); | 297 void (*fUnlockProc)(void*); |
| 296 void* fUnlockContext; | 298 void* fUnlockContext; |
| 297 SkPixmap fPixmap; | 299 SkPixmap fPixmap; |
| 298 bool fIsLocked; | 300 bool fIsLocked; |
| 299 | 301 |
| 300 friend class SkBitmap; | 302 friend class SkBitmap; |
| 301 }; | 303 }; |
| 302 | 304 |
| 303 #endif | 305 #endif |
| OLD | NEW |