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

Unified Diff: src/gpu/GrContext.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/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
old mode 100644
new mode 100755
index e8ae18a4e225594c8da0dccf84ede68b454f3a3e..3b77b781ac095642642dbd21fc1b4a1018de3e35
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -15,6 +15,7 @@
#include "GrAARectRenderer.h"
#include "GrBufferAllocPool.h"
#include "GrGpu.h"
+#include "GrDistanceFieldTextContext.h"
#include "GrDrawTargetCaps.h"
#include "GrIndexBuffer.h"
#include "GrInOrderDrawBuffer.h"
@@ -25,6 +26,7 @@
#include "GrResourceCache.h"
#include "GrSoftwarePathRenderer.h"
#include "GrStencilBuffer.h"
+#include "GrStencilAndCoverTextContext.h"
#include "GrTextStrike.h"
#include "GrTracing.h"
#include "SkGr.h"
@@ -232,6 +234,19 @@ void GrContext::getResourceCacheUsage(int* resourceCount, size_t* resourceBytes)
}
}
+GrTextContext* GrContext::createTextContext(GrRenderTarget* renderTarget,
+ const SkDeviceProperties&
+ leakyProperties,
+ bool enableDistanceFieldFonts) {
+ if (fGpu->caps()->pathRenderingSupport()) {
+ if (renderTarget->getStencilBuffer() && renderTarget->isMultisampled()) {
+ return SkNEW_ARGS(GrStencilAndCoverTextContext, (this, leakyProperties));
+ }
+ }
+ return SkNEW_ARGS(GrDistanceFieldTextContext, (this, leakyProperties,
+ enableDistanceFieldFonts));
+}
+
////////////////////////////////////////////////////////////////////////////////
GrTexture* GrContext::findAndRefTexture(const GrTextureDesc& desc,

Powered by Google App Engine
This is Rietveld 408576698