Index: src/codec/SkCodec_libico.cpp |
diff --git a/src/codec/SkCodec_libico.cpp b/src/codec/SkCodec_libico.cpp |
index 798169d82b344902571d996d34c127818b3576e7..2d0e62eea68fadcb3a6ce272079804c88dfd31e8 100644 |
--- a/src/codec/SkCodec_libico.cpp |
+++ b/src/codec/SkCodec_libico.cpp |
@@ -206,10 +206,6 @@ SkISize SkIcoCodec::onGetScaledDimensions(float desiredScale) const { |
// We set the dimensions to the largest candidate image by default. |
// Regardless of the scale request, this is the largest image that we |
// will decode. |
- if (desiredScale >= 1.0) { |
- return this->getInfo().dimensions(); |
- } |
- |
int origWidth = this->getInfo().width(); |
int origHeight = this->getInfo().height(); |
float desiredSize = desiredScale * origWidth * origHeight; |
@@ -230,6 +226,16 @@ SkISize SkIcoCodec::onGetScaledDimensions(float desiredScale) const { |
return fEmbeddedCodecs->operator[](minIndex)->getInfo().dimensions(); |
} |
+bool SkIcoCodec::onDimensionsSupported(const SkISize& dim) { |
msarett
2015/10/01 19:34:33
This is a bit redundant which I think is unfortuna
scroggo
2015/10/01 21:16:57
Agreed. Added a fixme.
|
+ for (int32_t i = 0; i < fEmbeddedCodecs->count(); i++) { |
+ if (fEmbeddedCodecs->operator[](i)->getInfo().dimensions() == dim) { |
+ return true; |
+ } |
+ } |
+ |
+ return false; |
+} |
+ |
/* |
* Initiates the Ico decode |
*/ |