continue;
}
- bool useGammaCorrectTable = GrPixelConfigIsSRGB(dc->accessRenderTarget()->config()) &&
- !pipelineBuilder->getDisableOutputConversionToSRGB();
-
SkAutoTUnref<GrDrawBatch> batch(this->createBatch(info, glyphCount, run,
subRun, viewMatrix, x, y, color,
skPaint, props,
- distanceAdjustTable, useGammaCorrectTable,
+ distanceAdjustTable, dc->isGammaCorrect(),
cache));
dc->drawBatch(pipelineBuilder, batch);
}
return canonicalColor;
}
-uint32_t GrAtlasTextContext::ComputeScalerContextFlags(GrDrawContext* dc, const GrPaint& grPaint) {
- // If we're rendering to an sRGB render target, and we aren't forcing sRGB blending off,
- // then we can disable the gamma hacks. Otherwise, leave them on. In either case, we still
- // want the contrast boost:
- if (GrPixelConfigIsSRGB(dc->accessRenderTarget()->config()) &&
- !grPaint.getDisableOutputConversionToSRGB()) {
+uint32_t GrAtlasTextContext::ComputeScalerContextFlags(GrDrawContext* dc) {
+ // If we're doing gamma-correct rendering, then we can disable the gamma hacks.
+ // Otherwise, leave them on. In either case, we still want the contrast boost:
+ if (dc->isGammaCorrect()) {
return SkPaint::kBoostContrast_ScalerContextFlag;
} else {
return SkPaint::kFakeGammaAndBoostContrast_ScalerContextFlags;
return;
}
- uint32_t scalerContextFlags = ComputeScalerContextFlags(dc, grPaint);
+ uint32_t scalerContextFlags = ComputeScalerContextFlags(dc);
if (cacheBlob) {
if (cacheBlob->mustRegenerate(skPaint, grPaint.getColor(), blurRec, viewMatrix, x, y)) {
CreateDrawTextBlob(context->getTextBlobCache(), context->getBatchFontCache(),
*context->caps()->shaderCaps(),
paint, skPaint,
- ComputeScalerContextFlags(dc, paint),
+ ComputeScalerContextFlags(dc),
viewMatrix, props,
text, byteLength, x, y));
blob->flushThrowaway(context, dc, props, fDistanceAdjustTable, skPaint, paint,
context->getBatchFontCache(),
*context->caps()->shaderCaps(),
paint, skPaint,
- ComputeScalerContextFlags(dc, paint),
+ ComputeScalerContextFlags(dc),
viewMatrix, props,
text, byteLength,
pos, scalarsPerPosition,
// sets up the descriptor on the blob and returns a detached cache. Client must attach
inline static GrColor ComputeCanonicalColor(const SkPaint&, bool lcd);
// Determines if we need to use fake gamma (and contrast boost):
- inline static uint32_t ComputeScalerContextFlags(GrDrawContext*, const GrPaint&);
+ inline static uint32_t ComputeScalerContextFlags(GrDrawContext*);
static void RegenerateTextBlob(GrAtlasTextBlob* bmp,
GrBatchFontCache*,
const GrShaderCaps&,