Index: tools/PictureRenderer.cpp |
=================================================================== |
--- tools/PictureRenderer.cpp (revision 13812) |
+++ tools/PictureRenderer.cpp (working copy) |
@@ -570,20 +570,19 @@ |
} |
/** |
- * Draw the specified playback to the canvas translated to rectangle provided, so that this mini |
+ * Draw the specified picture to the canvas translated to rectangle provided, so that this mini |
* canvas represents the rectangle's portion of the overall picture. |
* Saves and restores so that the initial clip and matrix return to their state before this function |
* is called. |
*/ |
-template<class T> |
-static void DrawTileToCanvas(SkCanvas* canvas, const SkRect& tileRect, T* playback) { |
+static void draw_tile_to_canvas(SkCanvas* canvas, const SkRect& tileRect, SkPicture* picture) { |
int saveCount = canvas->save(); |
// Translate so that we draw the correct portion of the picture. |
// Perform a postTranslate so that the scaleFactor does not interfere with the positioning. |
SkMatrix mat(canvas->getTotalMatrix()); |
mat.postTranslate(-tileRect.fLeft, -tileRect.fTop); |
canvas->setMatrix(mat); |
- playback->draw(canvas); |
+ canvas->drawPicture(*picture); |
canvas->restoreToCount(saveCount); |
canvas->flush(); |
} |
@@ -621,7 +620,7 @@ |
void TiledPictureRenderer::drawCurrentTile() { |
SkASSERT(fCurrentTileOffset >= 0 && fCurrentTileOffset < fTileRects.count()); |
- DrawTileToCanvas(fCanvas, fTileRects[fCurrentTileOffset], fPicture); |
+ draw_tile_to_canvas(fCanvas, fTileRects[fCurrentTileOffset], fPicture); |
} |
bool TiledPictureRenderer::render(const SkString* path, SkBitmap** out) { |
@@ -638,7 +637,7 @@ |
} |
bool success = true; |
for (int i = 0; i < fTileRects.count(); ++i) { |
- DrawTileToCanvas(fCanvas, fTileRects[i], fPicture); |
+ draw_tile_to_canvas(fCanvas, fTileRects[i], fPicture); |
if (NULL != path) { |
success &= writeAppendNumber(fCanvas, path, i, fJsonSummaryPtr); |
} |
@@ -722,7 +721,7 @@ |
} |
for (int i = fStart; i < fEnd; i++) { |
- DrawTileToCanvas(fCanvas, fRects[i], fClone); |
+ draw_tile_to_canvas(fCanvas, fRects[i], fClone); |
if ((fPath != NULL) && !writeAppendNumber(fCanvas, fPath, i, fJsonSummaryPtr) |
&& fSuccess != NULL) { |
*fSuccess = false; |