summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer/image_atlas.cpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2019-05-13 17:13:31 -0700
committerKonstantin Käfer <mail@kkaefer.com>2019-05-15 10:55:58 -0700
commit867555b1c9ef51fec23ce77c682cf7d5b5a23c5e (patch)
treede380cbb7f5553282b081dce9202cbe9e502ebe5 /src/mbgl/renderer/image_atlas.cpp
parent1a9e93e8d5fc6fd027160b3126eab03d0809ca69 (diff)
downloadqtlocation-mapboxgl-867555b1c9ef51fec23ce77c682cf7d5b5a23c5e.tar.gz
[core] add gfx::UploadPass, split startRender into prepare and uploadupstream/gfx-refactor-7
Diffstat (limited to 'src/mbgl/renderer/image_atlas.cpp')
-rw-r--r--src/mbgl/renderer/image_atlas.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mbgl/renderer/image_atlas.cpp b/src/mbgl/renderer/image_atlas.cpp
index 282f135ac9..da7f5a30be 100644
--- a/src/mbgl/renderer/image_atlas.cpp
+++ b/src/mbgl/renderer/image_atlas.cpp
@@ -1,4 +1,5 @@
#include <mbgl/renderer/image_atlas.hpp>
+#include <mbgl/gfx/upload_pass.hpp>
#include <mbgl/gfx/context.hpp>
#include <mbgl/renderer/image_manager.hpp>
@@ -52,26 +53,26 @@ const mapbox::Bin& _packImage(mapbox::ShelfPack& pack, const style::Image::Impl&
return bin;
}
-void ImageAtlas::patchUpdatedImages(gfx::Context& context, gfx::Texture& atlasTexture, const ImageManager& imageManager) {
+void ImageAtlas::patchUpdatedImages(gfx::UploadPass& uploadPass, gfx::Texture& atlasTexture, const ImageManager& imageManager) {
for (auto& updatedImageVersion : imageManager.updatedImageVersions) {
auto iconPosition = iconPositions.find(updatedImageVersion.first);
if (iconPosition != iconPositions.end()) {
- patchUpdatedImage(context, atlasTexture, iconPosition->second, imageManager, updatedImageVersion.first, updatedImageVersion.second);
+ patchUpdatedImage(uploadPass, atlasTexture, iconPosition->second, imageManager, updatedImageVersion.first, updatedImageVersion.second);
}
auto patternPosition = patternPositions.find(updatedImageVersion.first);
if (patternPosition != patternPositions.end()) {
- patchUpdatedImage(context, atlasTexture, patternPosition->second, imageManager, updatedImageVersion.first, updatedImageVersion.second);
+ patchUpdatedImage(uploadPass, atlasTexture, patternPosition->second, imageManager, updatedImageVersion.first, updatedImageVersion.second);
}
}
}
-void ImageAtlas::patchUpdatedImage(gfx::Context& context, gfx::Texture& atlasTexture, ImagePosition& position, const ImageManager& imageManager, const std::string& name, uint16_t version) {
+void ImageAtlas::patchUpdatedImage(gfx::UploadPass& uploadPass, gfx::Texture& atlasTexture, ImagePosition& position, const ImageManager& imageManager, const std::string& name, uint16_t version) {
if (position.version == version) return;
auto updatedImage = imageManager.getImage(name);
if (updatedImage == nullptr) return;
- context.updateTextureSub(atlasTexture, updatedImage->image, position.textureRect.x, position.textureRect.y);
+ uploadPass.updateTextureSub(atlasTexture, updatedImage->image, position.textureRect.x, position.textureRect.y);
position.version = version;
}