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

Side by Side Diff: include/core/SkImageGenerator.h

Issue 834633006: add ImageGenerator::NewFromData to porting layer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add helper for SkInstallDiscardablePixelRef(SkData*, ...) Created 5 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 | « include/core/SkImage.h ('k') | samplecode/SampleEncode.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkImageGenerator_DEFINED 8 #ifndef SkImageGenerator_DEFINED
9 #define SkImageGenerator_DEFINED 9 #define SkImageGenerator_DEFINED
10 10
(...skipping 17 matching lines...) Expand all
28 * SkDELETE() on the generator. Therefore, generator should be 28 * SkDELETE() on the generator. Therefore, generator should be
29 * allocated with SkNEW() or SkNEW_ARGS(). 29 * allocated with SkNEW() or SkNEW_ARGS().
30 * 30 *
31 * @param destination Upon success, this bitmap will be 31 * @param destination Upon success, this bitmap will be
32 * configured and have a pixelref installed. 32 * configured and have a pixelref installed.
33 * 33 *
34 * @return true iff successful. 34 * @return true iff successful.
35 */ 35 */
36 SK_API bool SkInstallDiscardablePixelRef(SkImageGenerator*, SkBitmap* destinatio n); 36 SK_API bool SkInstallDiscardablePixelRef(SkImageGenerator*, SkBitmap* destinatio n);
37 37
38 /**
39 * On success, installs a discradable pixelref into destination, based on encod ed data.
scroggo 2015/01/07 21:47:45 discardable*
40 * Regardless of success or failure, the caller must still balance their owners hip of encoded.
41 */
42 SK_API bool SkInstallDiscardablePixelRef(SkData* encoded, SkBitmap* destination) ;
38 43
39 /** 44 /**
40 * An interface that allows a purgeable PixelRef (such as a 45 * An interface that allows a purgeable PixelRef (such as a
41 * SkDiscardablePixelRef) to decode and re-decode an image as needed. 46 * SkDiscardablePixelRef) to decode and re-decode an image as needed.
42 */ 47 */
43 class SK_API SkImageGenerator { 48 class SK_API SkImageGenerator {
44 public: 49 public:
45 /** 50 /**
46 * The PixelRef which takes ownership of this SkImageGenerator 51 * The PixelRef which takes ownership of this SkImageGenerator
47 * will call the image generator's destructor. 52 * will call the image generator's destructor.
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 virtual bool onGetInfo(SkImageInfo* info); 133 virtual bool onGetInfo(SkImageInfo* info);
129 virtual bool onGetPixels(const SkImageInfo& info, 134 virtual bool onGetPixels(const SkImageInfo& info,
130 void* pixels, size_t rowBytes, 135 void* pixels, size_t rowBytes,
131 SkPMColor ctable[], int* ctableCount); 136 SkPMColor ctable[], int* ctableCount);
132 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy tes[3]); 137 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy tes[3]);
133 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy tes[3], 138 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy tes[3],
134 SkYUVColorSpace* colorSpace); 139 SkYUVColorSpace* colorSpace);
135 }; 140 };
136 141
137 #endif // SkImageGenerator_DEFINED 142 #endif // SkImageGenerator_DEFINED
OLDNEW
« no previous file with comments | « include/core/SkImage.h ('k') | samplecode/SampleEncode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698