summaryrefslogtreecommitdiffstats
path: root/ui/gfx/image/image_family.h
diff options
context:
space:
mode:
Diffstat (limited to 'ui/gfx/image/image_family.h')
-rw-r--r--ui/gfx/image/image_family.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/ui/gfx/image/image_family.h b/ui/gfx/image/image_family.h
index 28ea7df..78a4524 100644
--- a/ui/gfx/image/image_family.h
+++ b/ui/gfx/image/image_family.h
@@ -14,6 +14,7 @@
namespace gfx {
class ImageSkia;
+class Size;
// A collection of images at different sizes. The images should be different
// representations of the same basic concept (for example, an icon) at various
@@ -111,6 +112,15 @@ class UI_EXPORT ImageFamily {
// aspect ratio. If there are no images in the family, returns NULL.
const gfx::Image* GetBest(int width, int height) const;
+ // Gets the best image to use in a rectangle of |size|.
+ // Gets an image at the same aspect ratio as |size.width()|:|size.height()|,
+ // if possible, or if not, the closest aspect ratio. Among images of that
+ // aspect ratio, returns the smallest image with both its width and height
+ // bigger or equal to the requested size. If none exists, returns the largest
+ // image of that aspect ratio. If there are no images in the family, returns
+ // NULL.
+ const gfx::Image* GetBest(const gfx::Size& size) const;
+
private:
// An <aspect ratio, DIP width> pair.
// A 0x0 image has aspect ratio 1.0. 0xN and Nx0 images are treated as 0x0.