Index: src/gpu/SkGpuDevice.cpp |
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp |
index 07c8dc186e6c3d4d4573c277f3f09e5c4b5587a9..18b26435643b379dc7456ff15a91c076f11c522f 100644 |
--- a/src/gpu/SkGpuDevice.cpp |
+++ b/src/gpu/SkGpuDevice.cpp |
@@ -10,7 +10,6 @@ |
#include "GrBlurUtils.h" |
#include "GrContext.h" |
#include "GrDrawContext.h" |
-#include "GrFontScaler.h" |
#include "GrGpu.h" |
#include "GrGpuResourcePriv.h" |
#include "GrLayerHoister.h" |
@@ -138,7 +137,7 @@ |
if (props) { |
return SkDeviceProperties(props->pixelGeometry()); |
} else { |
- return SkDeviceProperties(); |
+ return SkDeviceProperties(SkDeviceProperties::kLegacyLCD_InitType); |
} |
} |
@@ -168,7 +167,8 @@ |
fLegacyBitmap.setPixelRef(pr)->unref(); |
bool useDFT = fSurfaceProps.isUseDistanceFieldFonts(); |
- fDrawContext.reset(SkRef(fContext->drawContext(&this->getLeakyProperties(), useDFT))); |
+ fTextContext = fContext->createTextContext(fRenderTarget, this->getLeakyProperties(), useDFT); |
+ fDrawContext.reset(SkRef(fContext->drawContext())); |
} |
GrRenderTarget* SkGpuDevice::CreateRenderTarget(GrContext* context, SkSurface::Budgeted budgeted, |
@@ -227,6 +227,8 @@ |
delete fDrawProcs; |
} |
+ SkDELETE(fTextContext); |
+ |
fRenderTarget->unref(); |
fContext->unref(); |
} |
@@ -353,9 +355,7 @@ |
SkPixelRef* pr = SkNEW_ARGS(SkGrPixelRef, (fRenderTarget->surfacePriv().info(), fRenderTarget)); |
fLegacyBitmap.setPixelRef(pr)->unref(); |
- bool useDFT = fSurfaceProps.isUseDistanceFieldFonts(); |
- fDrawContext.reset(SkRef(fRenderTarget->getContext()->drawContext(&this->getLeakyProperties(), |
- useDFT))); |
+ fDrawContext.reset(SkRef(fRenderTarget->getContext()->drawContext())); |
} |
/////////////////////////////////////////////////////////////////////////////// |
@@ -1638,7 +1638,7 @@ |
SkDEBUGCODE(this->validate();) |
- fDrawContext->drawText(fRenderTarget, fClip, grPaint, paint, *draw.fMatrix, |
+ fTextContext->drawText(fRenderTarget, fClip, grPaint, paint, *draw.fMatrix, |
(const char *)text, byteLength, x, y, draw.fClip->getBounds()); |
} |
@@ -1655,7 +1655,7 @@ |
SkDEBUGCODE(this->validate();) |
- fDrawContext->drawPosText(fRenderTarget, fClip, grPaint, paint, *draw.fMatrix, |
+ fTextContext->drawPosText(fRenderTarget, fClip, grPaint, paint, *draw.fMatrix, |
(const char *)text, byteLength, pos, scalarsPerPos, offset, |
draw.fClip->getBounds()); |
} |
@@ -1667,7 +1667,7 @@ |
SkDEBUGCODE(this->validate();) |
- fDrawContext->drawTextBlob(fRenderTarget, fClip, paint, *draw.fMatrix, |
+ fTextContext->drawTextBlob(fRenderTarget, fClip, paint, *draw.fMatrix, |
blob, x, y, drawFilter, draw.fClip->getBounds()); |
} |