| Index: src/gpu/SkGpuDevice.cpp |
| =================================================================== |
| --- src/gpu/SkGpuDevice.cpp (revision 6206) |
| +++ src/gpu/SkGpuDevice.cpp (working copy) |
| @@ -1784,6 +1784,18 @@ |
| return fDrawProcs; |
| } |
| +struct MinimalRec { |
| + SkScalar gamma; |
| + SkScalar contrast; |
| +}; |
| + |
| +static void GetRec(const SkDescriptor* desc, void* context) { |
| + MinimalRec* minRec = static_cast<MinimalRec*>(context); |
| + const SkScalerContext::Rec* rec = static_cast<const SkScalerContext::Rec*>(desc->findEntry(kRec_SkDescriptorTag, NULL)); |
| + minRec->gamma = rec->getDeviceGamma(); |
| + minRec->contrast = rec->getContrast(); |
| +} |
| + |
| void SkGpuDevice::drawText(const SkDraw& draw, const void* text, |
| size_t byteLength, SkScalar x, SkScalar y, |
| const SkPaint& paint) { |
| @@ -1804,7 +1816,9 @@ |
| &grPaint)) { |
| return; |
| } |
| reed1 2012/10/30 21:09:34 OK, now I'm sure we have too many bool params :) |
| - GrTextContext context(fContext, grPaint); |
| + MinimalRec rec; |
| + paint.descriptorProc(draw.fMatrix, GetRec, &rec, false, false); |
| + GrTextContext context(fContext, grPaint, rec.gamma, rec.contrast); |
| myDraw.fProcs = this->initDrawForText(&context); |
| this->INHERITED::drawText(myDraw, text, byteLength, x, y, paint); |
| } |
| @@ -1832,7 +1846,9 @@ |
| &grPaint)) { |
| return; |
| } |
| - GrTextContext context(fContext, grPaint); |
| + MinimalRec rec; |
| + paint.descriptorProc(draw.fMatrix, GetRec, &rec, false, false); |
| + GrTextContext context(fContext, grPaint, rec.gamma, rec.contrast); |
| myDraw.fProcs = this->initDrawForText(&context); |
| this->INHERITED::drawPosText(myDraw, text, byteLength, pos, constY, |
| scalarsPerPos, paint); |