aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ops/GrAtlasTextOp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/ops/GrAtlasTextOp.cpp')
-rw-r--r--src/gpu/ops/GrAtlasTextOp.cpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/gpu/ops/GrAtlasTextOp.cpp b/src/gpu/ops/GrAtlasTextOp.cpp
index be320ce545..89329b5433 100644
--- a/src/gpu/ops/GrAtlasTextOp.cpp
+++ b/src/gpu/ops/GrAtlasTextOp.cpp
@@ -82,8 +82,8 @@ void GrAtlasTextOp::onPrepareDraws(Target* target) const {
return;
}
- GrTexture* texture = fFontCache->getTexture(this->maskFormat());
- if (!texture) {
+ sk_sp<GrTextureProxy> proxy = fFontCache->getProxy(this->maskFormat());
+ if (!proxy) {
SkDebugf("Could not allocate backing texture for atlas\n");
return;
}
@@ -93,11 +93,14 @@ void GrAtlasTextOp::onPrepareDraws(Target* target) const {
FlushInfo flushInfo;
if (this->usesDistanceFields()) {
flushInfo.fGeometryProcessor =
- this->setupDfProcessor(this->viewMatrix(), fFilteredColor, this->color(), texture);
+ this->setupDfProcessor(fFontCache->context(), this->viewMatrix(),
+ fFilteredColor, this->color(), std::move(proxy));
} else {
GrSamplerParams params(SkShader::kClamp_TileMode, GrSamplerParams::kNone_FilterMode);
flushInfo.fGeometryProcessor = GrBitmapTextGeoProc::Make(
- this->color(), texture, params, maskFormat, localMatrix, this->usesLocalCoords());
+ fFontCache->context(),
+ this->color(), std::move(proxy), params,
+ maskFormat, localMatrix, this->usesLocalCoords());
}
flushInfo.fGlyphsToFlush = 0;
@@ -230,10 +233,11 @@ bool GrAtlasTextOp::onCombineIfPossible(GrOp* t, const GrCaps& caps) {
// TODO just use class params
// TODO trying to figure out why lcd is so whack
-sk_sp<GrGeometryProcessor> GrAtlasTextOp::setupDfProcessor(const SkMatrix& viewMatrix,
+sk_sp<GrGeometryProcessor> GrAtlasTextOp::setupDfProcessor(GrContext* context,
+ const SkMatrix& viewMatrix,
SkColor filteredColor,
GrColor color,
- GrTexture* texture) const {
+ sk_sp<GrTextureProxy> proxy) const {
GrSamplerParams params(SkShader::kClamp_TileMode, GrSamplerParams::kBilerp_FilterMode);
bool isLCD = this->isLCD();
// set up any flags
@@ -261,18 +265,20 @@ sk_sp<GrGeometryProcessor> GrAtlasTextOp::setupDfProcessor(const SkMatrix& viewM
GrDistanceFieldLCDTextGeoProc::DistanceAdjust::Make(
redCorrection, greenCorrection, blueCorrection);
- return GrDistanceFieldLCDTextGeoProc::Make(
- color, viewMatrix, texture, params, widthAdjust, flags, this->usesLocalCoords());
+ return GrDistanceFieldLCDTextGeoProc::Make(context, color, viewMatrix, std::move(proxy),
+ params, widthAdjust, flags,
+ this->usesLocalCoords());
} else {
#ifdef SK_GAMMA_APPLY_TO_A8
U8CPU lum = SkColorSpaceLuminance::computeLuminance(SK_GAMMA_EXPONENT, filteredColor);
float correction = fDistanceAdjustTable->getAdjustment(lum >> kDistanceAdjustLumShift,
fUseGammaCorrectDistanceTable);
- return GrDistanceFieldA8TextGeoProc::Make(
- color, viewMatrix, texture, params, correction, flags, this->usesLocalCoords());
+ return GrDistanceFieldA8TextGeoProc::Make(context, color, viewMatrix, std::move(proxy),
+ params, correction, flags,
+ this->usesLocalCoords());
#else
- return GrDistanceFieldA8TextGeoProc::Make(
- color, viewMatrix, texture, params, flags, this->usesLocalCoords());
+ return GrDistanceFieldA8TextGeoProc::Make(context, color, viewMatrix, std::move(proxy),
+ params, flags, this->usesLocalCoords());
#endif
}
}