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

Side by Side Diff: src/codec/SkCodecImageGenerator.h

Issue 1487683004: Create an SkCodecImageGenerator (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move to src/codec and codec.gyp Created 4 years, 11 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
« no previous file with comments | « gyp/codec.gyp ('k') | src/codec/SkCodecImageGenerator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "SkData.h"
10 #include "SkImageGenerator.h"
11
12 class SkCodecImageGenerator : public SkImageGenerator {
13 public:
14 /*
15 * If this data represents an encoded image that we know how to decode,
16 * return an SkCodecImageGenerator. Otherwise return nullptr.
17 *
18 * Refs the data if an image generator can be returned. Otherwise does
19 * not affect the data.
20 */
21 static SkImageGenerator* NewFromEncodedCodec(SkData* data);
22
23 protected:
24 SkData* onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM) override;
25
26 bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, SkP MColor ctable[],
27 int* ctableCount) override;
28
29 bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3],
30 SkYUVColorSpace* colorSpace) override;
31
32 private:
33 /*
34 * Takes ownership of codec
35 * Refs the data
36 */
37 SkCodecImageGenerator(SkCodec* codec, SkData* data);
38
39 SkAutoTDelete<SkCodec> fCodec;
40 SkAutoTUnref<SkData> fData;
41
42 typedef SkImageGenerator INHERITED;
43 };
OLDNEW
« no previous file with comments | « gyp/codec.gyp ('k') | src/codec/SkCodecImageGenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698