Skip to content

Commit 2604a89

Browse files
herbderbySkia Commit-Bot
authored and
Skia Commit-Bot
committed
make single draw() for SubRun
Change-Id: I293298562393bcd092d719e1402d361528d8369f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302336 Reviewed-by: Robert Phillips <[email protected]> Commit-Queue: Herb Derby <[email protected]>
1 parent 52ceaea commit 2604a89

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

src/gpu/GrRenderTargetContext.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -504,14 +504,7 @@ void GrRenderTargetContext::drawGlyphRunList(const GrClip* clip,
504504
}
505505

506506
for (GrTextBlob::SubRun* subRun : blob->subRunList()) {
507-
if (subRun->drawAsPaths()) {
508-
subRun->drawPaths(clip, viewMatrix, glyphRunList, this);
509-
} else {
510-
auto [drawingClip, op] = subRun->makeAtlasTextOp(clip, viewMatrix, glyphRunList, this);
511-
if (op != nullptr) {
512-
this->addDrawOp(drawingClip, std::move(op));
513-
}
514-
}
507+
subRun->draw(clip, viewMatrix, glyphRunList, this);
515508
}
516509
}
517510

src/gpu/GrRenderTargetContextPriv.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ class GrRenderTargetContextPriv {
110110
return fRenderTargetContext->asRenderTargetProxy()->refsWrappedObjects();
111111
}
112112

113+
void addDrawOp(const GrClip* clip, std::unique_ptr<GrDrawOp> op) {
114+
fRenderTargetContext->addDrawOp(clip, std::move(op));
115+
}
116+
113117
private:
114118
explicit GrRenderTargetContextPriv(GrRenderTargetContext* renderTargetContext)
115119
: fRenderTargetContext(renderTargetContext) {}

src/gpu/text/GrTextBlob.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,20 @@ void GrTextBlob::SubRun::drawPaths(const GrClip* clip,
244244
}
245245
}
246246

247+
void GrTextBlob::SubRun::draw(const GrClip* clip,
248+
const SkMatrixProvider& viewMatrix,
249+
const SkGlyphRunList& glyphRunList,
250+
GrRenderTargetContext* rtc) {
251+
if (this->drawAsPaths()) {
252+
this->drawPaths(clip, viewMatrix, glyphRunList, rtc);
253+
} else {
254+
auto [drawingClip, op] = this->makeAtlasTextOp(clip, viewMatrix, glyphRunList, rtc);
255+
if (op != nullptr) {
256+
rtc->priv().addDrawOp(drawingClip, std::move(op));
257+
}
258+
}
259+
}
260+
247261
void GrTextBlob::SubRun::resetBulkUseToken() { fBulkUseToken.reset(); }
248262

249263
GrDrawOpAtlas::BulkUseTokenUpdater* GrTextBlob::SubRun::bulkUseToken() { return &fBulkUseToken; }

src/gpu/text/GrTextBlob.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,11 @@ class GrTextBlob::SubRun {
272272
const SkGlyphRunList& glyphRunList,
273273
GrRenderTargetContext* rtc);
274274

275+
void draw(const GrClip* clip,
276+
const SkMatrixProvider& viewMatrix,
277+
const SkGlyphRunList& glyphRunList,
278+
GrRenderTargetContext* rtc);
279+
275280
// TODO when this object is more internal, drop the privacy
276281
void resetBulkUseToken();
277282
GrDrawOpAtlas::BulkUseTokenUpdater* bulkUseToken();

0 commit comments

Comments
 (0)