aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkRemoteGlyphCache.h
diff options
context:
space:
mode:
authorGravatar Khushal <khushalsagar@chromium.org>2018-05-22 12:13:12 -0700
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-22 19:49:45 +0000
commit35e0a1a6908492c754156d1abb785da3a9ce2a6b (patch)
tree0651f6dd710aecaec047ebcfb475053d832c8970 /src/core/SkRemoteGlyphCache.h
parent1c5489412de12ab9afdbc0085e65418ca8753b43 (diff)
fonts: Add support for distance field text to font remoting.
R=jvanverth@google.com, herb@google.com Bug: skia:7913 Change-Id: Id3f5b3e75005be9a7234df774268359b406c99a8 Reviewed-on: https://skia-review.googlesource.com/128970 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
Diffstat (limited to 'src/core/SkRemoteGlyphCache.h')
-rw-r--r--src/core/SkRemoteGlyphCache.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/core/SkRemoteGlyphCache.h b/src/core/SkRemoteGlyphCache.h
index 60d880791f..d1119cf70a 100644
--- a/src/core/SkRemoteGlyphCache.h
+++ b/src/core/SkRemoteGlyphCache.h
@@ -28,6 +28,7 @@ class Serializer;
class SkDescriptor;
class SkGlyphCache;
struct SkPackedGlyphID;
+enum SkScalerContextFlags : uint32_t;
class SkScalerContextRecDescriptor;
class SkTextBlobRunIterator;
class SkTypefaceProxy;
@@ -51,8 +52,17 @@ using SkDescriptorSet =
// which will be serialized and renderered using the SkStrikeClient.
class SK_API SkTextBlobCacheDiffCanvas : public SkNoDrawCanvas {
public:
+ struct SK_API Settings {
+ Settings();
+ ~Settings();
+
+ bool fContextSupportsDistanceFieldText = true;
+ SkScalar fMinDistanceFieldFontSize = -1.f;
+ SkScalar fMaxDistanceFieldFontSize = -1.f;
+ };
SkTextBlobCacheDiffCanvas(int width, int height, const SkMatrix& deviceMatrix,
- const SkSurfaceProps& props, SkStrikeServer* strikeserver);
+ const SkSurfaceProps& props, SkStrikeServer* strikeserver,
+ Settings settings = Settings());
~SkTextBlobCacheDiffCanvas() override;
protected:
@@ -70,10 +80,13 @@ private:
const SkTextBlobRunIterator& it,
const SkPaint& runPaint);
void processGlyphRunForPaths(const SkTextBlobRunIterator& it, const SkPaint& runPaint);
+ void processGlyphRunForDFT(const SkTextBlobRunIterator& it, const SkPaint& runPaint,
+ SkScalerContextFlags flags);
const SkMatrix fDeviceMatrix;
const SkSurfaceProps fSurfaceProps;
SkStrikeServer* const fStrikeServer;
+ const Settings fSettings;
};
using SkDiscardableHandleId = uint32_t;
@@ -161,7 +174,7 @@ public:
};
SkGlyphCacheState* getOrCreateCache(const SkPaint&, const SkSurfaceProps*, const SkMatrix*,
- SkScalerContextRec* deviceRec,
+ SkScalerContextFlags flags, SkScalerContextRec* deviceRec,
SkScalerContextEffects* effects);
private: