diff options
author | Mike Reed <reed@google.com> | 2016-12-19 13:39:49 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-12-19 19:46:56 +0000 |
commit | 65869fb64b56a4c59d74003c1fac5dffc8a8bf65 (patch) | |
tree | 288924f755b565b0fb1e2120c5e71b3172fb18f4 | |
parent | 20dd31fed5f63d7d97719ce7f53755fa94086cfd (diff) |
update dox for generateScaledPixels
BUG=skia:
Change-Id: Ia897c9f58ccb856b92308cdec0abde86fb1b2e29
Reviewed-on: https://skia-review.googlesource.com/6278
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
-rw-r--r-- | include/core/SkImageGenerator.h | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/include/core/SkImageGenerator.h b/include/core/SkImageGenerator.h index bf33812884..0ab27aea2f 100644 --- a/include/core/SkImageGenerator.h +++ b/include/core/SkImageGenerator.h @@ -158,23 +158,17 @@ public: bool computeScaledDimensions(SkScalar scale, SupportedSizes*); /** - * Scale the generator's pixels to fit into scaledSize. - * This routine also support retrieving only a subset of the pixels. That subset is specified - * by the following rectangle (in the scaled space): + * Copy the pixels from this generator into the provided pixmap, respecting + * all of the pixmap's attributes: dimensions, colortype, alphatype, colorspace. + * returns true on success. * - * subset = SkIRect::MakeXYWH(subsetOrigin.x(), subsetOrigin.y(), - * subsetPixels.width(), subsetPixels.height()) + * Some generators can only scale to certain dimensions (e.g. powers-of-2 smaller). + * Thus a generator may fail (return false) for some sizes but succeed for other sizes. + * Call computeScaledDimensions() to know, for a given requested scale, what output size(s) + * the generator might support. * - * If subset is not contained inside the scaledSize, this returns false. - * - * whole = SkIRect::MakeWH(scaledSize.width(), scaledSize.height()) - * if (!whole.contains(subset)) { - * return false; - * } - * - * If the requested colortype/alphatype in pixels is not supported, - * or the requested scaledSize is not supported, or the generator encounters an error, - * this returns false. + * Note: this call does NOT allocate the memory for the pixmap; that must be done + * by the caller. */ bool generateScaledPixels(const SkPixmap& scaledPixels); |