include/tools/mapunit.hxx | 8 +++-----
vcl/source/gdi/mapmod.cxx | 4 ++--
2 files changed, 5 insertions(+), 7 deletions(-)
New commits:
commit 7dc176bd29bc9952f869bad636a0ea7c9687ca97
Author: Noel Grandin <noelgran...@gmail.com>
AuthorDate: Wed Jul 26 19:53:12 2023 +0200
Commit: Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Jul 27 20:41:50 2023 +0200
pack the MapMode::ImplMapMode struct
and move the hot fields to the front, since we hit this data
fairly hard
Change-Id: I852bd64557d586bc73ea64cdce9f5004e64dea93
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154972
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
diff --git a/include/tools/mapunit.hxx b/include/tools/mapunit.hxx
index fcaa03bcdb8c..881a90713cd0 100644
--- a/include/tools/mapunit.hxx
+++ b/include/tools/mapunit.hxx
@@ -16,11 +16,11 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#pragma once
-#ifndef INCLUDED_TOOLS_MAPUNIT_HXX
-#define INCLUDED_TOOLS_MAPUNIT_HXX
+#include <sal/types.h>
-enum class MapUnit
+enum class MapUnit : sal_uInt8
{
Map100thMM, Map10thMM, MapMM, MapCM,
Map1000thInch, Map100thInch, Map10thInch, MapInch,
@@ -32,6 +32,4 @@ enum class MapUnit
LASTENUMDUMMY // used as an error return
};
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/mapmod.cxx b/vcl/source/gdi/mapmod.cxx
index f76d3bb6ec29..45c7a29a817d 100644
--- a/vcl/source/gdi/mapmod.cxx
+++ b/vcl/source/gdi/mapmod.cxx
@@ -28,15 +28,15 @@
struct MapMode::ImplMapMode
{
- Point maOrigin;
MapUnit meUnit;
+ bool mbSimple;
+ Point maOrigin;
// NOTE: these Fraction must NOT have more than 32 bits precision
// because ReadFraction / WriteFraction do only 32 bits, so more than
// that cannot be stored in MetaFiles!
// => call ReduceInaccurate whenever setting these
Fraction maScaleX;
Fraction maScaleY;
- bool mbSimple;
ImplMapMode();
ImplMapMode(MapUnit eMapUnit);