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

Side by Side Diff: src/gpu/text/GrStencilAndCoverTextContext.h

Issue 1686143003: Remove GrContext* from GrTextContext (Closed) Base URL: https://skia.googlesource.com/skia.git@tc-cleanup-5-movecontext
Patch Set: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrStencilAndCoverTextContext_DEFINED 8 #ifndef GrStencilAndCoverTextContext_DEFINED
9 #define GrStencilAndCoverTextContext_DEFINED 9 #define GrStencilAndCoverTextContext_DEFINED
10 10
(...skipping 10 matching lines...) Expand all
21 class GrPath; 21 class GrPath;
22 class SkSurfaceProps; 22 class SkSurfaceProps;
23 23
24 /* 24 /*
25 * This class implements text rendering using stencil and cover path rendering 25 * This class implements text rendering using stencil and cover path rendering
26 * (by the means of GrDrawTarget::drawPath). 26 * (by the means of GrDrawTarget::drawPath).
27 * This class exposes the functionality through GrTextContext interface. 27 * This class exposes the functionality through GrTextContext interface.
28 */ 28 */
29 class GrStencilAndCoverTextContext : public GrTextContext { 29 class GrStencilAndCoverTextContext : public GrTextContext {
30 public: 30 public:
31 static GrStencilAndCoverTextContext* Create(GrContext*); 31 static GrStencilAndCoverTextContext* Create();
32 32
33 void drawText(GrDrawContext* dc, 33 void drawText(GrContext*, GrDrawContext* dc,
34 const GrClip&, const GrPaint&, const SkPaint&, 34 const GrClip&, const GrPaint&, const SkPaint&,
35 const SkMatrix& viewMatrix, const SkSurfaceProps&, const char text[], 35 const SkMatrix& viewMatrix, const SkSurfaceProps&, const char text[],
36 size_t byteLength, SkScalar x, 36 size_t byteLength, SkScalar x,
37 SkScalar y, const SkIRect& clipBounds) override; 37 SkScalar y, const SkIRect& clipBounds) override;
38 void drawPosText(GrDrawContext*, 38 void drawPosText(GrContext*, GrDrawContext*,
39 const GrClip&, const GrPaint&, const SkPaint&, 39 const GrClip&, const GrPaint&, const SkPaint&,
40 const SkMatrix& viewMatrix, const SkSurfaceProps&, 40 const SkMatrix& viewMatrix, const SkSurfaceProps&,
41 const char text[], size_t byteLength, 41 const char text[], size_t byteLength,
42 const SkScalar pos[], int scalarsPerPosition, 42 const SkScalar pos[], int scalarsPerPosition,
43 const SkPoint& offset, const SkIRect& clipBounds) override; 43 const SkPoint& offset, const SkIRect& clipBounds) override;
44 void drawTextBlob(GrDrawContext*, const GrClip&, const SkPaint&, 44 void drawTextBlob(GrContext*, GrDrawContext*, const GrClip&, const SkPaint&,
45 const SkMatrix& viewMatrix, const SkSurfaceProps&, const S kTextBlob*, 45 const SkMatrix& viewMatrix, const SkSurfaceProps&, const S kTextBlob*,
46 SkScalar x, SkScalar y, 46 SkScalar x, SkScalar y,
47 SkDrawFilter*, const SkIRect& clipBounds) override; 47 SkDrawFilter*, const SkIRect& clipBounds) override;
48 48
49 virtual ~GrStencilAndCoverTextContext(); 49 virtual ~GrStencilAndCoverTextContext();
50 50
51 private: 51 private:
52 GrStencilAndCoverTextContext(GrContext*); 52 GrStencilAndCoverTextContext();
53 53
54 bool canDraw(const SkPaint& skPaint, const SkMatrix&) { 54 bool canDraw(const SkPaint& skPaint, const SkMatrix&) {
55 return this->internalCanDraw(skPaint); 55 return this->internalCanDraw(skPaint);
56 } 56 }
57 57
58 bool internalCanDraw(const SkPaint&); 58 bool internalCanDraw(const SkPaint&);
59 59
60 class FallbackBlobBuilder; 60 class FallbackBlobBuilder;
61 61
62 class TextRun { 62 class TextRun {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 GrAtlasTextContext* fFallbackTextConte xt; 141 GrAtlasTextContext* fFallbackTextConte xt;
142 SkTHashMap<uint32_t, TextBlob*> fBlobIdCache; 142 SkTHashMap<uint32_t, TextBlob*> fBlobIdCache;
143 SkTHashTable<TextBlob*, const TextBlob::Key&, TextBlob> fBlobKeyCache; 143 SkTHashTable<TextBlob*, const TextBlob::Key&, TextBlob> fBlobKeyCache;
144 SkTInternalLList<TextBlob> fLRUList; 144 SkTInternalLList<TextBlob> fLRUList;
145 size_t fCacheSize; 145 size_t fCacheSize;
146 146
147 typedef GrTextContext INHERITED; 147 typedef GrTextContext INHERITED;
148 }; 148 };
149 149
150 #endif 150 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698