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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 1015173002: Let text contexts fall back directly to paths (Closed) Base URL: https://skia.googlesource.com/skia.git@text-blob-to-context
Patch Set: feedback inc Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« src/gpu/GrDistanceFieldTextContext.cpp ('K') | « src/gpu/SkGpuDevice.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index cc8a3c188725b984ac1f0261ef7e21bd073d1497..bb597327d698f4d7867b6a8b8626c23ba77dd601 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -160,7 +160,8 @@ SkGpuDevice::SkGpuDevice(GrRenderTarget* rt, const SkSurfaceProps* props, unsign
fLegacyBitmap.setPixelRef(pr)->unref();
bool useDFT = fSurfaceProps.isUseDistanceFieldFonts();
- fTextContext = fContext->createTextContext(fRenderTarget, this->getLeakyProperties(), useDFT);
+ fTextContext = fContext->createTextContext(fRenderTarget, this, this->getLeakyProperties(),
+ useDFT);
}
GrRenderTarget* SkGpuDevice::CreateRenderTarget(GrContext* context, SkSurface::Budgeted budgeted,
@@ -1824,11 +1825,8 @@ void SkGpuDevice::drawText(const SkDraw& draw, const void* text,
SkDEBUGCODE(this->validate();)
- if (!fTextContext->drawText(fRenderTarget, fClip, grPaint, paint, *draw.fMatrix,
- (const char *)text, byteLength, x, y)) {
- // this will just call our drawPath()
- draw.drawText_asPaths((const char*)text, byteLength, x, y, paint);
- }
+ fTextContext->drawText(fRenderTarget, fClip, grPaint, paint, *draw.fMatrix,
+ (const char *)text, byteLength, x, y, draw.fClip->getBounds());
}
void SkGpuDevice::drawPosText(const SkDraw& draw, const void* text, size_t byteLength,
@@ -1842,11 +1840,9 @@ void SkGpuDevice::drawPosText(const SkDraw& draw, const void* text, size_t byteL
SkDEBUGCODE(this->validate();)
- if (!fTextContext->drawPosText(fRenderTarget, fClip, grPaint, paint, *draw.fMatrix,
- (const char *)text, byteLength, pos, scalarsPerPos, offset)) {
- // this will just call our drawPath()
- draw.drawPosText_asPaths((const char*)text, byteLength, pos, scalarsPerPos, offset, paint);
- }
+ fTextContext->drawPosText(fRenderTarget, fClip, grPaint, paint, *draw.fMatrix,
+ (const char *)text, byteLength, pos, scalarsPerPos, offset,
+ draw.fClip->getBounds());
}
///////////////////////////////////////////////////////////////////////////////
« src/gpu/GrDistanceFieldTextContext.cpp ('K') | « src/gpu/SkGpuDevice.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698