summaryrefslogtreecommitdiff
path: root/vcl/inc/image.h
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2018-11-26 11:06:20 +0000
committerMichael Meeks <michael.meeks@collabora.com>2018-11-27 13:09:33 +0100
commita71ea5cefffc4169237310d72f2d6e96c8bbf63d (patch)
tree581d84c1f4c393263fd8a695061cf53242de10ad /vcl/inc/image.h
parent3f2ac501e6593ef5095b308b887c48349e00c0a3 (diff)
Preserve stock images until render time.
This allows us to choose to render HiDPI images at the right time, when we have the DPI of the device to render to. The first step in a better, and more industry standard way of improving our UI for HiDPI via rendering level scaling that should retain a consistent look across the app with many fewer changes. Change-Id: I36681f3242cb650de4f0b2d0fcdffbe5618e30fc Reviewed-on: https://gerrit.libreoffice.org/64040 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl/inc/image.h')
-rw-r--r--vcl/inc/image.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/vcl/inc/image.h b/vcl/inc/image.h
index 1cb0c43cdd72..f966a8c62c1f 100644
--- a/vcl/inc/image.h
+++ b/vcl/inc/image.h
@@ -28,10 +28,25 @@
struct ImplImage
{
BitmapChecksum maBitmapChecksum;
- BitmapEx const maBitmapEx;
+ /// if non-empty: cached original size of maStockName else Size of maBitmap
+ Size maSizePixel;
+ /// If set - defines the bitmap via images.zip*
+ OUString maStockName;
+
+ /// Original bitmap - or cache of a potentially scaled bitmap
+ BitmapEx maBitmapEx;
BitmapEx maDisabledBitmapEx;
ImplImage(const BitmapEx& rBitmapEx);
+ ImplImage(const OUString &aStockName);
+
+ bool isStock() const { return maStockName.getLength() > 0; }
+
+ /// get size in co-ordinates not scaled for HiDPI
+ Size getSizePixel();
+ BitmapEx getBitmapEx(bool bDisabled = false);
+ bool isEqual(const ImplImage &ref) const;
+ bool isSizeEmpty() const { return maSizePixel == Size(0, 0); }
};
#endif // INCLUDED_VCL_INC_IMAGE_H