Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: tools/PictureRenderer.cpp

Issue 212933002: Actually identify required saveLayers in SkGpuDevice::EXPERIMENTAL_drawPicture (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Addressed code review issue Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/PictureRenderer.h ('k') | tools/render_pictures_main.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/PictureRenderer.cpp
===================================================================
--- tools/PictureRenderer.cpp (revision 13968)
+++ tools/PictureRenderer.cpp (working copy)
@@ -495,11 +495,10 @@
// Do not call INHERITED::init(), which would create a (potentially large) canvas which is not
// used by bench_pictures.
- fPicture = pict;
+ fPicture = SkRef(pict);
this->CopyString(&fOutputDir, outputDir);
this->CopyString(&fInputFilename, inputFilename);
fUseChecksumBasedFilenames = useChecksumBasedFilenames;
- fPicture->ref();
this->buildBBoxHierarchy();
if (fTileWidthPercentage > 0) {
@@ -694,7 +693,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 +909,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 +944,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 +959,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 +982,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);
« no previous file with comments | « tools/PictureRenderer.h ('k') | tools/render_pictures_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698