Esempio n. 1
0
static void rerecord(const SkPicture& src, SkBBHFactory* bbhFactory) {
    SkPictureRecorder recorder;
    if (FLAGS_skr) {
        src.playback(recorder.EXPERIMENTAL_beginRecording(src.cullRect().width(), 
                                                      src.cullRect().height(), 
                                                      bbhFactory));
    } else {
        src.playback(recorder.  DEPRECATED_beginRecording(src.cullRect().width(), 
                                                      src.cullRect().height(), 
                                                      bbhFactory));
    }
    SkAutoTUnref<SkPicture> pic(recorder.endRecording());
}
Esempio n. 2
0
static SkBitmap draw_picture(SkPicture& picture) {
     SkBitmap bitmap;
     bitmap.allocN32Pixels(SkScalarCeilToInt(picture.cullRect().width()),
                           SkScalarCeilToInt(picture.cullRect().height()));
     SkCanvas canvas(bitmap);
     picture.playback(&canvas);
     return bitmap;
}