summaryrefslogtreecommitdiff
path: root/gfx/thebes/gfxFontMissingGlyphs.h
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /gfx/thebes/gfxFontMissingGlyphs.h
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloaduxp-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
Add m-esr52 at 52.6.0
Diffstat (limited to 'gfx/thebes/gfxFontMissingGlyphs.h')
-rw-r--r--gfx/thebes/gfxFontMissingGlyphs.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/gfx/thebes/gfxFontMissingGlyphs.h b/gfx/thebes/gfxFontMissingGlyphs.h
new file mode 100644
index 0000000000..1814a89a74
--- /dev/null
+++ b/gfx/thebes/gfxFontMissingGlyphs.h
@@ -0,0 +1,55 @@
+/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * 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/. */
+
+#ifndef GFX_FONTMISSINGGLYPHS_H
+#define GFX_FONTMISSINGGLYPHS_H
+
+#include "mozilla/Attributes.h"
+#include "mozilla/gfx/Rect.h"
+
+namespace mozilla {
+namespace gfx {
+class DrawTarget;
+class Pattern;
+} // namespace gfx
+} // namespace mozilla
+
+/**
+ * This class should not be instantiated. It's just a container
+ * for some helper functions.
+ */
+class gfxFontMissingGlyphs final
+{
+ typedef mozilla::gfx::DrawTarget DrawTarget;
+ typedef mozilla::gfx::Float Float;
+ typedef mozilla::gfx::Pattern Pattern;
+ typedef mozilla::gfx::Rect Rect;
+
+ gfxFontMissingGlyphs() = delete; // prevent instantiation
+
+public:
+ /**
+ * Draw hexboxes for a missing glyph.
+ * @param aChar the UTF16 codepoint for the character
+ * @param aRect the glyph-box for the glyph that is missing
+ * @param aDrawTarget the DrawTarget to draw to
+ * @param aPattern the pattern currently being used to paint
+ * @param aAppUnitsPerDevPixel the appUnits to devPixel ratio we're using,
+ * (so we can scale glyphs to a sensible size)
+ */
+ static void DrawMissingGlyph(uint32_t aChar,
+ const Rect& aRect,
+ DrawTarget& aDrawTarget,
+ const Pattern& aPattern,
+ uint32_t aAppUnitsPerDevPixel);
+ /**
+ * @return the desired minimum width for a glyph-box that will allow
+ * the hexboxes to be drawn reasonably.
+ */
+ static Float GetDesiredMinWidth(uint32_t aChar,
+ uint32_t aAppUnitsPerDevUnit);
+};
+
+#endif