Add marked-content ID to PDF images

Previously we only added marked-content IDs to text commands.
Extend this to support marking bitmaps drawn to a PDF document
too, so that images can be tagged with alt text.

Moves the code that outputs the marked content ID and closing
tag into a scoped helper class that outputs the closing sequence
on destruction.

Note: we'll probably want to do this to nearly all drawing
commands, since nearly everything could in theory be tagged.

This change is safe because it's still behind a flag in
Chromium and if the document doesn't have any structure
tree, it won't output anything.

Bug: chromium:607777
Change-Id: I4d7d655857fa7e76c6a6914a2a83097be917d835
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275517
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2 files changed