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

Side by Side Diff: src/gpu/GrDrawContext.cpp

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 | « no previous file | src/gpu/GrDrawingManager.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 /* 2 /*
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrBatchTest.h" 9 #include "GrBatchTest.h"
10 #include "GrColor.h" 10 #include "GrColor.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 SkScalar x, SkScalar y, const SkIRect& clipBounds) { 113 SkScalar x, SkScalar y, const SkIRect& clipBounds) {
114 ASSERT_SINGLE_OWNER 114 ASSERT_SINGLE_OWNER
115 RETURN_IF_ABANDONED 115 RETURN_IF_ABANDONED
116 SkDEBUGCODE(this->validate();) 116 SkDEBUGCODE(this->validate();)
117 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawText"); 117 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawText");
118 118
119 if (!fTextContext) { 119 if (!fTextContext) {
120 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget ); 120 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget );
121 } 121 }
122 122
123 fTextContext->drawText(this, clip, grPaint, skPaint, viewMatrix, fSurfacePro ps, 123 fTextContext->drawText(fContext, this, clip, grPaint, skPaint, viewMatrix, f SurfaceProps,
124 text, byteLength, x, y, clipBounds); 124 text, byteLength, x, y, clipBounds);
125 } 125 }
126 126
127 void GrDrawContext::drawPosText(const GrClip& clip, const GrPaint& grPaint, 127 void GrDrawContext::drawPosText(const GrClip& clip, const GrPaint& grPaint,
128 const SkPaint& skPaint, 128 const SkPaint& skPaint,
129 const SkMatrix& viewMatrix, 129 const SkMatrix& viewMatrix,
130 const char text[], size_t byteLength, 130 const char text[], size_t byteLength,
131 const SkScalar pos[], int scalarsPerPosition, 131 const SkScalar pos[], int scalarsPerPosition,
132 const SkPoint& offset, const SkIRect& clipBounds ) { 132 const SkPoint& offset, const SkIRect& clipBounds ) {
133 ASSERT_SINGLE_OWNER 133 ASSERT_SINGLE_OWNER
134 RETURN_IF_ABANDONED 134 RETURN_IF_ABANDONED
135 SkDEBUGCODE(this->validate();) 135 SkDEBUGCODE(this->validate();)
136 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawPosText"); 136 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawPosText");
137 137
138 if (!fTextContext) { 138 if (!fTextContext) {
139 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget ); 139 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget );
140 } 140 }
141 141
142 fTextContext->drawPosText(this, clip, grPaint, skPaint, viewMatrix, fSurface Props, text, 142 fTextContext->drawPosText(fContext, this, clip, grPaint, skPaint, viewMatrix , fSurfaceProps,
143 byteLength, pos, scalarsPerPosition, offset, clipB ounds); 143 text, byteLength, pos, scalarsPerPosition, offset, clipBounds);
144 144
145 } 145 }
146 146
147 void GrDrawContext::drawTextBlob(const GrClip& clip, const SkPaint& skPaint, 147 void GrDrawContext::drawTextBlob(const GrClip& clip, const SkPaint& skPaint,
148 const SkMatrix& viewMatrix, const SkTextBlob* b lob, 148 const SkMatrix& viewMatrix, const SkTextBlob* b lob,
149 SkScalar x, SkScalar y, 149 SkScalar x, SkScalar y,
150 SkDrawFilter* filter, const SkIRect& clipBounds ) { 150 SkDrawFilter* filter, const SkIRect& clipBounds ) {
151 ASSERT_SINGLE_OWNER 151 ASSERT_SINGLE_OWNER
152 RETURN_IF_ABANDONED 152 RETURN_IF_ABANDONED
153 SkDEBUGCODE(this->validate();) 153 SkDEBUGCODE(this->validate();)
154 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawTextBlob"); 154 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawTextBlob");
155 155
156 if (!fTextContext) { 156 if (!fTextContext) {
157 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget ); 157 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget );
158 } 158 }
159 159
160 fTextContext->drawTextBlob(this, clip, skPaint, viewMatrix, fSurfaceProps, b lob, x, y, filter, 160 fTextContext->drawTextBlob(fContext, this, clip, skPaint, viewMatrix, fSurfa ceProps, blob, x,
161 clipBounds); 161 y, filter, clipBounds);
162 } 162 }
163 163
164 void GrDrawContext::discard() { 164 void GrDrawContext::discard() {
165 ASSERT_SINGLE_OWNER 165 ASSERT_SINGLE_OWNER
166 RETURN_IF_ABANDONED 166 RETURN_IF_ABANDONED
167 SkDEBUGCODE(this->validate();) 167 SkDEBUGCODE(this->validate();)
168 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::discard"); 168 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::discard");
169 169
170 AutoCheckFlush acf(fDrawingManager); 170 AutoCheckFlush acf(fDrawingManager);
171 this->getDrawTarget()->discard(fRenderTarget); 171 this->getDrawTarget()->discard(fRenderTarget);
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 } 847 }
848 848
849 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b atch) { 849 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b atch) {
850 ASSERT_SINGLE_OWNER 850 ASSERT_SINGLE_OWNER
851 RETURN_IF_ABANDONED 851 RETURN_IF_ABANDONED
852 SkDEBUGCODE(this->validate();) 852 SkDEBUGCODE(this->validate();)
853 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); 853 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch");
854 854
855 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch); 855 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch);
856 } 856 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrDrawingManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698