aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPixmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkPixmap.cpp')
-rw-r--r--src/core/SkPixmap.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/SkPixmap.cpp b/src/core/SkPixmap.cpp
index 7c08fb96bd..3a0fad2a39 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) {
+ 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()) {