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

Side by Side Diff: include/codec/SkScaledCodec.h

Issue 1260673002: SkScaledCodec class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "SkCodec.h"
9 #include "SkColorTable.h"
10 #include "SkEncodedFormat.h"
11 #include "SkImageInfo.h"
12 #include "SkRefCnt.h"
13 #include "SkSwizzler.h"
14 #include "SkCodec_libpng.h"
15 #include "SkScanlineDecoder.h"
16
17 class SkScanlineDecoder;
18 class SkStream;
19
20 class SkScaledCodec : public SkCodec {
21 public:
22 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.
23 static SkCodec* NewFromData(SkData*);
24
25 virtual ~SkScaledCodec();
26
27 protected:
28 // Recommend a set of destination dimensions given a requested scale
29 SkISize onGetScaledDimensions(float desiredScale) const override;
30
31 Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&, Sk PMColor*, int*)
32 override;
33 SkEncodedFormat onGetEncodedFormat() const override{
34 return fCodec->getEncodedFormat();
35 }
36
37 SkScanlineDecoder* onGetScanlineDecoder(const SkImageInfo& dstInfo, const Op tions& options,
38 SkPMColor ctable[], int* ctableCount ) override{
39 return fCodec->getScanlineDecoder(dstInfo, &options, ctable, ctableCount );
40 }
41 bool onReallyHasAlpha() const override{
42 return fCodec->reallyHasAlpha();
43 }
44
45 private:
46 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.
47 int fSampleY; // step between Y samples. Is const ant
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.
48 int fY0; // first Y coord (scanline) to samp le. Is constant
49
50 SkScaledCodec(SkCodec*);
51
52
53 typedef SkCodec INHERITED;
54 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698