Kaydet (Commit) e07097cc authored tarafından Jan Holesovsky's avatar Jan Holesovsky

hidpi: Use the default scaling algorithm.

We are not on _that_ time critical path when setting up images for the UI, so
let's have at least some quality there :-)

Change-Id: I0a82106b0d60ac6a543d5e55c48fc86b6d5f60b1
üst 021df5c2
...@@ -329,7 +329,7 @@ void AlignmentTabPage::InitVsRefEgde() ...@@ -329,7 +329,7 @@ void AlignmentTabPage::InitVsRefEgde()
{ {
OUString rImageName = aImageList.GetImageName(i); OUString rImageName = aImageList.GetImageName(i);
BitmapEx b = aImageList.GetImage(rImageName).GetBitmapEx(); BitmapEx b = aImageList.GetImage(rImageName).GetBitmapEx();
b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_FAST); b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor());
aImageList.ReplaceImage(rImageName, Image(b)); aImageList.ReplaceImage(rImageName, Image(b));
} }
} }
......
...@@ -134,7 +134,7 @@ SvxBorderTabPage::SvxBorderTabPage(Window* pParent, const SfxItemSet& rCoreAttrs ...@@ -134,7 +134,7 @@ SvxBorderTabPage::SvxBorderTabPage(Window* pParent, const SfxItemSet& rCoreAttrs
{ {
OUString rImageName = aBorderImgLst.GetImageName(i); OUString rImageName = aBorderImgLst.GetImageName(i);
BitmapEx b = aBorderImgLst.GetImage(rImageName).GetBitmapEx(); BitmapEx b = aBorderImgLst.GetImage(rImageName).GetBitmapEx();
b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_FAST); b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor());
aBorderImgLst.ReplaceImage(rImageName, Image(b)); aBorderImgLst.ReplaceImage(rImageName, Image(b));
} }
...@@ -142,7 +142,7 @@ SvxBorderTabPage::SvxBorderTabPage(Window* pParent, const SfxItemSet& rCoreAttrs ...@@ -142,7 +142,7 @@ SvxBorderTabPage::SvxBorderTabPage(Window* pParent, const SfxItemSet& rCoreAttrs
{ {
OUString rImageName = aShadowImgLst.GetImageName(i); OUString rImageName = aShadowImgLst.GetImageName(i);
BitmapEx b = aShadowImgLst.GetImage(rImageName).GetBitmapEx(); BitmapEx b = aShadowImgLst.GetImage(rImageName).GetBitmapEx();
b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_FAST); b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor());
aShadowImgLst.ReplaceImage(rImageName, Image(b)); aShadowImgLst.ReplaceImage(rImageName, Image(b));
} }
} }
......
...@@ -651,7 +651,7 @@ void LayoutMenu::Fill (void) ...@@ -651,7 +651,7 @@ void LayoutMenu::Fill (void)
BitmapEx aBmp(SdResId(pInfo->mnBmpResId)); BitmapEx aBmp(SdResId(pInfo->mnBmpResId));
if (GetDPIScaleFactor() > 1) if (GetDPIScaleFactor() > 1)
aBmp.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_FAST); aBmp.Scale(GetDPIScaleFactor(), GetDPIScaleFactor());
if (bRightToLeft && (WritingMode_TB_RL != pInfo->meWritingMode)) if (bRightToLeft && (WritingMode_TB_RL != pInfo->meWritingMode))
aBmp.Mirror (BMP_MIRROR_HORZ); aBmp.Mirror (BMP_MIRROR_HORZ);
......
...@@ -78,7 +78,7 @@ SvxModifyControl::SvxModifyControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, Status ...@@ -78,7 +78,7 @@ SvxModifyControl::SvxModifyControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, Status
for (int i = 0; i < mpImpl->MODIFICATION_STATE_SIZE; i++) for (int i = 0; i < mpImpl->MODIFICATION_STATE_SIZE; i++)
{ {
BitmapEx b = mpImpl->maImages[i].GetBitmapEx(); BitmapEx b = mpImpl->maImages[i].GetBitmapEx();
b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), BMP_SCALE_FAST); b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor());
mpImpl->maImages[i] = Image(b); mpImpl->maImages[i] = Image(b);
} }
} }
......
...@@ -180,11 +180,11 @@ SvxPosSizeStatusBarControl::SvxPosSizeStatusBarControl( sal_uInt16 _nSlotId, ...@@ -180,11 +180,11 @@ SvxPosSizeStatusBarControl::SvxPosSizeStatusBarControl( sal_uInt16 _nSlotId,
if ( rStb.GetDPIScaleFactor() > 1) if ( rStb.GetDPIScaleFactor() > 1)
{ {
BitmapEx b = pImp->aPosImage.GetBitmapEx(); BitmapEx b = pImp->aPosImage.GetBitmapEx();
b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), BMP_SCALE_FAST); b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor());
pImp->aPosImage = Image(b); pImp->aPosImage = Image(b);
b = pImp->aSizeImage.GetBitmapEx(); b = pImp->aSizeImage.GetBitmapEx();
b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), BMP_SCALE_FAST); b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor());
pImp->aSizeImage = Image(b); pImp->aSizeImage = Image(b);
} }
......
...@@ -83,7 +83,7 @@ SvxSelectionModeControl::SvxSelectionModeControl( sal_uInt16 _nSlotId, ...@@ -83,7 +83,7 @@ SvxSelectionModeControl::SvxSelectionModeControl( sal_uInt16 _nSlotId,
if ( GetStatusBar().GetDPIScaleFactor() > 1 ) if ( GetStatusBar().GetDPIScaleFactor() > 1 )
{ {
BitmapEx b = maImage.GetBitmapEx(); BitmapEx b = maImage.GetBitmapEx();
b.Scale(GetStatusBar().GetDPIScaleFactor(), GetStatusBar().GetDPIScaleFactor(), BMP_SCALE_FAST); b.Scale(GetStatusBar().GetDPIScaleFactor(), GetStatusBar().GetDPIScaleFactor());
maImage = Image(b); maImage = Image(b);
} }
......
...@@ -68,7 +68,7 @@ XmlSecStatusBarControl::XmlSecStatusBarControl( sal_uInt16 _nSlotId, sal_uInt16 ...@@ -68,7 +68,7 @@ XmlSecStatusBarControl::XmlSecStatusBarControl( sal_uInt16 _nSlotId, sal_uInt16
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
{ {
BitmapEx b = arr[i].GetBitmapEx(); BitmapEx b = arr[i].GetBitmapEx();
b.Scale(_rStb.GetDPIScaleFactor(), _rStb.GetDPIScaleFactor(), BMP_SCALE_FAST); b.Scale(_rStb.GetDPIScaleFactor(), _rStb.GetDPIScaleFactor());
arr[i] = Image(b); arr[i] = Image(b);
} }
......
...@@ -178,7 +178,7 @@ SvxZoomSliderControl::SvxZoomSliderControl( sal_uInt16 _nSlotId, sal_uInt16 _nI ...@@ -178,7 +178,7 @@ SvxZoomSliderControl::SvxZoomSliderControl( sal_uInt16 _nSlotId, sal_uInt16 _nI
{ {
BitmapEx b = arr[i].GetBitmapEx(); BitmapEx b = arr[i].GetBitmapEx();
//Use Lanczos scaling for the slider button because it does a better job with circles //Use Lanczos scaling for the slider button because it does a better job with circles
b.Scale(_rStb.GetDPIScaleFactor(), _rStb.GetDPIScaleFactor(), i == 0 ? BMP_SCALE_LANCZOS : BMP_SCALE_FAST); b.Scale(_rStb.GetDPIScaleFactor(), _rStb.GetDPIScaleFactor(), BMP_SCALE_BESTQUALITY);
arr[i] = Image(b); arr[i] = Image(b);
} }
......
...@@ -62,7 +62,7 @@ SwViewLayoutControl::SwViewLayoutControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, ...@@ -62,7 +62,7 @@ SwViewLayoutControl::SwViewLayoutControl( sal_uInt16 _nSlotId, sal_uInt16 _nId,
{ {
BitmapEx b = arr[i].GetBitmapEx(); BitmapEx b = arr[i].GetBitmapEx();
//Don't scale width, no space. //Don't scale width, no space.
b.Scale(1.0, rStb.GetDPIScaleFactor(), BMP_SCALE_FAST); b.Scale(1.0, rStb.GetDPIScaleFactor());
arr[i] = Image(b); arr[i] = Image(b);
} }
......
...@@ -1359,7 +1359,7 @@ void ToolBox::SetItemImage( sal_uInt16 nItemId, const Image& rInputImage ) ...@@ -1359,7 +1359,7 @@ void ToolBox::SetItemImage( sal_uInt16 nItemId, const Image& rInputImage )
//Some code calls this twice, so add a sanity check //Some code calls this twice, so add a sanity check
if (aBitmap.GetSizePixel().Width() < 32) if (aBitmap.GetSizePixel().Width() < 32)
{ {
aBitmap.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_FAST); aBitmap.Scale(GetDPIScaleFactor(), GetDPIScaleFactor());
aImage = Image(aBitmap); aImage = Image(aBitmap);
pImage = &aImage; pImage = &aImage;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment