diff options
author | Mike Morris <michael.patrick.morris@gmail.com> | 2014-10-08 16:04:13 -0400 |
---|---|---|
committer | Mike Morris <michael.patrick.morris@gmail.com> | 2014-10-08 16:04:19 -0400 |
commit | dfb81fe9ce796c06263c4b531cdba4d0e8571808 (patch) | |
tree | 7f6f9a0306a30067d512a80936c03ac8dd368ddc /common | |
parent | a1bc8c766d6e204a44e2c7171a80330e123b582b (diff) | |
download | qtlocation-mapboxgl-dfb81fe9ce796c06263c4b531cdba4d0e8571808.tar.gz |
fix HeadlessView::readPixels return value, ref #480
Diffstat (limited to 'common')
-rw-r--r-- | common/headless_view.cpp | 6 | ||||
-rw-r--r-- | common/headless_view.hpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/common/headless_view.cpp b/common/headless_view.cpp index 9775da1d57..3f945ee6aa 100644 --- a/common/headless_view.cpp +++ b/common/headless_view.cpp @@ -97,17 +97,17 @@ void HeadlessView::resize(uint16_t width, uint16_t height, float pixelRatio) { #endif } -const std::unique_ptr<uint32_t[]>* HeadlessView::readPixels() { +const std::unique_ptr<uint32_t[]> HeadlessView::readPixels() { const unsigned int w = width_ * pixelRatio_; const unsigned int h = height_ * pixelRatio_; - const std::unique_ptr<uint32_t[]> pixels(new uint32_t[w * h]); + std::unique_ptr<uint32_t[]> pixels(new uint32_t[w * h]); make_active(); glReadPixels(0, 0, width_, height_, GL_RGBA, GL_UNSIGNED_BYTE, pixels.get()); make_inactive(); - return &pixels; + return pixels; } void HeadlessView::clear_buffers() { diff --git a/common/headless_view.hpp b/common/headless_view.hpp index b59366349e..600e9d51fa 100644 --- a/common/headless_view.hpp +++ b/common/headless_view.hpp @@ -26,7 +26,7 @@ public: void createContext(); void resize(uint16_t width, uint16_t height, float pixelRatio); - const std::unique_ptr<uint32_t[]>* readPixels(); + const std::unique_ptr<uint32_t[]> readPixels(); void notify_map_change(MapChange change, timestamp delay = 0); void make_active(); |