Index: src/images/SkImageDecoder.cpp |
diff --git a/src/images/SkImageDecoder.cpp b/src/images/SkImageDecoder.cpp |
index b25e7dbbab1e9f64d9fe2b36486dbb21f63d66b9..42ab120feaaf1699af5e31adeaf74863d8775987 100644 |
--- a/src/images/SkImageDecoder.cpp |
+++ b/src/images/SkImageDecoder.cpp |
@@ -285,3 +285,41 @@ bool SkImageDecoder::DecodeStream(SkStreamRewindable* stream, SkBitmap* bm, SkCo |
} |
return success; |
} |
+ |
+bool SkImageDecoder::getYUVComponentSizes(SkStream* stream, SkISize componentSizes[3]) { |
+ return this->onDecodeToYUV(stream, componentSizes, NULL); |
+} |
+ |
+bool SkImageDecoder::decodeToYUV(SkStream* stream, SkISize componentSizes[3], void* planes[3], |
+ size_t rowBytes[3]) { |
+ SkImagePlanes imagePlanes(planes, rowBytes); |
+ return this->onDecodeToYUV(stream, componentSizes, &imagePlanes); |
+} |
+ |
+SkImagePlanes::SkImagePlanes() |
+{ |
reed1
2014/10/13 13:15:36
nit: place { on the same lines as the constructor
sugoi1
2014/10/14 15:07:36
Code removed
|
+ for (int i = 0; i < 3; ++i) { |
+ m_planes[i] = 0; |
reed1
2014/10/13 13:15:35
m_planes[i] = NULL;
sugoi1
2014/10/14 15:07:36
Code removed
|
+ m_rowBytes[i] = 0; |
+ } |
+} |
+ |
+SkImagePlanes::SkImagePlanes(void* planes[3], size_t rowBytes[3]) |
+{ |
+ for (int i = 0; i < 3; ++i) { |
+ m_planes[i] = planes[i]; |
+ m_rowBytes[i] = rowBytes[i]; |
+ } |
+} |
+ |
+void* SkImagePlanes::plane(int i) |
+{ |
+ SkASSERT((i >= 0) && i < 3); |
+ return m_planes[i]; |
+} |
+ |
+size_t SkImagePlanes::rowBytes(int i) const |
+{ |
+ SkASSERT((i >= 0) && i < 3); |
+ return m_rowBytes[i]; |
+} |