aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/complexclip.cpp
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2018-05-09 13:23:38 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-09 18:03:45 +0000
commit788a2dc754f9da403d297e4a09efe187aeda3229 (patch)
tree97235ca1831457aba1464c2ed0118bede4527058 /gm/complexclip.cpp
parent46cc3dabaff7daa6b57e3c33997153d986219579 (diff)
complexclip gm to clip when saving layer with bounds.
The complexclip gm currently can do a save layer with some bounds, but doesn't clip to those bounds. As a result when it is rotated it invokes some unspecified behavior by drawing outside the save layer bounds. Change-Id: Ifbdd4b5366a514d1760180dc6d5a74ebfe09d28b Reviewed-on: https://skia-review.googlesource.com/127044 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'gm/complexclip.cpp')
-rw-r--r--gm/complexclip.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/gm/complexclip.cpp b/gm/complexclip.cpp
index ae9c4db31f..897c41ea2c 100644
--- a/gm/complexclip.cpp
+++ b/gm/complexclip.cpp
@@ -114,6 +114,7 @@ protected:
boundPaint.setColor(SK_ColorRED);
boundPaint.setStyle(SkPaint::kStroke_Style);
canvas->drawRect(bounds, boundPaint);
+ canvas->clipRect(bounds);
canvas->saveLayer(&bounds, nullptr);
}