diff options
author | Mike Morris <michael.patrick.morris@gmail.com> | 2014-10-08 15:31:41 -0400 |
---|---|---|
committer | Mike Morris <michael.patrick.morris@gmail.com> | 2014-10-08 15:31:41 -0400 |
commit | a1bc8c766d6e204a44e2c7171a80330e123b582b (patch) | |
tree | 9432d1128dfb13316695d1d320464fa0dcbfe1d2 /test/headless.cpp | |
parent | 799ca683dfe1913618a965773103b88d41244bcd (diff) | |
download | qtlocation-mapboxgl-a1bc8c766d6e204a44e2c7171a80330e123b582b.tar.gz |
add HeadlessView::readPixels, fixes #480
Diffstat (limited to 'test/headless.cpp')
-rw-r--r-- | test/headless.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/test/headless.cpp b/test/headless.cpp index 981a9dcd59..439a6dcab7 100644 --- a/test/headless.cpp +++ b/test/headless.cpp @@ -98,13 +98,7 @@ TEST_P(HeadlessTest, render) { const unsigned int w = width * pixelRatio; const unsigned int h = height * pixelRatio; - const std::unique_ptr<uint32_t[]> pixels(new uint32_t[w * h]); - - map.view.make_active(); - glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, pixels.get()); - map.view.make_inactive(); - - const std::string image = util::compress_png(w, h, pixels.get(), true); + const std::string image = util::compress_png(w, h, view.readPixels()->get(), true); util::write_file(actual_image, image); } } |