Chromium Code Reviews| Index: src/core/SkPixmap.cpp |
| diff --git a/src/core/SkPixmap.cpp b/src/core/SkPixmap.cpp |
| index 7c08fb96bd4c5f394d64c4a534f629e7929706f9..3a0fad2a3936763cbd24f01da041d8be04bb2b55 100644 |
| --- a/src/core/SkPixmap.cpp |
| +++ b/src/core/SkPixmap.cpp |
| @@ -20,6 +20,23 @@ void SkAutoPixmapUnlock::reset(const SkPixmap& pm, void (*unlock)(void*), void* |
| ///////////////////////////////////////////////////////////////////////////////////////////////// |
| +void SkPixmap::reset() { |
| + fPixels = NULL; |
| + fCTable = NULL; |
| + fRowBytes = 0; |
| + fInfo = SkImageInfo::MakeUnknown(); |
| +} |
| + |
| +void SkPixmap::reset(const SkImageInfo& info, const void* addr, size_t rowBytes, SkColorTable* ct) { |
| + if (addr) { |
|
scroggo
2015/05/26 18:30:31
It seems like if addr is NULL, the rest of these a
reed1
2015/05/26 18:45:24
Yea, still "evolving" what I think we should enfor
|
| + SkASSERT(info.validRowBytes(rowBytes)); |
| + } |
| + fPixels = addr; |
| + fCTable = ct; |
| + fRowBytes = rowBytes; |
| + fInfo = info; |
| +} |
| + |
| bool SkPixmap::readPixels(const SkImageInfo& requestedDstInfo, void* dstPixels, size_t dstRB, |
| int x, int y) const { |
| if (kUnknown_SkColorType == requestedDstInfo.colorType()) { |