diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2018-12-13 20:29:14 +0200 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-01-11 16:43:52 +0200 |
commit | d37918c169b2f688c96fb766fc671066c88fc1a2 (patch) | |
tree | 20cdfe0a824bf128053aab7c8ad4f69676f66f49 /src/mbgl/programs/raster_program.hpp | |
parent | 2bdab82dedf545b4272c534b067c68614d0355b7 (diff) | |
download | qtlocation-mapboxgl-d37918c169b2f688c96fb766fc671066c88fc1a2.tar.gz |
[core] Split layer type specific code in mbgl::Programs
Progams code for a certain layer type is encapsulted within
a dedicated `<layer type>Programs` class, inherited from
the generic base `LayerTypePrograms` class.
`mbgl::Programs::get<layer type>Programs()` lazily initializes the
layer type-specific programs code using pointer to the base class,
which allows LTO to remove this code from binaries (if the corresponding
`get<layer type>Programs()` method can never be invoked).
Diffstat (limited to 'src/mbgl/programs/raster_program.hpp')
-rw-r--r-- | src/mbgl/programs/raster_program.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mbgl/programs/raster_program.hpp b/src/mbgl/programs/raster_program.hpp index 09cb94ac17..a07e5c3870 100644 --- a/src/mbgl/programs/raster_program.hpp +++ b/src/mbgl/programs/raster_program.hpp @@ -65,4 +65,11 @@ public: using RasterLayoutVertex = RasterProgram::LayoutVertex; using RasterAttributes = RasterProgram::Attributes; +class RasterLayerPrograms final : public LayerTypePrograms { +public: + RasterLayerPrograms(gl::Context& context, const ProgramParameters& programParameters) + : raster(context, programParameters) {} + RasterProgram raster; +}; + } // namespace mbgl |