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

Unified Diff: src/gpu/GrStencilAndCoverTextContext.cpp

Issue 1015173002: Let text contexts fall back directly to paths (Closed) Base URL: https://skia.googlesource.com/skia.git@text-blob-to-context
Patch Set: feedback inc Created 5 years, 9 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/GrStencilAndCoverTextContext.cpp
diff --git a/src/gpu/GrStencilAndCoverTextContext.cpp b/src/gpu/GrStencilAndCoverTextContext.cpp
index ec2fa21af0a1604861a4df6e78fdb430e20c657c..4a41c781de62a187c95570a5645ca2ea615c0f29 100644
--- a/src/gpu/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/GrStencilAndCoverTextContext.cpp
@@ -20,19 +20,21 @@
#include "SkTextMapStateProc.h"
#include "SkTextFormatParams.h"
-GrStencilAndCoverTextContext::GrStencilAndCoverTextContext(
- GrContext* context, const SkDeviceProperties& properties)
- : GrTextContext(context, properties)
+GrStencilAndCoverTextContext::GrStencilAndCoverTextContext(GrContext* context,
+ SkGpuDevice* gpuDevice,
+ const SkDeviceProperties& properties)
+ : GrTextContext(context, gpuDevice, properties)
, fStroke(SkStrokeRec::kFill_InitStyle)
, fQueuedGlyphCount(0)
, fFallbackGlyphsIdx(kGlyphBufferSize) {
}
-GrStencilAndCoverTextContext* GrStencilAndCoverTextContext::Create(GrContext* context,
- const SkDeviceProperties& props) {
+GrStencilAndCoverTextContext*
+GrStencilAndCoverTextContext::Create(GrContext* context, SkGpuDevice* gpuDevice,
+ const SkDeviceProperties& props) {
GrStencilAndCoverTextContext* textContext = SkNEW_ARGS(GrStencilAndCoverTextContext,
- (context, props));
- textContext->fFallbackTextContext = GrBitmapTextContext::Create(context, props);
+ (context, gpuDevice, props));
+ textContext->fFallbackTextContext = GrBitmapTextContext::Create(context, gpuDevice, props);
return textContext;
}
@@ -445,11 +447,12 @@ void GrStencilAndCoverTextContext::flush() {
inverse.mapPoints(&fGlyphPositions[fFallbackGlyphsIdx], fallbackGlyphCount);
}
- fFallbackTextContext->drawPosText(fRenderTarget, fClip, paintFallback, skPaintFallback,
- fViewMatrix, (char*)&fGlyphIndices[fFallbackGlyphsIdx],
- 2 * fallbackGlyphCount,
- get_xy_scalar_array(&fGlyphPositions[fFallbackGlyphsIdx]),
- 2, SkPoint::Make(0, 0));
+ fFallbackTextContext->onDrawPosText(
+ fRenderTarget, fClip, paintFallback, skPaintFallback,
+ fViewMatrix, (char*)&fGlyphIndices[fFallbackGlyphsIdx],
+ 2 * fallbackGlyphCount,
+ get_xy_scalar_array(&fGlyphPositions[fFallbackGlyphsIdx]),
+ 2, SkPoint::Make(0, 0));
fFallbackGlyphsIdx = kGlyphBufferSize;
}

Powered by Google App Engine
This is Rietveld 408576698