aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports/SkScalerContext_win_dw.h
diff options
context:
space:
mode:
authorGravatar kulshin <kulshin@chromium.org>2016-06-01 08:31:28 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-01 08:31:28 -0700
commitc4b091543b4082fd1a2f356ef3b478073c5f9418 (patch)
tree7c8c9906ce58ab635405a510988894594c55b986 /src/ports/SkScalerContext_win_dw.h
parent740cc88ee3d63c75e52d31238f2a32600cc57a8c (diff)
Implement support for rendering color emoji on Windows
This change adds support to the DirectWrite scaler context for detection of color fonts. If it detects a color font and the glyph is a color glyph, it will use DirectWrite's TranslateColorGlyphRun API and generate an image of the glyph that can then be rendered. Chromium tests: https://codereview.chromium.org/2003853002 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1984943002 Review-Url: https://codereview.chromium.org/1984943002
Diffstat (limited to 'src/ports/SkScalerContext_win_dw.h')
-rw-r--r--src/ports/SkScalerContext_win_dw.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ports/SkScalerContext_win_dw.h b/src/ports/SkScalerContext_win_dw.h
index 9b24772036..98c4910b27 100644
--- a/src/ports/SkScalerContext_win_dw.h
+++ b/src/ports/SkScalerContext_win_dw.h
@@ -14,6 +14,9 @@
#include "SkTypes.h"
#include <dwrite.h>
+#if SK_HAS_DWRITE_2_H
+#include <dwrite_2.h>
+#endif
class SkGlyph;
class SkDescriptor;
@@ -42,6 +45,14 @@ private:
DWRITE_TEXTURE_TYPE textureType,
RECT* bbox);
+ bool isColorGlyph(const SkGlyph& glyph);
+
+#if SK_HAS_DWRITE_2_H
+ bool getColorGlyphRun(const SkGlyph& glyph, IDWriteColorGlyphRunEnumerator** colorGlyph);
+
+ void generateColorGlyphImage(const SkGlyph& glyph);
+#endif
+
SkTDArray<uint8_t> fBits;
/** The total matrix without the text height scale. */
SkMatrix fSkXform;
@@ -64,6 +75,10 @@ private:
DWRITE_RENDERING_MODE fRenderingMode;
DWRITE_TEXTURE_TYPE fTextureType;
DWRITE_MEASURING_MODE fMeasuringMode;
+#if SK_HAS_DWRITE_2_H
+ SkTScopedComPtr<IDWriteFactory2> fFactory2;
+ bool fIsColorFont;
+#endif
};
#endif