Chromium Code Reviews| Index: src/codec/SkCodecPriv.h |
| diff --git a/src/codec/SkCodecPriv.h b/src/codec/SkCodecPriv.h |
| index 726074195daf23d787c0187520baa9a4a97e1e86..2769cec1cd4025f15611d4c9e5d53e65cb2eb47b 100644 |
| --- a/src/codec/SkCodecPriv.h |
| +++ b/src/codec/SkCodecPriv.h |
| @@ -31,6 +31,17 @@ |
| SkSwizzler::GetResult(zeroAlpha, maxAlpha); |
| /* |
| + * returns a scaled dimension based on the original dimension and the sampleSize |
| + * NOTE: we round down here for scaled dimension to match the behavior of SkImageDecoder |
| + */ |
| +static int get_scaled_dimension(int srcDimension, int sampleSize) { |
|
scroggo
2015/09/02 22:45:48
It seems weird to me that we need this for gif, bu
msarett
2015/09/03 17:13:30
We need it for gif because each image frame in a g
|
| + if (sampleSize > srcDimension) { |
| + return 1; |
| + } |
| + return srcDimension / sampleSize; |
| +} |
| + |
| +/* |
| * Returns the first coordinate that we will keep during a scaled decode. |
| * The output can be interpreted as an x-coordinate or a y-coordinate. |
| * |
| @@ -137,7 +148,7 @@ static inline void copy_color_table(const SkImageInfo& dstInfo, SkColorTable* co |
| SkASSERT(nullptr != inputColorPtr); |
| SkASSERT(nullptr != inputColorCount); |
| SkASSERT(nullptr != colorTable); |
| - memcpy(inputColorPtr, colorTable->readColors(), *inputColorCount * 4); |
| + memcpy(inputColorPtr, colorTable->readColors(), *inputColorCount * sizeof(SkPMColor)); |
| } |
| } |