diff options
author | Brian Osman <brianosman@google.com> | 2018-05-22 16:56:40 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-05-22 21:26:15 +0000 |
commit | e19e23fa0c3676e0317fa18c87fdc1ce74432482 (patch) | |
tree | 24b21de633bc2d51e2b8035f3a9b4a286a552f9b /tools/viewer | |
parent | 4b6d4d0eccb1d2bc30fc69e98c342eb7cbf1710d (diff) |
Clip to perspective quad in viewer
For GMs that draw content outside the window, this ensures that fake
and real perspective look more similar.
Change-Id: I5fd2372a21a0b6c04cb33ddef4ff53aebda1c43d
Reviewed-on: https://skia-review.googlesource.com/129454
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'tools/viewer')
-rw-r--r-- | tools/viewer/Viewer.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp index c54950850c..85a72984a3 100644 --- a/tools/viewer/Viewer.cpp +++ b/tools/viewer/Viewer.cpp @@ -1138,6 +1138,9 @@ void Viewer::drawSlide(SkCanvas* canvas) { int count = slideCanvas->save(); slideCanvas->clear(SK_ColorWHITE); slideCanvas->concat(computeMatrix()); + if (kPerspective_Real == fPerspectiveMode) { + slideCanvas->clipRect(SkRect::MakeWH(fWindow->width(), fWindow->height())); + } // Time the painting logic of the slide fStatsLayer.beginTiming(fPaintTimer); OveridePaintFilterCanvas filterCanvas(slideCanvas, &fPaint, &fPaintOverrides); |