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

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

Issue 1685653004: Move surface props off of GrTextContext (Closed) Base URL: https://skia.googlesource.com/skia.git@tc-cleanup-3
Patch Set: rebase 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.h » ('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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 SkScalar x, SkScalar y, const SkIRect& clipBounds) { 111 SkScalar x, SkScalar y, const SkIRect& clipBounds) {
112 ASSERT_SINGLE_OWNER 112 ASSERT_SINGLE_OWNER
113 RETURN_IF_ABANDONED 113 RETURN_IF_ABANDONED
114 SkDEBUGCODE(this->validate();) 114 SkDEBUGCODE(this->validate();)
115 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawText"); 115 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawText");
116 116
117 if (!fTextContext) { 117 if (!fTextContext) {
118 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget ); 118 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget );
119 } 119 }
120 120
121 fTextContext->drawText(this, clip, grPaint, skPaint, viewMatrix, 121 fTextContext->drawText(this, clip, grPaint, skPaint, viewMatrix, fSurfacePro ps,
122 text, byteLength, x, y, clipBounds); 122 text, byteLength, x, y, clipBounds);
123 } 123 }
124 124
125 void GrDrawContext::drawPosText(const GrClip& clip, const GrPaint& grPaint, 125 void GrDrawContext::drawPosText(const GrClip& clip, const GrPaint& grPaint,
126 const SkPaint& skPaint, 126 const SkPaint& skPaint,
127 const SkMatrix& viewMatrix, 127 const SkMatrix& viewMatrix,
128 const char text[], size_t byteLength, 128 const char text[], size_t byteLength,
129 const SkScalar pos[], int scalarsPerPosition, 129 const SkScalar pos[], int scalarsPerPosition,
130 const SkPoint& offset, const SkIRect& clipBounds ) { 130 const SkPoint& offset, const SkIRect& clipBounds ) {
131 ASSERT_SINGLE_OWNER 131 ASSERT_SINGLE_OWNER
132 RETURN_IF_ABANDONED 132 RETURN_IF_ABANDONED
133 SkDEBUGCODE(this->validate();) 133 SkDEBUGCODE(this->validate();)
134 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawPosText"); 134 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawPosText");
135 135
136 if (!fTextContext) { 136 if (!fTextContext) {
137 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget ); 137 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget );
138 } 138 }
139 139
140 fTextContext->drawPosText(this, clip, grPaint, skPaint, viewMatrix, text, by teLength, 140 fTextContext->drawPosText(this, clip, grPaint, skPaint, viewMatrix, fSurface Props, text,
141 pos, scalarsPerPosition, offset, clipBounds); 141 byteLength, pos, scalarsPerPosition, offset, clipB ounds);
142 142
143 } 143 }
144 144
145 void GrDrawContext::drawTextBlob(const GrClip& clip, const SkPaint& skPaint, 145 void GrDrawContext::drawTextBlob(const GrClip& clip, const SkPaint& skPaint,
146 const SkMatrix& viewMatrix, const SkTextBlob* b lob, 146 const SkMatrix& viewMatrix, const SkTextBlob* b lob,
147 SkScalar x, SkScalar y, 147 SkScalar x, SkScalar y,
148 SkDrawFilter* filter, const SkIRect& clipBounds ) { 148 SkDrawFilter* filter, const SkIRect& clipBounds ) {
149 ASSERT_SINGLE_OWNER 149 ASSERT_SINGLE_OWNER
150 RETURN_IF_ABANDONED 150 RETURN_IF_ABANDONED
151 SkDEBUGCODE(this->validate();) 151 SkDEBUGCODE(this->validate();)
152 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawTextBlob"); 152 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawTextBlob");
153 153
154 if (!fTextContext) { 154 if (!fTextContext) {
155 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget ); 155 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget );
156 } 156 }
157 157
158 fTextContext->drawTextBlob(this, clip, skPaint, viewMatrix, blob, x, y, filt er, clipBounds); 158 fTextContext->drawTextBlob(this, clip, skPaint, viewMatrix, fSurfaceProps, b lob, x, y, filter,
159 clipBounds);
159 } 160 }
160 161
161 void GrDrawContext::discard() { 162 void GrDrawContext::discard() {
162 ASSERT_SINGLE_OWNER 163 ASSERT_SINGLE_OWNER
163 RETURN_IF_ABANDONED 164 RETURN_IF_ABANDONED
164 SkDEBUGCODE(this->validate();) 165 SkDEBUGCODE(this->validate();)
165 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::discard"); 166 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::discard");
166 167
167 AutoCheckFlush acf(fDrawingManager); 168 AutoCheckFlush acf(fDrawingManager);
168 this->getDrawTarget()->discard(fRenderTarget); 169 this->getDrawTarget()->discard(fRenderTarget);
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 } 845 }
845 846
846 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b atch) { 847 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b atch) {
847 ASSERT_SINGLE_OWNER 848 ASSERT_SINGLE_OWNER
848 RETURN_IF_ABANDONED 849 RETURN_IF_ABANDONED
849 SkDEBUGCODE(this->validate();) 850 SkDEBUGCODE(this->validate();)
850 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); 851 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch");
851 852
852 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch); 853 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch);
853 } 854 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrDrawingManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698