aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkRemoteGlyphCache.h
diff options
context:
space:
mode:
authorGravatar Khushal <khushalsagar@chromium.org>2018-07-23 13:40:37 -0700
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-25 18:07:46 +0000
commit1c94a8fabed7196e985a0ed81ce8325c8f606940 (patch)
tree1cdf840298a3f7730fc181e236a626b008ae9b42 /src/core/SkRemoteGlyphCache.h
parent1d474dd1941bfdfec7a5a005b37ddc96482a7706 (diff)
fonts: Don't recompute device descs on glyph cache hit.
Testing using serialization PaintOpPerfTest, this had the following improvement in serialization speed: Before: ~515,000 ops/s After: ~600,000 ops/s R=herb@google.com Change-Id: Iefd80467ea4ff7cc88e8ca1f431883502d249857 Reviewed-on: https://skia-review.googlesource.com/142972 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
Diffstat (limited to 'src/core/SkRemoteGlyphCache.h')
-rw-r--r--src/core/SkRemoteGlyphCache.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/core/SkRemoteGlyphCache.h b/src/core/SkRemoteGlyphCache.h
index 157e058331..66b09d42f2 100644
--- a/src/core/SkRemoteGlyphCache.h
+++ b/src/core/SkRemoteGlyphCache.h
@@ -24,6 +24,7 @@
#include "SkTypeface.h"
class Serializer;
+enum SkAxisAlignment : uint32_t;
class SkDescriptor;
class SkGlyphCache;
struct SkPackedGlyphID;
@@ -124,7 +125,9 @@ public:
public:
SkGlyphCacheState(std::unique_ptr<SkDescriptor> deviceDescriptor,
std::unique_ptr<SkDescriptor> keyDescriptor,
- SkDiscardableHandleId discardableHandleId);
+ SkDiscardableHandleId discardableHandleId,
+ bool isSubpixel,
+ SkAxisAlignment axisAlignmentForHText);
~SkGlyphCacheState();
void addGlyph(SkTypeface*, const SkScalerContextEffects&, SkPackedGlyphID, bool pathOnly);
@@ -133,6 +136,8 @@ public:
const SkDescriptor& getDeviceDescriptor() {
return *fDeviceDescriptor;
}
+ bool isSubpixel() const { return fIsSubpixel; }
+ SkAxisAlignment axisAlignmentForHText() const { return fAxisAlignmentForHText; }
const SkDescriptor& getKeyDescriptor() {
return *fKeyDescriptor;
@@ -159,7 +164,9 @@ public:
// create descriptors with out the device filtering, thus matching the key descriptor.
std::unique_ptr<SkDescriptor> fDeviceDescriptor;
std::unique_ptr<SkDescriptor> fKeyDescriptor;
- const SkDiscardableHandleId fDiscardableHandleId = static_cast<SkDiscardableHandleId>(-1);
+ const SkDiscardableHandleId fDiscardableHandleId;
+ const bool fIsSubpixel;
+ const SkAxisAlignment fAxisAlignmentForHText;
// The context built using fDeviceDescriptor
std::unique_ptr<SkScalerContext> fContext;
@@ -169,7 +176,7 @@ public:
};
SkGlyphCacheState* getOrCreateCache(const SkPaint&, const SkSurfaceProps*, const SkMatrix*,
- SkScalerContextFlags flags, SkScalerContextRec* deviceRec,
+ SkScalerContextFlags flags,
SkScalerContextEffects* effects);
private: