aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/SkGpuDevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/SkGpuDevice.cpp')
-rw-r--r--src/gpu/SkGpuDevice.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 07c8dc186e..18b2643564 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 @@ static SkDeviceProperties surfaceprops_to_deviceprops(const SkSurfaceProps* prop
if (props) {
return SkDeviceProperties(props->pixelGeometry());
} else {
- return SkDeviceProperties();
+ return SkDeviceProperties(SkDeviceProperties::kLegacyLCD_InitType);
}
}
@@ -168,7 +167,8 @@ SkGpuDevice::SkGpuDevice(GrRenderTarget* rt, int width, int height,
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 @@ SkGpuDevice::~SkGpuDevice() {
delete fDrawProcs;
}
+ SkDELETE(fTextContext);
+
fRenderTarget->unref();
fContext->unref();
}
@@ -353,9 +355,7 @@ void SkGpuDevice::replaceRenderTarget(bool shouldRetainContent) {
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 @@ void SkGpuDevice::drawText(const SkDraw& draw, const void* text,
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 @@ void SkGpuDevice::drawPosText(const SkDraw& draw, const void* text, size_t byteL
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 @@ void SkGpuDevice::drawTextBlob(const SkDraw& draw, const SkTextBlob* blob, SkSca
SkDEBUGCODE(this->validate();)
- fDrawContext->drawTextBlob(fRenderTarget, fClip, paint, *draw.fMatrix,
+ fTextContext->drawTextBlob(fRenderTarget, fClip, paint, *draw.fMatrix,
blob, x, y, drawFilter, draw.fClip->getBounds());
}