aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/multipicturedraw.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2014-11-11 04:54:49 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-11 04:54:49 -0800
commit81f71b6630a9b7398bf983689436cccdd8dd3ff7 (patch)
tree0c7f9ad995dd1ecd400af5da639c433fdda68f92 /gm/multipicturedraw.cpp
parentbffcb52ffe9b8bb4ae7f6eda0c55719d8e3be7b6 (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 'gm/multipicturedraw.cpp')
-rw-r--r--gm/multipicturedraw.cpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/gm/multipicturedraw.cpp b/gm/multipicturedraw.cpp
index 8ce3deb763..250c28a8d9 100644
--- a/gm/multipicturedraw.cpp
+++ b/gm/multipicturedraw.cpp
@@ -55,9 +55,12 @@ static const SkPicture* make_hex_plane_picture(SkColor fillColor) {
stroke.setStrokeWidth(3);
SkPictureRecorder recorder;
+ SkRTreeFactory bbhFactory;
SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(kPicWidth),
- SkIntToScalar(kPicHeight));
+ SkIntToScalar(kPicHeight),
+ &bbhFactory,
+ SkPictureRecorder::kComputeSaveLayerInfo_RecordFlag);
SkScalar xPos, yPos = 0;
@@ -102,9 +105,11 @@ static const SkPicture* make_single_layer_hex_plane_picture() {
stroke.setStrokeWidth(3);
SkPictureRecorder recorder;
+ SkRTreeFactory bbhFactory;
static const SkScalar kBig = 10000.0f;
- SkCanvas* canvas = recorder.beginRecording(kBig, kBig);
+ SkCanvas* canvas = recorder.beginRecording(kBig, kBig, &bbhFactory,
+ SkPictureRecorder::kComputeSaveLayerInfo_RecordFlag);
canvas->saveLayer(NULL, NULL);
@@ -156,9 +161,12 @@ static const SkPicture* make_tri_picture() {
stroke.setStrokeWidth(3);
SkPictureRecorder recorder;
+ SkRTreeFactory bbhFactory;
SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(kPicWidth),
- SkIntToScalar(kPicHeight));
+ SkIntToScalar(kPicHeight),
+ &bbhFactory,
+ SkPictureRecorder::kComputeSaveLayerInfo_RecordFlag);
SkRect r = tri.getBounds();
r.outset(2.0f, 2.0f); // outset for stroke
canvas->clipRect(r);
@@ -173,9 +181,12 @@ static const SkPicture* make_tri_picture() {
static const SkPicture* make_sub_picture(const SkPicture* tri) {
SkPictureRecorder recorder;
+ SkRTreeFactory bbhFactory;
SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(kPicWidth),
- SkIntToScalar(kPicHeight));
+ SkIntToScalar(kPicHeight),
+ &bbhFactory,
+ SkPictureRecorder::kComputeSaveLayerInfo_RecordFlag);
canvas->scale(1.0f/2.0f, 1.0f/2.0f);
@@ -205,9 +216,12 @@ static const SkPicture* make_sierpinski_picture() {
SkAutoTUnref<const SkPicture> pic(make_tri_picture());
SkPictureRecorder recorder;
+ SkRTreeFactory bbhFactory;
SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(kPicWidth),
- SkIntToScalar(kPicHeight));
+ SkIntToScalar(kPicHeight),
+ &bbhFactory,
+ SkPictureRecorder::kComputeSaveLayerInfo_RecordFlag);
static const int kNumLevels = 4;
for (int i = 0; i < kNumLevels; ++i) {
@@ -343,9 +357,12 @@ static void create_content(SkMultiPictureDraw* mpd, PFContentMtd pfGen,
{
SkPictureRecorder recorder;
+ SkRTreeFactory bbhFactory;
SkCanvas* pictureCanvas = recorder.beginRecording(SkIntToScalar(kPicWidth),
- SkIntToScalar(kPicHeight));
+ SkIntToScalar(kPicHeight),
+ &bbhFactory,
+ SkPictureRecorder::kComputeSaveLayerInfo_RecordFlag);
(*pfGen)(pictureCanvas, pictures);