Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright 2013 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 #ifndef SkImageGenerator_DEFINED | |
| 9 #define SkImageGenerator_DEFINED | |
| 10 | |
| 11 class SkData; | |
| 12 class SkImageInfo; | |
| 13 | |
| 14 #include "SkData.h" | |
| 15 #include "SkBitmap.h" | |
|
reed1
2013/11/18 21:56:10
do you need to include SkData.h?
can we just incl
hal.canary
2013/11/19 02:06:29
Done.
| |
| 16 | |
| 17 /** | |
| 18 * An interface that allows a purgable PixelRef to re-decode an image. | |
| 19 */ | |
| 20 class SkImageGenerator { | |
| 21 public: | |
| 22 virtual ~SkImageGenerator(); | |
| 23 | |
| 24 /** | |
| 25 * Return a ref to the encoded (i.e. compressed) representation, | |
| 26 * of this data. | |
| 27 * | |
| 28 * If non-NULL is returned, the caller is responsible for calling | |
| 29 * unref() on the data when it is finished. | |
| 30 */ | |
| 31 virtual SkData* refEncodedData() { return NULL; } | |
| 32 | |
| 33 /** | |
| 34 * Return some information about the image, allowing the owner fo | |
| 35 * this ojbect to allocate pixels. | |
| 36 * | |
| 37 * @return false if anything goes wrong. | |
| 38 */ | |
| 39 virtual bool getInfo(SkImageInfo* info) = 0; | |
| 40 | |
| 41 /** | |
| 42 * Decode into the given pixels, a block of memory of size at | |
| 43 * least (info.fHeight - 1) * rowBytes + (info.fWidth * | |
| 44 * bytesPerPixel) | |
| 45 * | |
| 46 * @param info Should be identical to the info returned by | |
| 47 * getInfo so that the implementation can confirm that the | |
| 48 * caller knows what it is asking for (config, size). | |
| 49 * This contract also allows the caller to specify | |
| 50 * different output-configs, which the implementation can | |
| 51 * decide to support or not. | |
| 52 * | |
| 53 * @return false if anything goes wrong. | |
| 54 */ | |
| 55 virtual bool getPixels(const SkImageInfo& info, | |
|
Alpha Left Google
2013/11/19 02:00:48
There should be a frame index here for animated im
| |
| 56 void* pixels, | |
| 57 size_t rowBytes) = 0; | |
| 58 }; | |
| 59 | |
| 60 #endif // SkImageGenerator_DEFINED | |
| OLD | NEW |