diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-10-26 15:22:31 -0700 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2016-10-27 18:30:58 -0700 |
commit | 62b56b799a7d4fcd1a8f151eed878054b862da5b (patch) | |
tree | 34d510a69f9dd1bca30e9b137feffbd1eb6495d0 /platform/android/src/native_map_view.cpp | |
parent | ef8017198ce8f0bd79ba5a5ed31e35a16e3433bb (diff) | |
download | qtlocation-mapboxgl-62b56b799a7d4fcd1a8f151eed878054b862da5b.tar.gz |
[core] change std::array<uint16_t, 2> to mbgl::Size
Diffstat (limited to 'platform/android/src/native_map_view.cpp')
-rwxr-xr-x | platform/android/src/native_map_view.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp index 8f594f2c0e..9943dafe36 100755 --- a/platform/android/src/native_map_view.cpp +++ b/platform/android/src/native_map_view.cpp @@ -83,15 +83,14 @@ NativeMapView::NativeMapView(JNIEnv *env_, jobject obj_, float pixelRatio, int a mbgl::android::apkPath); map = std::make_unique<mbgl::Map>( - *this, - std::array<uint16_t, 2>{{ static_cast<uint16_t>(width), static_cast<uint16_t>(height) }}, + *this, mbgl::Size{ static_cast<uint32_t>(width), static_cast<uint32_t>(height) }, pixelRatio, *fileSource, threadPool, MapMode::Continuous); float zoomFactor = map->getMaxZoom() - map->getMinZoom() + 1; float cpuFactor = availableProcessors; float memoryFactor = static_cast<float>(totalMemory) / 1000.0f / 1000.0f / 1000.0f; - float sizeFactor = (static_cast<float>(map->getWidth()) / mbgl::util::tileSize) * - (static_cast<float>(map->getHeight()) / mbgl::util::tileSize); + float sizeFactor = (static_cast<float>(map->getSize().width) / mbgl::util::tileSize) * + (static_cast<float>(map->getSize().height) / mbgl::util::tileSize); size_t cacheSize = zoomFactor * cpuFactor * memoryFactor * sizeFactor * 0.5f; @@ -119,12 +118,15 @@ NativeMapView::~NativeMapView() { void NativeMapView::updateViewBinding() { getContext().bindFramebuffer.setCurrentValue(0); - getContext().viewport.setCurrentValue({ 0, 0, static_cast<uint16_t>(fbWidth), static_cast<uint16_t>(fbHeight) }); + getContext().viewport.setCurrentValue( + { 0, 0, { static_cast<uint32_t>(fbWidth), static_cast<uint32_t>(fbHeight) } }); } void NativeMapView::bind() { getContext().bindFramebuffer = 0; - getContext().viewport = { 0, 0, static_cast<uint16_t>(fbWidth), static_cast<uint16_t>(fbHeight) }; + getContext().viewport = { 0, + 0, + { static_cast<uint32_t>(fbWidth), static_cast<uint32_t>(fbHeight) } }; } void NativeMapView::activate() { @@ -201,7 +203,7 @@ void NativeMapView::render() { // take snapshot const unsigned int w = fbWidth; const unsigned int h = fbHeight; - mbgl::PremultipliedImage image { static_cast<uint16_t>(w), static_cast<uint16_t>(h) }; + mbgl::PremultipliedImage image({ w, h }); MBGL_CHECK_ERROR(glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, image.data.get())); const size_t stride = image.stride(); auto tmp = std::make_unique<uint8_t[]>(stride); @@ -718,7 +720,7 @@ void NativeMapView::updateFps() { void NativeMapView::resizeView(int w, int h) { width = w; height = h; - map->setSize({{ static_cast<uint16_t>(width), static_cast<uint16_t>(height) }}); + map->setSize({ static_cast<uint32_t>(width), static_cast<uint32_t>(height) }); } void NativeMapView::resizeFramebuffer(int w, int h) { |