Chromium Code Reviews| Index: src/images/SkDecodingImageGenerator.cpp |
| diff --git a/src/images/SkDecodingImageGenerator.cpp b/src/images/SkDecodingImageGenerator.cpp |
| index dfa093becc5d5ff7162727729d04e175fe1d18f0..e3760050f672c70246d79bc80d272bb7c9a67e44 100644 |
| --- a/src/images/SkDecodingImageGenerator.cpp |
| +++ b/src/images/SkDecodingImageGenerator.cpp |
| @@ -45,6 +45,7 @@ protected: |
| virtual bool onGetPixels(const SkImageInfo& info, |
| void* pixels, size_t rowBytes, |
| SkPMColor ctable[], int* ctableCount) SK_OVERRIDE; |
| + virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3]) SK_OVERRIDE; |
| private: |
| typedef SkImageGenerator INHERITED; |
| @@ -209,6 +210,26 @@ bool DecodingImageGenerator::onGetPixels(const SkImageInfo& info, |
| return true; |
| } |
| +bool DecodingImageGenerator::onGetYUV8Planes(SkISize sizes[3], void* planes[3], |
| + size_t rowBytes[3]) { |
| + if (!fStream->rewind()) { |
| + return false; |
| + } |
| + |
| + SkAutoTDelete<SkImageDecoder> decoder(SkImageDecoder::Factory(fStream)); |
| + if (NULL == decoder.get()) { |
| + return false; |
| + } |
| + |
| + if (planes && (NULL != planes[0]) && (NULL != planes[1]) && (NULL != planes[2]) && |
| + rowBytes && (0 != rowBytes[0]) && (0 != rowBytes[1]) && (0 != rowBytes[2])) { |
| + decoder->setYUVBuffers(planes, rowBytes); |
| + return onGetPixels(fInfo, NULL, 0, NULL, NULL); |
|
scroggo
2014/07/18 21:52:41
this->onGetPixels
sugoi1
2014/07/21 16:51:44
Acknowledged.
|
| + } |
| + |
| + return decoder->getImageFormat(fStream, sizes); |
| +} |
| + |
| // A contructor-type function that returns NULL on failure. This |
| // prevents the returned SkImageGenerator from ever being in a bad |
| // state. Called by both Create() functions |