aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkRemoteGlyphCache.h
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2018-05-03 17:05:30 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-08 18:14:04 +0000
commite1f566f2fd52e57cc945c0c9a3d7c19b4945b7b0 (patch)
treee919cabe9a31aaaa376593780b89de1274b9afae /src/core/SkRemoteGlyphCache.h
parent60c67490a1f2d055bc4202990882621ca82f3839 (diff)
Use device and key descriptors
Change-Id: I2ac13303376f3d1464dd1e259637374a9c5ef237 Reviewed-on: https://skia-review.googlesource.com/125823 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Khushal Sagar <khushalsagar@google.com>
Diffstat (limited to 'src/core/SkRemoteGlyphCache.h')
-rw-r--r--src/core/SkRemoteGlyphCache.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/core/SkRemoteGlyphCache.h b/src/core/SkRemoteGlyphCache.h
index bbf374d9c6..37a49b6a1f 100644
--- a/src/core/SkRemoteGlyphCache.h
+++ b/src/core/SkRemoteGlyphCache.h
@@ -117,7 +117,8 @@ public:
// Methods used internally in skia ------------------------------------------
class SkGlyphCacheState {
public:
- SkGlyphCacheState(std::unique_ptr<SkDescriptor> desc,
+ SkGlyphCacheState(std::unique_ptr<SkDescriptor> deviceDescriptor,
+ std::unique_ptr<SkDescriptor> keyDescriptor,
SkDiscardableHandleId discardableHandleId);
~SkGlyphCacheState();
@@ -125,6 +126,13 @@ public:
void writePendingGlyphs(Serializer* serializer);
bool has_pending_glyphs() const { return !fPendingGlyphs.empty(); }
SkDiscardableHandleId discardable_handle_id() const { return fDiscardableHandleId; }
+ const SkDescriptor& getDeviceDescriptor() {
+ return *fDeviceDescriptor;
+ }
+
+ const SkDescriptor& getKeyDescriptor() {
+ return *fKeyDescriptor;
+ }
private:
// The set of glyphs cached on the remote client.
@@ -134,11 +142,19 @@ public:
// remote client.
std::vector<SkPackedGlyphID> fPendingGlyphs;
- std::unique_ptr<SkDescriptor> fDesc;
+ // The device descriptor is used to create the scaler context. The glyphs to have the
+ // correct device rendering. The key descriptor is used for communication. The GPU side will
+ // 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 = -1;
+
+ // The context built using fDeviceDescriptor
std::unique_ptr<SkScalerContext> fContext;
};
- SkGlyphCacheState* getOrCreateCache(SkTypeface*, std::unique_ptr<SkDescriptor>);
+
+ SkGlyphCacheState* getOrCreateCache(
+ SkTypeface*, std::unique_ptr<SkDescriptor>, std::unique_ptr<SkDescriptor>);
private:
SkDescriptorMap<std::unique_ptr<SkGlyphCacheState>> fRemoteGlyphStateMap;