Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Unified Diff: src/gpu/GrAtlasTextContext.h

Issue 1065293003: Start caching masks / stroke fills for textblobs (Closed) Base URL: https://skia.googlesource.com/skia.git@textblobloopergm
Patch Set: tweak Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/GrAtlasTextContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAtlasTextContext.h
diff --git a/src/gpu/GrAtlasTextContext.h b/src/gpu/GrAtlasTextContext.h
index 2f4779f03c7aa723ac58b09b54f325ebc119fe6c..04c8f029194adfbfe31169819e80c25b219771d5 100644
--- a/src/gpu/GrAtlasTextContext.h
+++ b/src/gpu/GrAtlasTextContext.h
@@ -14,6 +14,7 @@
#include "GrGeometryProcessor.h"
#include "SkDescriptor.h"
#include "GrMemoryPool.h"
+#include "SkMaskFilter.h"
#include "SkTextBlob.h"
#include "SkTInternalLList.h"
@@ -129,9 +130,7 @@ private:
SkMatrix fViewMatrix;
SkScalar fX;
SkScalar fY;
- SkPaint::Style fStyle;
int fRunCount;
- uint32_t fUniqueID;
GrMemoryPool* fPool;
// all glyph / vertex offsets are into these pools.
@@ -139,12 +138,32 @@ private:
GrGlyph::PackedID* fGlyphIDs;
Run* fRuns;
- static const uint32_t& GetKey(const BitmapTextBlob& blob) {
- return blob.fUniqueID;
+ struct Key {
+ Key() {
+ memset(this, 0, sizeof(Key));
+ }
+ uint32_t fUniqueID;
+ SkPaint::Style fStyle;
+ SkMaskFilter::BlurRec fBlurRec;
bsalomon 2015/04/08 15:38:19 As we discussed, perhaps this should be a bit here
+ struct StrokeInfo {
bsalomon 2015/04/08 15:38:19 similar here I think, style says its stroked, prob
+ SkScalar fFrameWidth;
+ SkScalar fMiterLimit;
+ uint8_t fStrokeJoin;
+ };
+ StrokeInfo fStrokeInfo;
+
+ bool operator==(const Key& other) const {
+ return 0 == memcmp(this, &other, sizeof(Key));
+ }
+ };
+ Key fKey;
+
+ static const Key& GetKey(const BitmapTextBlob& blob) {
+ return blob.fKey;
}
- static uint32_t Hash(const uint32_t& key) {
- return SkChecksum::Mix(key);
+ static uint32_t Hash(const Key& key) {
+ return SkChecksum::Murmur3(&key, sizeof(Key));
}
void operator delete(void* p) {
« no previous file with comments | « no previous file | src/gpu/GrAtlasTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698