Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: API to track damage rectangles #21267

Closed
wants to merge 7 commits into from

Conversation

knopp
Copy link
Member

@knopp knopp commented Sep 18, 2020

Description

This PR replaces #21126

This PR adds api to track damage rectangles during rendering. Usage is relatively simple, it introduces the following structure in compositor_context.h

struct FrameDamage {
  // in: description for frame previously rasterized in target framebuffer
  const DamageContext::FrameDescription* previous_frame_description;

  // out: description for frame being rasterized
  std::unique_ptr<DamageContext::FrameDescription> frame_description;

  // out: area in framebuffer that has changed between frames;
  // if optional is empty, whole frame was repainted
  std::optional<DamageArea> damage_area;
};

This can be provided as argument to CompositorContext::ScopedFrame::Raster. The caller is responsible for providing previous_frame_description, which was obtained during previous rasterization to current framebuffer, as well as storing incoming frame_description.

Related Issues

flutter/flutter#33939

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the [contributor guide] and followed the process outlined there for submitting PRs.
  • I signed the [CLA].
  • I read and followed the [C++, Objective-C, Java style guides] for the engine.
  • I read the [tree hygiene] wiki page, which explains my responsibilities.
  • I updated/added relevant documentation.
  • All existing and new tests are passing.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

This shouldn't be breaking change, if frame_damage is not provided (default).
However it does prevent rendering of picture, physical shape and texture layers that are outside of cull rect.

Did any tests fail when you ran them? Please read [handling breaking changes].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants