diff options
author | 2014-11-11 04:54:49 -0800 | |
---|---|---|
committer | 2014-11-11 04:54:49 -0800 | |
commit | 81f71b6630a9b7398bf983689436cccdd8dd3ff7 (patch) | |
tree | 0c7f9ad995dd1ecd400af5da639c433fdda68f92 /tools | |
parent | bffcb52ffe9b8bb4ae7f6eda0c55719d8e3be7b6 (diff) |
Change where layer hoisting data is gathered
This CL:
1) removes the EXPERIMENTAL_optimize on SkCanvas & SkDevice
2) moves the saveLayer gathering step to endRecording
3) Replaces GPUOptimize with SkRecordComputeLayers
4) Update bench_pictures & render_pictures to provide the new flag
#2 also necessitated moving the BBH computation (and record optimization) out of SkPicture's ctor (and into endRecording)
Review URL: https://codereview.chromium.org/718443002
Diffstat (limited to 'tools')
-rw-r--r-- | tools/PictureRenderer.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/PictureRenderer.cpp b/tools/PictureRenderer.cpp index 1c31e6865a..f2fd6b73fa 100644 --- a/tools/PictureRenderer.cpp +++ b/tools/PictureRenderer.cpp @@ -223,10 +223,14 @@ void PictureRenderer::buildBBoxHierarchy() { if (kNone_BBoxHierarchyType != fBBoxHierarchyType && fPicture) { SkAutoTDelete<SkBBHFactory> factory(this->getFactory()); SkPictureRecorder recorder; + uint32_t flags = this->recordFlags(); + if (fUseMultiPictureDraw) { + flags |= SkPictureRecorder::kComputeSaveLayerInfo_RecordFlag; + } SkCanvas* canvas = recorder.beginRecording(fPicture->cullRect().width(), fPicture->cullRect().height(), factory.get(), - this->recordFlags()); + flags); fPicture->playback(canvas); fPicture.reset(recorder.endRecording()); } @@ -707,8 +711,12 @@ bool TiledPictureRenderer::render(SkBitmap** out) { surfaces[i]->getCanvas()->setMatrix(fCanvas->getTotalMatrix()); SkPictureRecorder recorder; + SkRTreeFactory bbhFactory; + SkCanvas* c = recorder.beginRecording(SkIntToScalar(fTileRects[i].width()), - SkIntToScalar(fTileRects[i].height())); + SkIntToScalar(fTileRects[i].height()), + &bbhFactory, + SkPictureRecorder::kComputeSaveLayerInfo_RecordFlag); c->save(); SkMatrix mat; mat.setTranslate(-SkIntToScalar(fTileRects[i].fLeft), |