Break GrTextContext's reliance on SkGpuDevice
This CL seems to have 2 main downsides:
1) It duplicates some code in SkBaseDevice::filterTextFlags
2) It makes it tougher to derive from SkGpuDevice
It seems reasonable (at least to me) that the TextContexts get the power to reset the LCD flags.
Review URL: https://codereview.chromium.org/1159973002
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 0008540..90e53a0 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1659,25 +1659,14 @@
SkDEBUGCODE(this->validate();)
- fTextContext->drawTextBlob(this, fRenderTarget, fClip, paint, *draw.fMatrix,
+ fTextContext->drawTextBlob(fRenderTarget, fClip, paint, *draw.fMatrix,
blob, x, y, drawFilter, draw.fClip->getBounds());
}
///////////////////////////////////////////////////////////////////////////////
bool SkGpuDevice::onShouldDisableLCD(const SkPaint& paint) const {
- if (paint.getShader() ||
- !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode) ||
- paint.getMaskFilter() ||
- paint.getRasterizer() ||
- paint.getColorFilter() ||
- paint.getPathEffect() ||
- paint.isFakeBoldText() ||
- paint.getStyle() != SkPaint::kFill_Style)
- {
- return true;
- }
- return false;
+ return GrTextContext::ShouldDisableLCD(paint);
}
void SkGpuDevice::flush() {