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 11:57:43 -0700 |
commit | 3a6ff7710fcf201f82ddc2090488ef585bd8ab17 (patch) | |
tree | de380cbb7f5553282b081dce9202cbe9e502ebe5 /src/mbgl/renderer/image_manager.cpp | |
parent | bf0998697e0893d8a56421a139c7fc4855e89fa5 (diff) | |
download | qtlocation-mapboxgl-3a6ff7710fcf201f82ddc2090488ef585bd8ab17.tar.gz |
[core] add gfx::UploadPass, split startRender into prepare and upload
Diffstat (limited to 'src/mbgl/renderer/image_manager.cpp')
-rw-r--r-- | src/mbgl/renderer/image_manager.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mbgl/renderer/image_manager.cpp b/src/mbgl/renderer/image_manager.cpp index 936dac75c3..10375fe900 100644 --- a/src/mbgl/renderer/image_manager.cpp +++ b/src/mbgl/renderer/image_manager.cpp @@ -2,6 +2,7 @@ #include <mbgl/actor/actor.hpp> #include <mbgl/actor/scheduler.hpp> #include <mbgl/util/logging.hpp> +#include <mbgl/gfx/upload_pass.hpp> #include <mbgl/gfx/context.hpp> #include <mbgl/renderer/image_manager_observer.hpp> @@ -285,18 +286,19 @@ Size ImageManager::getPixelSize() const { }; } -void ImageManager::upload(gfx::Context& context) { +void ImageManager::upload(gfx::UploadPass& uploadPass) { if (!atlasTexture) { - atlasTexture = context.createTexture(atlasImage); + atlasTexture = uploadPass.createTexture(atlasImage); } else if (dirty) { - context.updateTexture(*atlasTexture, atlasImage); + uploadPass.updateTexture(*atlasTexture, atlasImage); } dirty = false; } -gfx::TextureBinding ImageManager::textureBinding(gfx::Context& context) { - upload(context); +gfx::TextureBinding ImageManager::textureBinding() { + assert(atlasTexture); + assert(!dirty); return { atlasTexture->getResource(), gfx::TextureFilterType::Linear }; } |