aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar senorblanco <senorblanco@chromium.org>2014-07-14 08:25:33 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-07-14 08:25:34 -0700
commitc07e2811dd8f15722ebdd1ff0a7f5449258569f1 (patch)
treefd17bfb738296dea3eedc0e18626b85db1512bc5 /tests
parentee349531446ae2a8336b0903e05d0b2150d2131f (diff)
Revert "Fix for saveLayer() with filters vs. the BBox Hierarchy." and
"resizeimagefiler is ok with a BBH now". This reverts commits 6ca0b6a46cbe9bef3e2b9b9db813ec864efd62de and 8fa73202eaffbd7591ee218ad452b9afde81f505. Apparently causing problems in SKP playback. R=mtklein@google.com, robertphillips@google.com TBR=mtklein, robertphillips BUG=skia: Author: senorblanco@chromium.org Review URL: https://codereview.chromium.org/381353005
Diffstat (limited to 'tests')
-rw-r--r--tests/ImageFilterTest.cpp64
1 files changed, 0 insertions, 64 deletions
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index 7da4a911ef..32822087ba 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -409,70 +409,6 @@ DEF_TEST(ImageFilterDrawTiled, reporter) {
}
}
-static void drawBlurredRect(SkCanvas* canvas) {
- SkAutoTUnref<SkImageFilter> filter(SkBlurImageFilter::Create(SkIntToScalar(8), 0));
- SkPaint filterPaint;
- filterPaint.setColor(SK_ColorWHITE);
- filterPaint.setImageFilter(filter);
- canvas->saveLayer(NULL, &filterPaint);
- SkPaint whitePaint;
- whitePaint.setColor(SK_ColorWHITE);
- canvas->drawRect(SkRect::Make(SkIRect::MakeWH(4, 4)), whitePaint);
- canvas->restore();
-}
-
-static void drawPictureClipped(SkCanvas* canvas, const SkRect& clipRect, const SkPicture* picture) {
- canvas->save();
- canvas->clipRect(clipRect);
- canvas->drawPicture(picture);
- canvas->restore();
-}
-
-DEF_TEST(ImageFilterDrawTiledBlurRTree, reporter) {
- // Check that the blur filter when recorded with RTree acceleration,
- // and drawn tiled (with subsequent clip rects) exactly
- // matches the same filter drawn with without RTree acceleration.
- // This tests that the "bleed" from the blur into the otherwise-blank
- // tiles is correctly rendered.
- // Tests pass by not asserting.
-
- int width = 16, height = 8;
- SkBitmap result1, result2;
- result1.allocN32Pixels(width, height);
- result2.allocN32Pixels(width, height);
- SkCanvas canvas1(result1);
- SkCanvas canvas2(result2);
- int tileSize = 8;
-
- canvas1.clear(0);
- canvas2.clear(0);
-
- SkRTreeFactory factory;
-
- SkPictureRecorder recorder1, recorder2;
- // The only difference between these two pictures is that one has RTree aceleration.
- SkCanvas* recordingCanvas1 = recorder1.beginRecording(width, height, NULL, 0);
- SkCanvas* recordingCanvas2 = recorder2.beginRecording(width, height, &factory, 0);
- drawBlurredRect(recordingCanvas1);
- drawBlurredRect(recordingCanvas2);
- SkAutoTUnref<SkPicture> picture1(recorder1.endRecording());
- SkAutoTUnref<SkPicture> picture2(recorder2.endRecording());
- for (int y = 0; y < height; y += tileSize) {
- for (int x = 0; x < width; x += tileSize) {
- SkRect tileRect = SkRect::Make(SkIRect::MakeXYWH(x, y, tileSize, tileSize));
- drawPictureClipped(&canvas1, tileRect, picture1);
- drawPictureClipped(&canvas2, tileRect, picture2);
- }
- }
- for (int y = 0; y < height; y++) {
- int diffs = memcmp(result1.getAddr32(0, y), result2.getAddr32(0, y), result1.rowBytes());
- REPORTER_ASSERT(reporter, !diffs);
- if (diffs) {
- break;
- }
- }
-}
-
DEF_TEST(ImageFilterMatrixConvolution, reporter) {
// Check that a 1x3 filter does not cause a spurious assert.
SkScalar kernel[3] = {