Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Refactor Painter away #9541

Merged
merged 12 commits into from
Jul 19, 2017
Merged

Refactor Painter away #9541

merged 12 commits into from
Jul 19, 2017

Conversation

jfirebaugh
Copy link
Contributor

This refactor capitalizes on the asynchronous rendering work, particularly #9327, to simplify the set of rendering-related classes. In particular, it moves all of the code in Painter to better places:

  • Painter::render<LayerType> becomes Render<LayerType>Layer::render. As a special case, there was some fill-extrusion-related code that wasn't in Painter::renderFillExtrusion -- that moved to RenderFillExtrusionLayer::render too.
  • Painter::renderTileDebug had two overloads. The one for rendering tile debugging becomes RenderTile::finishRender. The one for rendering image source debug borders becomes RenderImageSource::finishRender.
  • Painter::render{ClippingMask,Item,Pass,ClipMasks,DepthBuffer} were inlined into Painter::render.

Finally, what was left of Painter itself was parceled out:

  • The one-off OpenGL objects moved to RenderStaticData
  • The per-frame data that all the various render methods need moved to PaintParameters (which we should next rename to RenderParameters)
  • That leaves the main Painter::render method, which was merged into Renderer::Impl

Copy link
Contributor

@ivovandongen ivovandongen left a comment

Choose a reason for hiding this comment

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

Cleans up nicely!

}

void RenderAnnotationSource::finishRender(Painter& painter) {
void RenderAnnotationSource::finishRender(PaintParameters& painter) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit; rename parameter

@jfirebaugh jfirebaugh merged commit 64203ba into master Jul 19, 2017
@jfirebaugh jfirebaugh deleted the painter-renderer branch July 19, 2017 16:31
@kkaefer kkaefer added the Core The cross-platform C++ core, aka mbgl label Jul 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants