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

Document //flutter/shell/common/rasterizer #9809

Merged
merged 1 commit into from
Jul 16, 2019

Conversation

chinmaygarde
Copy link
Member

No description provided.

Copy link
Contributor

@liyuqian liyuqian left a comment

Choose a reason for hiding this comment

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

LGTM with nits. Thank you for the doc!

/// to it by the engine (which lives on the UI task runner).
///
/// The primary components owned by the rasterizer are the compositor context
/// and the on-screen render surface. The compositor context all the GPU state
Copy link
Contributor

Choose a reason for hiding this comment

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

"The compositor context HAS/SAVES all the GPU state"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

///
/// The rasterizer owns the instance of the currently active on-screen render
/// surface. On this surface, it renders the contents of layer trees submitted
/// to it by the engine (which lives on the UI task runner).
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe explicitly specify flutter::Engine so readers won't be confused with the engine as a whole (e.g., flutter/engine repo).

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

/// held till the balancing call to `Rasterizer::Teardown` is
/// made. Calling a setup before tearing down the previous surface
/// (if this is not the first time the surface has been setup) is
/// user error.
Copy link
Contributor

Choose a reason for hiding this comment

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

"is A user error"?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this usage is correct.

/// @brief Releases the previously setup on-screen render surface and
/// collects associated resources. No more rendering may occur
/// till the next call to `Rasterizer::Setup` with a new render
/// surface. Calling a teardown without a setup is user error.
Copy link
Contributor

Choose a reason for hiding this comment

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

"is A user error"?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this usage is correct.

void NotifyLowMemoryWarning() const;

//----------------------------------------------------------------------------
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add "The weak pointer can be copied to other threads, but the rasterizer it references to may only be accessed..."

Copy link
Member Author

Choose a reason for hiding this comment

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

Isn't that a property of all weak pointers? That is documented in FML. This weak pointer is not special in any way.

fml::WeakPtr<Rasterizer> GetWeakPtr() const;

//----------------------------------------------------------------------------
/// @brief Gets a weak pointer to the rasterizer. The rasterizer is also
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this is no longer needed if #9813 lands first?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll remove it then.

/// layer tree describing the same contents. One such case is when
/// external textures (video or camera streams for example) are
/// updated in an otherwise static layer tree. To support this use
/// case, the rasterizer holds onto the last rendered layer tree.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe leave a link to flutter/flutter#33939 to clarify that we intend to reduce such redundant rendering.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. I added an @bug line.

/// again with new limits after surface re-acquisition.
///
/// @attention This cache does not describe the entirety of GPU resources
/// that may be cached. The raster cache also holds very large GPU
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a reference to |RasterCache| (so they know that raster cache is not just a concept, but an actual class)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

/// a frame on the on-screen surface.
///
/// Why does the draw call take a layer tree pipeline and not the
/// layer tree directly?
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a note like "|Rasterizer::DoDraw| takes a layer tree and rasterizes it; The |Rasterizer::Draw| takes the pipeline as it needs to do additional pipeline maintenance work".

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@chinmaygarde chinmaygarde force-pushed the document_rasterizer branch from ef206c2 to 90ba4de Compare July 16, 2019 00:45
@chinmaygarde
Copy link
Member Author

Rebased on ToT.

@chinmaygarde chinmaygarde merged commit dd937e0 into flutter:master Jul 16, 2019
@chinmaygarde chinmaygarde deleted the document_rasterizer branch July 16, 2019 00:45
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 16, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants