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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 196133014: Implement text rendering with NVPR (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase and fix postext Created 6 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
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 8d3f75ade08cd9eb3ee8131422174087b1b26d27..36cd19ebdb1858c7bc0f0cf54be5a599daf51534 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -191,11 +191,6 @@ void SkGpuDevice::initFromRenderTarget(GrContext* context,
fContext = context;
fContext->ref();
- bool useDFFonts = !!(flags & kDFFonts_Flag);
- fMainTextContext = SkNEW_ARGS(GrDistanceFieldTextContext, (fContext, fLeakyProperties,
- useDFFonts));
- fFallbackTextContext = SkNEW_ARGS(GrBitmapTextContext, (fContext, fLeakyProperties));
-
fRenderTarget = NULL;
fNeedClear = flags & kNeedClear_Flag;
@@ -217,6 +212,10 @@ void SkGpuDevice::initFromRenderTarget(GrContext* context,
SkPixelRef* pr = SkNEW_ARGS(SkGrPixelRef, (info, surface, SkToBool(flags & kCached_Flag)));
this->setPixelRef(pr)->unref();
+
+ bool useDFFonts = !!(flags & kDFFonts_Flag);
+ fMainTextContext = fContext->createTextContext(fRenderTarget, fLeakyProperties, useDFFonts);
+ fFallbackTextContext = SkNEW_ARGS(GrBitmapTextContext, (fContext, fLeakyProperties));
}
SkGpuDevice* SkGpuDevice::Create(GrContext* context, const SkImageInfo& origInfo,

Powered by Google App Engine
This is Rietveld 408576698