diff options
author | joshualitt <joshualitt@chromium.org> | 2015-08-17 11:53:44 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-17 11:53:44 -0700 |
commit | 1a899c9d547e5f12505e5bf654e4fb8b7dda0669 (patch) | |
tree | 360d0614d4cd4bf203ff461b69503e9650edf8db /src/gpu | |
parent | dcbaa8ab6d8179238605955ee2b41f5a9df07348 (diff) |
Stop ping ponging AA in SkGpuDevice
BUG=skia:
Review URL: https://codereview.chromium.org/1299703003
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 7052d2531c..c808ade6c6 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -1032,34 +1032,12 @@ void SkGpuDevice::drawBitmapCommon(const SkDraw& draw, // anti-aliased edges, we work around that for now by drawing directly // if the image size exceeds maximum texture size. int maxTextureSize = fContext->caps()->maxTextureSize(); - bool directDraw = fRenderTarget->isUnifiedMultisampled() || - !paint.isAntiAlias() || - bitmap.width() > maxTextureSize || - bitmap.height() > maxTextureSize; - - // we check whether dst rect are pixel aligned - if (!directDraw) { - bool staysRect = draw.fMatrix->rectStaysRect(); - - if (staysRect) { - SkRect rect; - SkRect dstRect = SkRect::MakeXYWH(0, 0, dstSize.fWidth, dstSize.fHeight); - draw.fMatrix->mapRect(&rect, dstRect); - const SkScalar *scalars = rect.asScalars(); - bool isDstPixelAligned = true; - for (int i = 0; i < 4; i++) { - if (!SkScalarIsInt(scalars[i])) { - isDstPixelAligned = false; - break; - } - } - - if (isDstPixelAligned) - directDraw = true; - } - } + bool drawAA = !fRenderTarget->isUnifiedMultisampled() && + paint.isAntiAlias() && + bitmap.width() <= maxTextureSize && + bitmap.height() <= maxTextureSize; - if (paint.getMaskFilter() || !directDraw) { + if (paint.getMaskFilter() || drawAA) { // Convert the bitmap to a shader so that the rect can be drawn // through drawRect, which supports mask filters. SkBitmap tmp; // subset of bitmap, if necessary |