diff options
author | wangxianzhu <wangxianzhu@chromium.org> | 2015-09-17 20:38:02 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-17 20:38:02 -0700 |
commit | ef6c50a80f77e6da84e198a34755dd42b1b0cf1e (patch) | |
tree | 6f621fce7cf1daacd9b8abcfea990f411e8e5974 /gm/annotated_text.cpp | |
parent | 1b55a963a2374a14bb82eb887bb99ee91680f0eb (diff) |
Merge sub-device annotations in SkPDFDevice::drawDevice()
Previously annotations added between saveLayer/restore were lost.
Merge annotations in SkPDFDevice::drawDevice(). Also modified code to
apply correct transformation and clipping on annotations added between
saveLayer/restore:
- Apply the initial transform only when adding the annotations into the
doc, otherwise we need to unapply sub-device's initial transform
before merging the annotations into parent-device.
- Apply only device-local clipping. fClipStack is in global coordinates,
which is not suitable to clip rects in sub-devices.
BUG=skia:4080
BUG=503515
Review URL: https://codereview.chromium.org/1257533004
Diffstat (limited to 'gm/annotated_text.cpp')
-rw-r--r-- | gm/annotated_text.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gm/annotated_text.cpp b/gm/annotated_text.cpp index 7126206eeb..30f67b0201 100644 --- a/gm/annotated_text.cpp +++ b/gm/annotated_text.cpp @@ -34,7 +34,8 @@ DEF_SIMPLE_GM(annotated_text, canvas, 512, 512) { const char text[] = "Click this link!"; const char url[] = "https://www.google.com/"; draw_url_annotated_text_with_box(canvas, text, 200.0f, 80.0f, p, url); - SkAutoCanvasRestore autoCanvasRestore2(canvas, true); + canvas->saveLayer(nullptr, nullptr); canvas->rotate(90); draw_url_annotated_text_with_box(canvas, text, 150.0f, -55.0f, p, url); + canvas->restore(); } |