Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: src/codec/SkCodecPriv.h

Issue 1061713007: Adding png scanline decoding to kIndex8 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ctableCount requirements Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
*
*/

Powered by Google App Engine
This is Rietveld 408576698