- virtual void onDrawPicture(const SkPicture* picture) SK_OVERRIDE {
- // BBH-based rendering doesn't re-issue many of the operations the gather
- // process cares about (e.g., saves and restores) so it must be disabled.
- if (NULL != picture->fPlayback) {
- picture->fPlayback->setUseBBH(false);
- }
- picture->draw(this);
- if (NULL != picture->fPlayback) {
- picture->fPlayback->setUseBBH(true);
+ virtual void onDrawPicture(const SkPicture* picture, const SkMatrix* matrix,
+ const SkPaint* paint) SK_OVERRIDE {
+ SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->width(), picture->height());
+
+ if (NULL != picture->fData.get()) {
+ // Disable the BBH for the old path so all the draw calls
+ // will be seen. The stock SkPicture::draw method can't be
+ // invoked since it just uses a vanilla SkPicturePlayback.
+ SkPicturePlayback playback(picture);
+ playback.setUseBBH(false);
+ playback.draw(this, NULL);
+ } else {
+ // Since we know this is the SkRecord path we can just call
+ // SkPicture::draw.
+ picture->draw(this);