Fix error in Ganesh' tiled bitmap drawing
authorrobertphillips <robertphillips@google.com>
Fri, 21 Nov 2014 18:16:25 +0000 (10:16 -0800)
committerCommit bot <commit-bot@chromium.org>
Fri, 21 Nov 2014 18:16:25 +0000 (10:16 -0800)
When the paint filter level is high ShouldUseBicubic doesn't always return true. In this case the paint's filter level will differ from the filtering Ganesh will use. This was leading to a mismatch between the tiling computed in SkGpuDevice::drawBitmapCommon and the one in SkGpuDevice::drawTiledBitmap.

The end result of this was that the max texture restriction could be violated which is currently being seen on the Xoom & N7 bots. Both of them have a max texture size of 2048 which is invoking the tiled drawbitmap case.

Review URL: https://codereview.chromium.org/752623002

src/gpu/SkGpuDevice.cpp

index ca79d0a..fa7d898 100644 (file)
@@ -1228,7 +1228,7 @@ void SkGpuDevice::drawTiledBitmap(const SkBitmap& bitmap,
             tmpM.setTranslate(offset.fX - srcRect.fLeft, offset.fY - srcRect.fTop);
             am.setPreConcat(fContext, tmpM);
 
-            if (SkPaint::kNone_FilterLevel != paint.getFilterLevel() || bicubic) {
+            if (GrTextureParams::kNone_FilterMode != params.filterMode() || bicubic) {
                 SkIRect iClampRect;
 
                 if (SkCanvas::kBleed_DrawBitmapRectFlag & flags) {