Index: src/codec/SkCodecPriv.h |
diff --git a/src/codec/SkCodecPriv.h b/src/codec/SkCodecPriv.h |
index da7574677c375a154b3a1ca6a78f472f1e3a0e13..98b2d3aae5f01c52fd63232c1d558780512d11b6 100644 |
--- a/src/codec/SkCodecPriv.h |
+++ b/src/codec/SkCodecPriv.h |
@@ -8,9 +8,11 @@ |
#ifndef SkCodecPriv_DEFINED |
#define SkCodecPriv_DEFINED |
+#include "SkColorTable.h" |
#include "SkImageInfo.h" |
#include "SkSwizzler.h" |
#include "SkTypes.h" |
+#include "SkUtils.h" |
/* |
* |
@@ -30,6 +32,21 @@ |
/* |
* |
+ * Copy the codec color table back to the client when kIndex8 color type is requested |
+ * |
+ */ |
+static inline void copy_color_table(const SkImageInfo& dstInfo, SkColorTable* colorTable, |
+ SkPMColor* inputColorPtr, int* inputColorCount) { |
+ if (kIndex_8_SkColorType == dstInfo.colorType()) { |
+ SkASSERT(NULL != inputColorPtr); |
+ SkASSERT(NULL != inputColorCount); |
+ SkASSERT(NULL != colorTable); |
+ sk_memcpy32(inputColorPtr, colorTable->readColors(), *inputColorCount); |
+ } |
+} |
+ |
+/* |
+ * |
* Compute row bytes for an image using pixels per byte |
* |
*/ |