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

Side by Side Diff: src/ports/SkImageGeneratorCG.h

Issue 1718273004: Add an SkImageGeneratorCG (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 80 chars Created 4 years, 9 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/ports.gyp ('k') | src/ports/SkImageGeneratorCG.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 2016 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 "SkTypes.h"
9 #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
10
11 #include "SkCGUtils.h"
12 #include "SkData.h"
13 #include "SkImageGenerator.h"
14 #include "SkTemplates.h"
15
16 class SkImageGeneratorCG : public SkImageGenerator {
17 public:
18 /*
19 * Refs the data if an image generator can be returned. Otherwise does
20 * not affect the data.
21 */
22 static SkImageGenerator* NewFromEncodedCG(SkData* data);
23
24 protected:
25 SkData* onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM) override;
26
27 bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, SkP MColor ctable[],
28 int* ctableCount) override;
29
30 private:
31 /*
32 * Takes ownership of the imageSrc
33 * Refs the data
34 */
35 SkImageGeneratorCG(const SkImageInfo& info, const void* imageSrc, SkData* da ta);
36
37 SkAutoTCallVProc<const void, CFRelease> fImageSrc;
38 SkAutoTUnref<SkData> fData;
39
40 typedef SkImageGenerator INHERITED;
41 };
42
43 #endif //defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
OLDNEW
« no previous file with comments | « gyp/ports.gyp ('k') | src/ports/SkImageGeneratorCG.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698