aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/SkGpuDevice_drawTexture.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-01-17 09:27:35 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-17 14:50:46 +0000
commit4e6cf91b7e6f7908d941275dc56c829143345402 (patch)
tree7b72b4072c5c7001928d5d564bd229f7ce63f299 /src/gpu/SkGpuDevice_drawTexture.cpp
parent6ea9fdf70cbf5903c8a10531862348f8dff09542 (diff)
Add macro to disable using GrTextureOp for AA in Chrome
Bug: chromium:802408 Bug: chromium:801783 Change-Id: Id5f097b1df08e21e1385efeb8dd8a5e61305a013 Reviewed-on: https://skia-review.googlesource.com/95564 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/SkGpuDevice_drawTexture.cpp')
-rw-r--r--src/gpu/SkGpuDevice_drawTexture.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/gpu/SkGpuDevice_drawTexture.cpp b/src/gpu/SkGpuDevice_drawTexture.cpp
index f8e5f74311..9e980cddb5 100644
--- a/src/gpu/SkGpuDevice_drawTexture.cpp
+++ b/src/gpu/SkGpuDevice_drawTexture.cpp
@@ -91,8 +91,14 @@ static bool can_ignore_bilerp_constraint(const GrTextureProducer& producer,
* GrRenderTargetContext::drawTextureAffine. It is more effecient than the GrTextureProducer
* general case.
*/
-static bool can_use_draw_texture_affine(const SkPaint& paint, const SkMatrix& ctm,
+static bool can_use_draw_texture_affine(const SkPaint& paint, GrAA aa, const SkMatrix& ctm,
SkCanvas::SrcRectConstraint constraint) {
+// This is disabled in Chrome until crbug.com/802408 and crbug.com/801783 can be sorted out.
+#ifdef SK_DISABLE_TEXTURE_OP_AA
+ if (GrAA::kYes == aa) {
+ return false;
+ }
+#endif
return (!paint.getColorFilter() && !paint.getShader() && !paint.getMaskFilter() &&
!paint.getImageFilter() && paint.getFilterQuality() < kMedium_SkFilterQuality &&
paint.getBlendMode() == SkBlendMode::kSrcOver && !ctm.hasPerspective() &&
@@ -141,9 +147,10 @@ void SkGpuDevice::drawPinnedTextureProxy(sk_sp<GrTextureProxy> proxy, uint32_t p
const SkRect* srcRect, const SkRect* dstRect,
SkCanvas::SrcRectConstraint constraint,
const SkMatrix& viewMatrix, const SkPaint& paint) {
- if (can_use_draw_texture_affine(paint, this->ctm(), constraint)) {
- draw_texture_affine(paint, viewMatrix, srcRect, dstRect, GrAA(paint.isAntiAlias()),
- std::move(proxy), colorSpace, this->clip(), fRenderTargetContext.get());
+ GrAA aa = GrAA(paint.isAntiAlias());
+ if (can_use_draw_texture_affine(paint, aa, this->ctm(), constraint)) {
+ draw_texture_affine(paint, viewMatrix, srcRect, dstRect, aa, std::move(proxy), colorSpace,
+ this->clip(), fRenderTargetContext.get());
return;
}
GrTextureAdjuster adjuster(this->context(), std::move(proxy), alphaType, pinnedUniqueID,
@@ -155,7 +162,8 @@ void SkGpuDevice::drawTextureMaker(GrTextureMaker* maker, int imageW, int imageH
const SkRect* srcRect, const SkRect* dstRect,
SkCanvas::SrcRectConstraint constraint,
const SkMatrix& viewMatrix, const SkPaint& paint) {
- if (can_use_draw_texture_affine(paint, viewMatrix, constraint)) {
+ GrAA aa = GrAA(paint.isAntiAlias());
+ if (can_use_draw_texture_affine(paint, aa, viewMatrix, constraint)) {
sk_sp<SkColorSpace> cs;
// We've done enough checks above to allow us to pass ClampNearest() and not check for
// scaling adjustments.
@@ -165,8 +173,8 @@ void SkGpuDevice::drawTextureMaker(GrTextureMaker* maker, int imageW, int imageH
if (!proxy) {
return;
}
- draw_texture_affine(paint, viewMatrix, srcRect, dstRect, GrAA(paint.isAntiAlias()),
- std::move(proxy), cs.get(), this->clip(), fRenderTargetContext.get());
+ draw_texture_affine(paint, viewMatrix, srcRect, dstRect, aa, std::move(proxy), cs.get(),
+ this->clip(), fRenderTargetContext.get());
return;
}
this->drawTextureProducer(maker, srcRect, dstRect, constraint, viewMatrix, paint);