Chromium Code Reviews| Index: include/codec/SkScaledCodec.h |
| diff --git a/include/codec/SkScaledCodec.h b/include/codec/SkScaledCodec.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d71101a24c6963ab237dbbaa620b8ab57d192257 |
| --- /dev/null |
| +++ b/include/codec/SkScaledCodec.h |
| @@ -0,0 +1,54 @@ |
| +/* |
| + * Copyright 2015 Google Inc. |
| + * |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +#include "SkCodec.h" |
| +#include "SkColorTable.h" |
| +#include "SkEncodedFormat.h" |
| +#include "SkImageInfo.h" |
| +#include "SkRefCnt.h" |
| +#include "SkSwizzler.h" |
| +#include "SkCodec_libpng.h" |
| +#include "SkScanlineDecoder.h" |
| + |
| +class SkScanlineDecoder; |
| +class SkStream; |
| + |
| +class SkScaledCodec : public SkCodec { |
| +public: |
| + static SkCodec* NewFromStream(SkStream*); |
|
scroggo
2015/07/27 15:09:19
This (and other functions) should be indented four
emmaleer
2015/07/27 18:31:38
Acknowledged.
|
| + static SkCodec* NewFromData(SkData*); |
| + |
| + virtual ~SkScaledCodec(); |
| + |
| +protected: |
| + // Recommend a set of destination dimensions given a requested scale |
| + SkISize onGetScaledDimensions(float desiredScale) const override; |
| + |
| + Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&, SkPMColor*, int*) |
| + override; |
| + SkEncodedFormat onGetEncodedFormat() const override{ |
| + return fCodec->getEncodedFormat(); |
| + } |
| + |
| + SkScanlineDecoder* onGetScanlineDecoder(const SkImageInfo& dstInfo, const Options& options, |
| + SkPMColor ctable[], int* ctableCount) override{ |
| + return fCodec->getScanlineDecoder(dstInfo, &options, ctable, ctableCount); |
| + } |
| + bool onReallyHasAlpha() const override{ |
| + return fCodec->reallyHasAlpha(); |
| + } |
| + |
| +private: |
| + SkAutoTDelete<SkCodec> fCodec; |
|
scroggo
2015/07/27 15:09:19
These fields should also be indented only four cha
emmaleer
2015/07/27 18:31:38
Acknowledged.
|
| + int fSampleY; // step between Y samples. Is constant |
|
scroggo
2015/07/27 15:09:19
These variables do not appear to be const.
They a
emmaleer
2015/07/27 18:31:38
Acknowledged.
|
| + int fY0; // first Y coord (scanline) to sample. Is constant |
| + |
| + SkScaledCodec(SkCodec*); |
| + |
| + |
| + typedef SkCodec INHERITED; |
| +}; |