diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-10-27 15:37:39 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-10-30 11:42:49 +0100 |
commit | 7b0f2ee441b0cbcb88f3020df40c49e7cd6f9fb1 (patch) | |
tree | 2382b66e9a92907934e891cded6497c8ea7186ef /vcl/inc/impglyphitem.hxx | |
parent | a4b60b78ea36d55a2abf0e5efccd8530568d2209 (diff) |
Rely on the font instance of the glyph
The FreetypeFont might already have released the font instance of
the glyph, but the glyphs font instance must still be valid, so
use this instead to cache glyph bound rect.
For whatever reason the Windows compiler doesn't accept inline
functions in the GlyphItem struct and wants to export them in
the DLL, even when declared VCL_DLLPRIVATE, so this just uses
static inlines as a workaround.
Change-Id: I4539d91a846a54a05f9648638494e1e99f704b0a
Reviewed-on: https://gerrit.libreoffice.org/62425
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/inc/impglyphitem.hxx')
-rw-r--r-- | vcl/inc/impglyphitem.hxx | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/vcl/inc/impglyphitem.hxx b/vcl/inc/impglyphitem.hxx new file mode 100644 index 000000000000..a4843be677fb --- /dev/null +++ b/vcl/inc/impglyphitem.hxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_VCL_IMPGLYPHITEM_HXX +#define INCLUDED_VCL_IMPGLYPHITEM_HXX + +#include <vcl/glyphitem.hxx> + +// for whatever reason MSVC tries to export these when declared class inline even +// when annotated with VCL_DLLPRIVATE, so keep them as seperate static inline. + +static inline bool GetCachedGlyphBoundRect(const GlyphItem& rItem, tools::Rectangle& rRect) +{ + return rItem.m_pFontInstance->GetCachedGlyphBoundRect(rItem.m_aGlyphId, rRect); +} + +static inline void CacheGlyphBoundRect(const GlyphItem& rItem, tools::Rectangle& rRect) +{ + rItem.m_pFontInstance->CacheGlyphBoundRect(rItem.m_aGlyphId, rRect); +} + +#endif // INCLUDED_VCL_IMPGLYPHITEM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |