Chromium Code Reviews| Index: include/codec/SkCodec.h |
| diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h |
| index 1cdc88d4adcfc0dc4e028913348dd21c287e50e7..f20298e5891b84983f86f805ff47608fee668a7d 100644 |
| --- a/include/codec/SkCodec.h |
| +++ b/include/codec/SkCodec.h |
| @@ -52,11 +52,25 @@ public: |
| * Return a size that approximately supports the desired scale factor. |
| * The codec may not be able to scale efficiently to the exact scale |
| * factor requested, so return a size that approximates that scale. |
| + * The returned value is the codec's suggestion for the closest valid |
| + * scale that it can natively support |
| */ |
| SkISize getScaledDimensions(float desiredScale) const { |
| return this->onGetScaledDimensions(desiredScale); |
| } |
| + /* |
| + * Checks if we can patially natively scale to the desiredScale, and partially natively scales |
|
scroggo
2015/08/04 20:05:21
"partially" is missing r (the first time)
emmaleer
2015/08/05 14:47:51
Acknowledged.
|
| + * the dimensions if possible. |
| + * Returns the new sampleSize, which is used to finish scaling to the desiredScale. |
| + * Ex: desiredScale = 1/6. Natively can scale by 1/2. New sampleSize = 3, as there is still |
| + * 1/3 scaling left to do, which is done by sampling. |
| + * Returns -1 if partial native scaling is not supported. |
| + */ |
| + int partiallyNativelyScale(float desiredScale) { |
|
scroggo
2015/08/04 20:05:21
I'm not a huge fan of this name. I am not sure I h
emmaleer
2015/08/05 14:47:51
Okay, I'll first upload the changes for future ref
|
| + return this->onPartiallyNativelyScale(desiredScale); |
| + } |
| + |
| /** |
| * Return (via desiredSubset) a subset which can decoded from this codec, |
| * or false if this codec cannot decode subsets or anything similar to |
| @@ -252,6 +266,9 @@ protected: |
| return this->getInfo().dimensions(); |
| } |
| + virtual int onPartiallyNativelyScale(float desiredScale) { |
| + return -1; |
| + } |
| virtual SkEncodedFormat onGetEncodedFormat() const = 0; |
| virtual Result onGetPixels(const SkImageInfo& info, |