summaryrefslogtreecommitdiffstats
path: root/skia/ext/image_operations.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-01 20:16:56 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-01 20:16:56 +0000
commit15e46d28735180ebb5e57464a50f7a1117729b81 (patch)
tree8cf5a3d49a5a0eb6e50074fa14771623248ee3a2 /skia/ext/image_operations.h
parent4c3fe4ae337c8661c6370099bea9a5bcf5faf270 (diff)
downloadchromium_src-15e46d28735180ebb5e57464a50f7a1117729b81.zip
chromium_src-15e46d28735180ebb5e57464a50f7a1117729b81.tar.gz
chromium_src-15e46d28735180ebb5e57464a50f7a1117729b81.tar.bz2
Add library support for subpixel rendering of images during Resize().
BUG=34809 TEST=No test since inactive by default. For a very manual test, modify Resize() to only call the subpixel variant. Then go to your favorite web page (with some image) and choose Zoom > Smaller git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40292 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/image_operations.h')
-rw-r--r--skia/ext/image_operations.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/skia/ext/image_operations.h b/skia/ext/image_operations.h
index e9f448b..0d92d83 100644
--- a/skia/ext/image_operations.h
+++ b/skia/ext/image_operations.h
@@ -23,6 +23,10 @@ class ImageOperations {
// 3-cycle Lanczos filter. This is tall in the middle, goes negative on
// each side, then oscillates 2 more times. It gives nice sharp edges.
RESIZE_LANCZOS3,
+
+ // Lanczos filter + subpixel interpolation. If subpixel rendering is not
+ // appropriate we automatically fall back to Lanczos.
+ RESIZE_SUBPIXEL,
};
// Resizes the given source bitmap using the specified resize method, so that
@@ -46,9 +50,19 @@ class ImageOperations {
private:
ImageOperations(); // Class for scoping only.
+
+ // Supports all methods except RESIZE_SUBPIXEL.
+ static SkBitmap ResizeBasic(const SkBitmap& source,
+ ResizeMethod method,
+ int dest_width, int dest_height,
+ const SkIRect& dest_subset);
+
+ // Subpixel renderer.
+ static SkBitmap ResizeSubpixel(const SkBitmap& source,
+ int dest_width, int dest_height,
+ const SkIRect& dest_subset);
};
} // namespace skia
#endif // SKIA_EXT_IMAGE_OPERATIONS_H_
-