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

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: cleanup 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
« no previous file with comments | « src/gpu/text/GrAtlasTextContext.cpp ('k') | src/gpu/text/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 void uncachedDrawTextBlob(GrDrawContext* dc, 60 void uncachedDrawTextBlob(GrContext*, GrDrawContext* dc,
61 const GrClip& clip, const SkPaint& skPaint, 61 const GrClip& clip, const SkPaint& skPaint,
62 const SkMatrix& viewMatrix, 62 const SkMatrix& viewMatrix,
63 const SkSurfaceProps&, 63 const SkSurfaceProps&,
64 const SkTextBlob* blob, 64 const SkTextBlob* blob,
65 SkScalar x, SkScalar y, 65 SkScalar x, SkScalar y,
66 SkDrawFilter* drawFilter, 66 SkDrawFilter* drawFilter,
67 const SkIRect& clipBounds); 67 const SkIRect& clipBounds);
68 68
69 class FallbackBlobBuilder; 69 class FallbackBlobBuilder;
70 70
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 GrAtlasTextContext* fFallbackTextConte xt; 150 GrAtlasTextContext* fFallbackTextConte xt;
151 SkTHashMap<uint32_t, TextBlob*> fBlobIdCache; 151 SkTHashMap<uint32_t, TextBlob*> fBlobIdCache;
152 SkTHashTable<TextBlob*, const TextBlob::Key&, TextBlob> fBlobKeyCache; 152 SkTHashTable<TextBlob*, const TextBlob::Key&, TextBlob> fBlobKeyCache;
153 SkTInternalLList<TextBlob> fLRUList; 153 SkTInternalLList<TextBlob> fLRUList;
154 size_t fCacheSize; 154 size_t fCacheSize;
155 155
156 typedef GrTextContext INHERITED; 156 typedef GrTextContext INHERITED;
157 }; 157 };
158 158
159 #endif 159 #endif
OLDNEW
« no previous file with comments | « src/gpu/text/GrAtlasTextContext.cpp ('k') | src/gpu/text/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698