When saving MSKP files, record layers as SkPictures with annotations.

No change when saving single frame SKP files.
Layer redraws (full or partial) that occur at the beginning of frames are recorded as SkPictures
written as the first commands in the frame, each preceded by an annotation recording the node id
of the layer drawn to, and the dirty area of the draw.

When rendered layers are used, the drawImageRect command is preceded by an annotation that provides
the node id of the relevant layer.

the skia debugger or skpbench could then use this information to play back the animation's layers.

Test: tested by capturing both multi and single frame files on apps that use and do not use layers.
normal rendering isn't affected, and capturing works as intended.

Change-Id: Ic8f6947ebcc168334b6b740b3d63fc1788509b54
4 files changed