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/node | |
parent | ef8017198ce8f0bd79ba5a5ed31e35a16e3433bb (diff) | |
download | qtlocation-mapboxgl-62b56b799a7d4fcd1a8f151eed878054b862da5b.tar.gz |
[core] change std::array<uint16_t, 2> to mbgl::Size
Diffstat (limited to 'platform/node')
-rw-r--r-- | platform/node/src/node_map.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/platform/node/src/node_map.cpp b/platform/node/src/node_map.cpp index 671bf3e0fd..e630275ec0 100644 --- a/platform/node/src/node_map.cpp +++ b/platform/node/src/node_map.cpp @@ -356,12 +356,11 @@ void NodeMap::Render(const Nan::FunctionCallbackInfo<v8::Value>& info) { } void NodeMap::startRender(NodeMap::RenderOptions options) { - map->setSize(std::array<uint16_t, 2>{{ static_cast<uint16_t>(options.width), - static_cast<uint16_t>(options.height) }}); + map->setSize({ options.width, options.height }); - const std::array<uint16_t, 2> fbSize{{ static_cast<uint16_t>(options.width * pixelRatio), - static_cast<uint16_t>(options.height * pixelRatio) }}; - if (!view || view->getSize() != fbSize) { + const mbgl::Size fbSize{ static_cast<uint32_t>(options.width * pixelRatio), + static_cast<uint32_t>(options.height * pixelRatio) }; + if (!view || view->size != fbSize) { view.reset(); view = std::make_unique<mbgl::OffscreenView>(backend.getContext(), fbSize); } @@ -430,7 +429,7 @@ void NodeMap::renderFinished() { cb->Call(1, argv); } else if (img.data) { v8::Local<v8::Object> pixels = Nan::NewBuffer( - reinterpret_cast<char *>(img.data.get()), img.size(), + reinterpret_cast<char *>(img.data.get()), img.bytes(), // Retain the data until the buffer is deleted. [](char *, void * hint) { delete [] reinterpret_cast<uint8_t*>(hint); @@ -790,7 +789,7 @@ NodeMap::NodeMap(v8::Local<v8::Object> options) }()), backend(sharedDisplay()), map(std::make_unique<mbgl::Map>(backend, - std::array<uint16_t, 2>{{ 256, 256 }}, + mbgl::Size{ 256, 256 }, pixelRatio, *this, threadpool, |