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

[core] Add DDS support for {text,icon}-size - #8593

Merged
anandthakker merged 10 commits into
masterfrom
dds-text-size
Apr 6, 2017
Merged

anandthakker merged 10 commits into
masterfrom
dds-text-size

Conversation

@anandthakker

@anandthakker anandthakker commented Mar 31, 2017 •

Copy link
Copy Markdown
Contributor
  • Work through render test errors and segfaults ( 😱 )
  • Review SymbolSizeData / SymbolSizeAttributes design ( @jfirebaugh could I get your take on this? Main place to look/start is probably top of symbol_program.cpp, SymbolLayout::addSymbol, and maybe makeValues())
  • Refactor SymbolProgram, currently just copy-pasted from Program to make for easier initial hacking.
  • Correct naive linear interpolation to make use of exponential base.
  • Smaller TODOs
  • Request full review

@anandthakker anandthakker added Core The cross-platform C++ core, aka mbgl ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold labels Mar 31, 2017
@anandthakker
anandthakker force-pushed the dds-text-size branch 2 times, most recently from a85307b to 545ca67 Compare March 31, 2017 15:03
@jfirebaugh
jfirebaugh self-requested a review March 31, 2017 20:16
Comment thread src/mbgl/programs/symbol_program.hpp Outdated

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.

Some pathways don't initialize layoutSize. Should it have a default value or be typed as optional<float>?

Comment thread src/mbgl/programs/symbol_program.hpp Outdated

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.

Instead of having parallel VertexVector and VertexBuffer variants, and three different match statements (in attributeBindings, SymbolSizeData, and upload), what about following a model like PaintPropertyBinder, where an initial match statement then transfers control to a polymorphic object, whose derived types each hold both VertexVector and VertexBuffer of the appropriate matching types?

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.

Ah, yeah! I started out thinking that duplicating a PaintPropertyBinder hierarchy like that would be overkill, but actually it could be pretty minimal/scoped and, like you say, cleaner than having all these different matches. 🙇

anandthakker added a commit that referenced this pull request Apr 3, 2017
This fixes a bug where, for a zoom value greater than that of the highest zoom
stop, composite function interpolation would return nan. (Blocking a render
test over in #8593)

* Add failing tests for composite function edge case

The failing cases here are:
 - Should interpolate before the first stop
 - Should interpolate past the last stop

* Fix edge case in composite function interpolation

* Hold functions constant outside stop-defined domain
@anandthakker

Copy link
Copy Markdown
Contributor Author

@jfirebaugh refactored to a paintpropertybinders-like polymorphic approach f219d8c, as you suggested. It's a few more LOC, but it does feel like a cleaner design. The repetition of the PaintPropertyBinders hierarchy makes me itch to refactor the redundancy, but it would probably be premature abstraction to do it just yet; I think we should wait till we need a third copy.

@anandthakker

Copy link
Copy Markdown
Contributor Author

Refactor SymbolProgram, currently just copy-pasted from Program to make for easier initial hacking

I think the main issue here is to dedupe the identical constructors of SymbolProgram and Program (e.g.: https://github.com/mapbox/mapbox-gl-native/pull/8593/files#diff-5907166344b0d46b118326c98eb9915cR312). They're really just initializing a gl::Program, so I think that logic can be extracted into a static factor function or maybe even just a constructor for gl::Program.

Comment thread src/mbgl/gl/program.hpp Outdated

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.

To reduce binary size, pass vertexSource, fragmentSource, and name as parameters rather than templating on Shaders.

Comment thread src/mbgl/programs/attributes.hpp Outdated

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.

Flip the order of T and N, so that it matches gl::Attribute.

@boundsj boundsj added this to the ios-v3.6.0 milestone Apr 5, 2017
@anandthakker
anandthakker force-pushed the dds-text-size branch 2 times, most recently from 66b27fb to 8af6500 Compare April 5, 2017 21:11
@anandthakker

Copy link
Copy Markdown
Contributor Author

@jfirebaugh updated to address your comments and also rebased + cleaned up the history a bit. Should be ready for a full review now.

@anandthakker
anandthakker force-pushed the dds-text-size branch 2 times, most recently from bb0463d to 24f10e8 Compare April 6, 2017 11:40
@anandthakker anandthakker removed the ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold label Apr 6, 2017
@anandthakker
anandthakker merged commit 693c9f3 into master Apr 6, 2017
@anandthakker
anandthakker deleted the dds-text-size branch April 6, 2017 19:30
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