Call notifyPixelsChanged after modifying bitmap
authorscroggo <scroggo@chromium.org>
Thu, 30 Jul 2015 18:33:04 +0000 (11:33 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 30 Jul 2015 18:33:04 +0000 (11:33 -0700)
In CodecSrc's scanline_subset test, we decode a subset of an image to a
bitmap, draw it to the canvas, and then repeat. This is fine for most
backends, but not for pipe. Pipe sees the same generation ID, so it
assumes it is the same bitmap it saw before, and just draws the
original one.

Call notifyPixelsChanged, so the bitmap will get a new generation ID,
fixing pipe.

BUG=skia:4138

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

dm/DMSrcSink.cpp

index cbf7a0bb4f3741e1b8e08a675a7c07c92a08bc2b..0cd2ac93471e1b0aff2c4858689c6090bc482e5d 100644 (file)
@@ -274,6 +274,7 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
                         bufferRow += rowBytes;
                     }
 
+                    subsetBm.notifyPixelsChanged();
                     canvas->drawBitmap(subsetBm, SkIntToScalar(x), SkIntToScalar(y));
                 }
             }