Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: include/codec/SkScaledCodec.h

Issue 1372973002: Move all knowledge of X sampling into SkScaledCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@codecSDmerge
Patch Set: Attempt to fix RLE overflow Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/codec/SkCodec.h ('k') | src/codec/SkBmpCodec.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/codec/SkScaledCodec.h
diff --git a/include/codec/SkScaledCodec.h b/include/codec/SkScaledCodec.h
index 20428d8d73f40b0a391dfa061131fe1358fbb27c..92ef19e74f702810b25111a290cff999aa2eb0e4 100644
--- a/include/codec/SkScaledCodec.h
+++ b/include/codec/SkScaledCodec.h
@@ -22,23 +22,7 @@ public:
virtual ~SkScaledCodec();
- /**
- * returns whether a destination's dimensions are supported for down sampling
- */
- static bool DimensionsSupportedForSampling(const SkImageInfo& srcInfo,
- const SkImageInfo& dstInfo) {
- // heights must be equal as no native y sampling is supported
- if (dstInfo.height() != srcInfo.height()) {
- return false;
- }
- // only support down sampling, dstWidth cannot be larger that srcWidth
- if(dstInfo.width() > srcInfo.width()) {
- return false;
- }
- return true;
- }
-
- static void ComputeSampleSize(const SkImageInfo& dstInfo, const SkImageInfo& srcInfo,
+ static void ComputeSampleSize(const SkISize& dstDim, const SkISize& srcDim,
int* sampleSizeX, int* sampleSizeY);
protected:
@@ -46,6 +30,7 @@ protected:
* Recommend a set of destination dimensions given a requested scale
*/
SkISize onGetScaledDimensions(float desiredScale) const override;
+ bool onDimensionsSupported(const SkISize&) override;
Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&, SkPMColor*, int*)
override;
« no previous file with comments | « include/codec/SkCodec.h ('k') | src/codec/SkBmpCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698