diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2019-05-13 17:13:31 -0700 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2019-05-15 10:55:58 -0700 |
commit | 867555b1c9ef51fec23ce77c682cf7d5b5a23c5e (patch) | |
tree | de380cbb7f5553282b081dce9202cbe9e502ebe5 /src/mbgl/geometry/line_atlas.cpp | |
parent | 1a9e93e8d5fc6fd027160b3126eab03d0809ca69 (diff) | |
download | qtlocation-mapboxgl-867555b1c9ef51fec23ce77c682cf7d5b5a23c5e.tar.gz |
[core] add gfx::UploadPass, split startRender into prepare and uploadupstream/gfx-refactor-7
Diffstat (limited to 'src/mbgl/geometry/line_atlas.cpp')
-rw-r--r-- | src/mbgl/geometry/line_atlas.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mbgl/geometry/line_atlas.cpp b/src/mbgl/geometry/line_atlas.cpp index a3c1c9abce..106a24d015 100644 --- a/src/mbgl/geometry/line_atlas.cpp +++ b/src/mbgl/geometry/line_atlas.cpp @@ -1,5 +1,5 @@ #include <mbgl/geometry/line_atlas.hpp> -#include <mbgl/gfx/context.hpp> +#include <mbgl/gfx/upload_pass.hpp> #include <mbgl/util/logging.hpp> #include <mbgl/util/platform.hpp> #include <mbgl/util/hash.hpp> @@ -126,18 +126,20 @@ Size LineAtlas::getSize() const { return image.size; } -void LineAtlas::upload(gfx::Context& context) { +void LineAtlas::upload(gfx::UploadPass& uploadPass) { if (!texture) { - texture = context.createTexture(image); + texture = uploadPass.createTexture(image); } else if (dirty) { - context.updateTexture(*texture, image); + uploadPass.updateTexture(*texture, image); } dirty = false; } -gfx::TextureBinding LineAtlas::textureBinding(gfx::Context& context) { - upload(context); +gfx::TextureBinding LineAtlas::textureBinding() { + assert(texture); + // All _changes_ to the texture should've been made and uploaded already. + assert(!dirty); return { texture->getResource(), gfx::TextureFilterType::Linear, gfx::TextureMipMapType::No, gfx::TextureWrapType::Repeat, gfx::TextureWrapType::Clamp }; } |