aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-01 20:06:09 +0000
committerGravatar scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-01 20:06:09 +0000
commitb4773b4802236fab24cfc63ed8b9ed7eb35f65cc (patch)
treefb113284e24a4d809c9b376cc50e5aaae4352c95 /tools
parentc58b126623d68a64e225fc8612dfbd6a7e56e97b (diff)
Fix some bugs in our picture tools.
When doing tiled rendering in multiple threads, clone fPicture, rather than the blank fPictureClones. Also fix a precedence problem so we get the correct rectangle. In render_pictures_main, call PictureRenderer::setup(). Review URL: https://codereview.appspot.com/6585055 git-svn-id: http://skia.googlecode.com/svn/trunk@5758 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tools')
-rw-r--r--tools/PictureRenderer.cpp5
-rw-r--r--tools/render_pictures_main.cpp1
2 files changed, 4 insertions, 2 deletions
diff --git a/tools/PictureRenderer.cpp b/tools/PictureRenderer.cpp
index 85bd194bbe..2eb89b2370 100644
--- a/tools/PictureRenderer.cpp
+++ b/tools/PictureRenderer.cpp
@@ -210,7 +210,7 @@ void TiledPictureRenderer::init(SkPicture* pict) {
int numberOfClones = fNumThreads - 1;
// This will be deleted in end().
fPictureClones = SkNEW_ARRAY(SkPicture, numberOfClones);
- fPictureClones->clone(fPictureClones, numberOfClones);
+ fPicture->clone(fPictureClones, numberOfClones);
}
}
}
@@ -315,7 +315,8 @@ struct ThreadData {
}
const SkRect* nextTile() {
- if (int32_t i = sk_atomic_inc(fTileCounter) < fTileRects->count()) {
+ int32_t i = sk_atomic_inc(fTileCounter);
+ if (i < fTileRects->count()) {
return &fTileRects->operator[](i);
}
return NULL;
diff --git a/tools/render_pictures_main.cpp b/tools/render_pictures_main.cpp
index 6066334416..764bea06a1 100644
--- a/tools/render_pictures_main.cpp
+++ b/tools/render_pictures_main.cpp
@@ -102,6 +102,7 @@ static bool render_picture(const SkString& inputPath, const SkString& outputDir,
inputPath.c_str());
renderer.init(&picture);
+ renderer.setup();
SkString outputPath;
make_output_filepath(&outputPath, outputDir, inputFilename);