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

Unified Diff: src/gpu/GrAtlasTextContext.cpp

Issue 1494083003: Reduce calls sites where both the GrDrawContext & GrRenderTarget are both passed (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrAtlasTextContext.h ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAtlasTextContext.cpp
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp
index 7d0d93684cd206758114f21f1d4a5f060c3f7868..bfc58f58b919c6afc8b790f1817dd2dbaf88448d 100644
--- a/src/gpu/GrAtlasTextContext.cpp
+++ b/src/gpu/GrAtlasTextContext.cpp
@@ -290,7 +290,7 @@ inline SkGlyphCache* GrAtlasTextContext::setupCache(GrAtlasTextBlob::Run* run,
return SkGlyphCache::DetachCache(run->fTypeface, run->fDescriptor.getDesc());
}
-void GrAtlasTextContext::drawTextBlob(GrDrawContext* dc, GrRenderTarget* rt,
+void GrAtlasTextContext::drawTextBlob(GrDrawContext* dc,
const GrClip& clip, const SkPaint& skPaint,
const SkMatrix& viewMatrix, const SkTextBlob* blob,
SkScalar x, SkScalar y,
@@ -385,7 +385,7 @@ void GrAtlasTextContext::drawTextBlob(GrDrawContext* dc, GrRenderTarget* rt,
blob, x, y, drawFilter, clip);
}
- this->flush(blob, cacheBlob, dc, rt, skPaint, grPaint, drawFilter,
+ this->flush(blob, cacheBlob, dc, skPaint, grPaint, drawFilter,
clip, viewMatrix, clipBounds, x, y, transX, transY);
}
@@ -718,7 +718,7 @@ GrAtlasTextContext::createDrawPosTextBlob(const GrClip& clip,
return blob;
}
-void GrAtlasTextContext::onDrawText(GrDrawContext* dc, GrRenderTarget* rt,
+void GrAtlasTextContext::onDrawText(GrDrawContext* dc,
const GrClip& clip,
const GrPaint& paint, const SkPaint& skPaint,
const SkMatrix& viewMatrix,
@@ -727,10 +727,10 @@ void GrAtlasTextContext::onDrawText(GrDrawContext* dc, GrRenderTarget* rt,
SkAutoTUnref<GrAtlasTextBlob> blob(
this->createDrawTextBlob(clip, paint, skPaint, viewMatrix,
text, byteLength, x, y, regionClipBounds));
- this->flush(blob, dc, rt, skPaint, paint, clip, regionClipBounds);
+ this->flush(blob, dc, skPaint, paint, clip, regionClipBounds);
}
-void GrAtlasTextContext::onDrawPosText(GrDrawContext* dc, GrRenderTarget* rt,
+void GrAtlasTextContext::onDrawPosText(GrDrawContext* dc,
const GrClip& clip,
const GrPaint& paint, const SkPaint& skPaint,
const SkMatrix& viewMatrix,
@@ -743,7 +743,7 @@ void GrAtlasTextContext::onDrawPosText(GrDrawContext* dc, GrRenderTarget* rt,
pos, scalarsPerPosition,
offset, regionClipBounds));
- this->flush(blob, dc, rt, skPaint, paint, clip, regionClipBounds);
+ this->flush(blob, dc, skPaint, paint, clip, regionClipBounds);
}
void GrAtlasTextContext::internalDrawBMPText(GrAtlasTextBlob* blob, int runIndex,
@@ -1294,7 +1294,6 @@ inline void GrAtlasTextContext::flushBigGlyphs(GrAtlasTextBlob* cacheBlob,
void GrAtlasTextContext::flush(const SkTextBlob* blob,
GrAtlasTextBlob* cacheBlob,
GrDrawContext* dc,
- GrRenderTarget* rt,
const SkPaint& skPaint,
const GrPaint& grPaint,
SkDrawFilter* drawFilter,
@@ -1305,7 +1304,7 @@ void GrAtlasTextContext::flush(const SkTextBlob* blob,
SkScalar transX, SkScalar transY) {
// We loop through the runs of the blob, flushing each. If any run is too large, then we flush
// it as paths
- GrPipelineBuilder pipelineBuilder(grPaint, rt, clip);
+ GrPipelineBuilder pipelineBuilder(grPaint, dc->accessRenderTarget(), clip);
GrColor color = grPaint.getColor();
@@ -1327,12 +1326,11 @@ void GrAtlasTextContext::flush(const SkTextBlob* blob,
void GrAtlasTextContext::flush(GrAtlasTextBlob* cacheBlob,
GrDrawContext* dc,
- GrRenderTarget* rt,
const SkPaint& skPaint,
const GrPaint& grPaint,
const GrClip& clip,
const SkIRect& clipBounds) {
- GrPipelineBuilder pipelineBuilder(grPaint, rt, clip);
+ GrPipelineBuilder pipelineBuilder(grPaint, dc->accessRenderTarget(), clip);
GrColor color = grPaint.getColor();
for (int run = 0; run < cacheBlob->fRunCount; run++) {
« no previous file with comments | « src/gpu/GrAtlasTextContext.h ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698