summaryrefslogtreecommitdiff
path: root/vcl/skia/salbmp.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-10-21 12:41:53 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-11-04 08:51:00 +0100
commit5de73f04f3db9c8fb488bf75b1860bf8378a5b45 (patch)
tree162ce145c1bec1ac5b41b5caa5bac1591c54c11a /vcl/skia/salbmp.cxx
parentdce64cc7cfd5f696ef0c030524558306687ae3c7 (diff)
new loplugin:staticconstexpr
Change-Id: Ida1996dfffa106bf95fd064e8191b8033b4002f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175336 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/skia/salbmp.cxx')
-rw-r--r--vcl/skia/salbmp.cxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/vcl/skia/salbmp.cxx b/vcl/skia/salbmp.cxx
index bba67fcbc439..d517d425eaf1 100644
--- a/vcl/skia/salbmp.cxx
+++ b/vcl/skia/salbmp.cxx
@@ -529,10 +529,10 @@ bool SkiaSalBitmap::ConvertToGreyscale()
// values from Bitmap::ImplMakeGreyscales(). Do not use kGray_8_SkColorType,
// Skia would use its gray conversion formula.
// NOTE: The matrix is 4x5 organized as columns (i.e. each line is a column, not a row).
- constexpr SkColorMatrix toGray(77 / 256.0, 151 / 256.0, 28 / 256.0, 0, 0, // R column
- 77 / 256.0, 151 / 256.0, 28 / 256.0, 0, 0, // G column
- 77 / 256.0, 151 / 256.0, 28 / 256.0, 0, 0, // B column
- 0, 0, 0, 1, 0); // don't modify alpha
+ static constexpr SkColorMatrix toGray(77 / 256.0, 151 / 256.0, 28 / 256.0, 0, 0, // R column
+ 77 / 256.0, 151 / 256.0, 28 / 256.0, 0, 0, // G column
+ 77 / 256.0, 151 / 256.0, 28 / 256.0, 0, 0, // B column
+ 0, 0, 0, 1, 0); // don't modify alpha
paint.setColorFilter(SkColorFilters::Matrix(toGray));
surface->getCanvas()->drawImage(mImage, 0, 0, SkSamplingOptions(), &paint);
mBitCount = 8;
@@ -987,10 +987,10 @@ const sk_sp<SkImage>& SkiaSalBitmap::GetAlphaSkImage(DirectImage direct) const
// Move the R channel value to the alpha channel. This seems to be the only
// way to reinterpret data in SkImage as an alpha SkImage without accessing the pixels.
// NOTE: The matrix is 4x5 organized as columns (i.e. each line is a column, not a row).
- constexpr SkColorMatrix redToAlpha(0, 0, 0, 0, 0, // R column
- 0, 0, 0, 0, 0, // G column
- 0, 0, 0, 0, 0, // B column
- 1, 0, 0, 0, 0); // A column
+ static constexpr SkColorMatrix redToAlpha(0, 0, 0, 0, 0, // R column
+ 0, 0, 0, 0, 0, // G column
+ 0, 0, 0, 0, 0, // B column
+ 1, 0, 0, 0, 0); // A column
SkPaint paint;
paint.setColorFilter(SkColorFilters::Matrix(redToAlpha));
if (scaling)
@@ -1046,10 +1046,10 @@ const sk_sp<SkImage>& SkiaSalBitmap::GetAlphaSkImage(DirectImage direct) const
// Move the R channel value to the alpha channel. This seems to be the only
// way to reinterpret data in SkImage as an alpha SkImage without accessing the pixels.
// NOTE: The matrix is 4x5 organized as columns (i.e. each line is a column, not a row).
- constexpr SkColorMatrix redToAlpha(0, 0, 0, 0, 0, // R column
- 0, 0, 0, 0, 0, // G column
- 0, 0, 0, 0, 0, // B column
- 1, 0, 0, 0, 0); // A column
+ static constexpr SkColorMatrix redToAlpha(0, 0, 0, 0, 0, // R column
+ 0, 0, 0, 0, 0, // G column
+ 0, 0, 0, 0, 0, // B column
+ 1, 0, 0, 0, 0); // A column
paint.setColorFilter(SkColorFilters::Matrix(redToAlpha));
surface->getCanvas()->drawImage(GetAsSkBitmap().asImage(), 0, 0, SkSamplingOptions(),
&paint);