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

Unified Diff: src/gpu/GrBitmapTextContext.cpp

Issue 144283002: Add factory class for generating various flavors of GrTextContext. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add placement delete for ManagedTextContext Created 6 years, 11 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 | « include/gpu/SkGpuDevice.h ('k') | src/gpu/GrDistanceFieldTextContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrBitmapTextContext.cpp
diff --git a/src/gpu/GrBitmapTextContext.cpp b/src/gpu/GrBitmapTextContext.cpp
index a43c4a28746be3551b07d9dd9e68ca97df4293ed..6e33d90d07fb53f0af25139664a20fb7dbffbf87 100755
--- a/src/gpu/GrBitmapTextContext.cpp
+++ b/src/gpu/GrBitmapTextContext.cpp
@@ -24,12 +24,10 @@ SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false,
"Dump the contents of the font cache before every purge.");
GrBitmapTextContext::GrBitmapTextContext(GrContext* context, const GrPaint& paint,
- SkColor color) :
- GrTextContext(context, paint) {
+ const SkPaint& skPaint) :
+ GrTextContext(context, paint, skPaint) {
fAutoMatrix.setIdentity(fContext, &fPaint);
- fSkPaintColor = color;
-
fStrike = NULL;
fCurrTexture = NULL;
@@ -83,11 +81,11 @@ void GrBitmapTextContext::flushGlyphs() {
// alpha. Instead we feed in a non-premultiplied color, and multiply its alpha by
// the mask texture color. The end result is that we get
// mask*paintAlpha*paintColor + (1-mask*paintAlpha)*dstColor
- int a = SkColorGetA(fSkPaintColor);
+ int a = SkColorGetA(fSkPaint.getColor());
// paintAlpha
drawState->setColor(SkColorSetARGB(a, a, a, a));
// paintColor
- drawState->setBlendConstant(skcolor_to_grcolor_nopremultiply(fSkPaintColor));
+ drawState->setBlendConstant(skcolor_to_grcolor_nopremultiply(fSkPaint.getColor()));
drawState->setBlendFunc(kConstC_GrBlendCoeff, kISC_GrBlendCoeff);
} else {
// set back to normal in case we took LCD path previously.
« no previous file with comments | « include/gpu/SkGpuDevice.h ('k') | src/gpu/GrDistanceFieldTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698