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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 1178383003: Revert of Make GrTextContext be owned by the GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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') | src/image/SkImage_Gpu.cpp » ('j') | 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 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());
}
« no previous file with comments | « src/gpu/SkGpuDevice.h ('k') | src/image/SkImage_Gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698