Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Add a flag that checkerboards offscreen render targets created by SkCanvas.saveLayer - #3685

Merged
jason-simmons merged 1 commit into
flutter-team-archive:masterfrom
jason-simmons:save_layer_checker
May 11, 2017
Merged

jason-simmons merged 1 commit into
flutter-team-archive:masterfrom
jason-simmons:save_layer_checker

Conversation

@jason-simmons

Copy link
Copy Markdown
Contributor

@jason-simmons

Copy link
Copy Markdown
Contributor Author

@chinmaygarde


SkAutoCanvasRestore save(&context.canvas, false);
context.canvas.saveLayer(&paint_bounds(), nullptr);
Layer::AutoSaveLayer save(context, paint_bounds(), nullptr);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the previous version of this code, we were doing a SkCanvas::save (via SkAutoCanvasRestore) -> SkCanvas::saveLayer -> PaintChildren -> SkCanvas::restore (via SkAutoCanvasRestore). In this version, we no longer have the SkCanvas::save. Is this fine? I am not sure why we did the SkCanvas::save in the first place.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SkAutoCanvasRestore(canvas, false) doesn't do an SkCanvas::save(). The SkCanvas::save() happens within the saveLayer() call

Comment thread flow/layers/layer.h

private:
const PaintContext& paint_context_;
const SkRect bounds_;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FTL_DISALLOW_COPY_AND_ASSIGN.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, nevermind. Didn't notice the consts.

Comment thread flow/layers/layer_tree.cc
frame.context().engine_time(),
frame.context().memory_usage()};
frame.context().memory_usage(),
checkerboard_offscreen_layers_};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't notice similar updates to scene_update_context.cc. Are you sure you checked the Fuchsia build?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@chinmaygarde

Copy link
Copy Markdown
Contributor

Travis is mad about paint_utils in the licenses.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

3 participants