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

Unified Diff: src/gpu/text/GrAtlasTextBlob.h

Issue 1686113002: Remove GrTextBlobCache/GrAtlasTextBlob friendliness (Closed) Base URL: https://skia.googlesource.com/skia.git@tc-cleanup-1
Patch Set: build warnings Created 4 years, 10 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/text/GrAtlasTextBlob.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/text/GrAtlasTextBlob.h
diff --git a/src/gpu/text/GrAtlasTextBlob.h b/src/gpu/text/GrAtlasTextBlob.h
index 4351aae748cc294bfc9debb21f23290fc03d8f6c..68cba3d50684de1fb02cdd4a839df0db7f5e6b1b 100644
--- a/src/gpu/text/GrAtlasTextBlob.h
+++ b/src/gpu/text/GrAtlasTextBlob.h
@@ -18,6 +18,7 @@
#include "SkTInternalLList.h"
struct GrDistanceFieldAdjustTable;
+class GrMemoryPool;
class GrTextContext;
class SkDrawFilter;
class SkTextBlob;
@@ -45,16 +46,7 @@ class GrAtlasTextBlob : public SkNVRefCnt<GrAtlasTextBlob> {
public:
SK_DECLARE_INTERNAL_LLIST_INTERFACE(GrAtlasTextBlob);
- GrAtlasTextBlob()
- : fMaxMinScale(-SK_ScalarMax)
- , fMinMaxScale(SK_ScalarMax)
- , fTextType(0) {}
-
- ~GrAtlasTextBlob() {
- for (int i = 0; i < fRunCount; i++) {
- fRuns[i].~Run();
- }
- }
+ static GrAtlasTextBlob* Create(GrMemoryPool* pool, int glyphCount, int runCount);
struct Key {
Key() {
@@ -75,6 +67,20 @@ public:
}
};
+ void setupKey(const GrAtlasTextBlob::Key& key,
+ const SkMaskFilter::BlurRec& blurRec,
+ const SkPaint& paint) {
+ fKey = key;
+ if (key.fHasBlur) {
+ fBlurRec = blurRec;
+ }
+ if (key.fStyle != SkPaint::kFill_Style) {
+ fStrokeInfo.fFrameWidth = paint.getStrokeWidth();
+ fStrokeInfo.fMiterLimit = paint.getStrokeMiter();
+ fStrokeInfo.fJoin = paint.getStrokeJoin();
+ }
+ }
+
static const Key& GetKey(const GrAtlasTextBlob& blob) {
return blob.fKey;
}
@@ -198,6 +204,7 @@ public:
static const size_t kColorTextVASize = sizeof(SkPoint) + sizeof(SkIPoint16);
static const size_t kGrayTextVASize = sizeof(SkPoint) + sizeof(GrColor) + sizeof(SkIPoint16);
static const size_t kLCDTextVASize = kGrayTextVASize;
+ static const size_t kMaxVASize = kGrayTextVASize;
static const int kVerticesPerGlyph = 4;
static void AssertEqual(const GrAtlasTextBlob&, const GrAtlasTextBlob&);
@@ -220,7 +227,20 @@ public:
const GrDistanceFieldAdjustTable* distanceAdjustTable,
GrBatchFontCache* cache);
+ const Key& key() const { return fKey; }
+
+ ~GrAtlasTextBlob() {
+ for (int i = 0; i < fRunCount; i++) {
+ fRuns[i].~Run();
+ }
+ }
+
private:
+ GrAtlasTextBlob()
+ : fMaxMinScale(-SK_ScalarMax)
+ , fMinMaxScale(SK_ScalarMax)
+ , fTextType(0) {}
+
void appendLargeGlyph(GrGlyph* glyph, GrFontScaler* scaler, const SkGlyph& skGlyph,
SkScalar x, SkScalar y, SkScalar scale, bool applyVM);
@@ -456,7 +476,6 @@ private:
uint8_t fTextType;
friend class GrAtlasTextBatch; // We might be able to get rid of this friending
- friend class GrTextBlobCache; // Needs to access the key
};
#endif
« no previous file with comments | « no previous file | src/gpu/text/GrAtlasTextBlob.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698