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

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: move createTextContext to private 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
« no previous file with comments | « 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 a97e42ece0d12072ff7056e7f8fd2bd3120ed62f..0335bcfa6b15f5c7fd598d7054afee04410553ee 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());
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/gpu/SkGpuDevice.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698