Chromium Code Reviews| Index: tools/PictureRenderer.cpp |
| =================================================================== |
| --- tools/PictureRenderer.cpp (revision 13952) |
| +++ tools/PictureRenderer.cpp (working copy) |
| @@ -496,10 +496,10 @@ |
| // Do not call INHERITED::init(), which would create a (potentially large) canvas which is not |
| // used by bench_pictures. |
| fPicture = pict; |
|
bsalomon
2014/03/26 17:29:21
could be
fPicture = SkRef(pict);
robertphillips
2014/03/28 11:48:16
Done.
|
| + fPicture->ref(); |
| this->CopyString(&fOutputDir, outputDir); |
| this->CopyString(&fInputFilename, inputFilename); |
| fUseChecksumBasedFilenames = useChecksumBasedFilenames; |
| - fPicture->ref(); |
| this->buildBBoxHierarchy(); |
| if (fTileWidthPercentage > 0) { |
| @@ -694,7 +694,7 @@ |
| SkCanvas* TiledPictureRenderer::setupCanvas(int width, int height) { |
| SkCanvas* canvas = this->INHERITED::setupCanvas(width, height); |
| - SkASSERT(fPicture != NULL); |
| + SkASSERT(NULL != fPicture); |
| // Clip the tile to an area that is completely inside both the SkPicture and the viewport. This |
| // is mostly important for tiles on the right and bottom edges as they may go over this area and |
| // the picture may have some commands that draw outside of this area and so should not actually |
| @@ -910,7 +910,7 @@ |
| SkCanvas* recorder = fReplayer->beginRecording(this->getViewWidth(), this->getViewHeight(), |
| this->recordFlags()); |
| this->scaleToScaleFactor(recorder); |
| - fPicture->draw(recorder); |
| + recorder->drawPicture(*fPicture); |
| } |
| bool PlaybackCreationRenderer::render(SkBitmap** out) { |
| @@ -945,12 +945,12 @@ |
| return SkNEW(SkPicture); |
| case kQuadTree_BBoxHierarchyType: |
| return SkNEW_ARGS(SkQuadTreePicture, (SkIRect::MakeWH(fPicture->width(), |
| - fPicture->height()))); |
| + fPicture->height()))); |
| case kRTree_BBoxHierarchyType: |
| return SkNEW(RTreePicture); |
| case kTileGrid_BBoxHierarchyType: |
| return SkNEW_ARGS(SkTileGridPicture, (fPicture->width(), |
| - fPicture->height(), fGridInfo)); |
| + fPicture->height(), fGridInfo)); |
| } |
| SkASSERT(0); // invalid bbhType |
| return NULL; |
| @@ -960,8 +960,7 @@ |
| class GatherRenderer : public PictureRenderer { |
| public: |
| - virtual bool render(SkBitmap** out = NULL) |
| - SK_OVERRIDE { |
| + virtual bool render(SkBitmap** out = NULL) SK_OVERRIDE { |
| SkRect bounds = SkRect::MakeWH(SkIntToScalar(fPicture->width()), |
| SkIntToScalar(fPicture->height())); |
| SkData* data = SkPictureUtils::GatherPixelRefs(fPicture, bounds); |
| @@ -984,8 +983,7 @@ |
| class PictureCloneRenderer : public PictureRenderer { |
| public: |
| - virtual bool render(SkBitmap** out = NULL) |
| - SK_OVERRIDE { |
| + virtual bool render(SkBitmap** out = NULL) SK_OVERRIDE { |
| for (int i = 0; i < 100; ++i) { |
| SkPicture* clone = fPicture->clone(); |
| SkSafeUnref(clone); |