summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/context.cpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-11-04 17:50:42 +0100
committerKonstantin Käfer <mail@kkaefer.com>2016-11-04 21:24:05 +0100
commit7b772611d576ed99b148208c21824bb089663599 (patch)
treec693f89323fd309ac63a982e2510464603b11e35 /src/mbgl/gl/context.cpp
parent29c5c13aa2860a0e8c1ac9a826b08330708d3f29 (diff)
downloadqtlocation-mapboxgl-7b772611d576ed99b148208c21824bb089663599.tar.gz
[core] move pixel blitting to gl::Context
Diffstat (limited to 'src/mbgl/gl/context.cpp')
-rw-r--r--src/mbgl/gl/context.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp
index 811a038caf..c63819bc03 100644
--- a/src/mbgl/gl/context.cpp
+++ b/src/mbgl/gl/context.cpp
@@ -118,6 +118,17 @@ std::unique_ptr<uint8_t[]> Context::readFramebuffer(const Size size, const Textu
return data;
}
+#if not MBGL_USE_GLES2
+void Context::drawPixels(const Size size, const void* data, TextureFormat format) {
+ pixelStoreUnpack = { 1 };
+ if (format != TextureFormat::RGBA) {
+ format = static_cast<TextureFormat>(GL_LUMINANCE);
+ }
+ MBGL_CHECK_ERROR(glDrawPixels(size.width, size.height, static_cast<GLenum>(GL_LUMINANCE),
+ GL_UNSIGNED_BYTE, data));
+}
+#endif // MBGL_USE_GLES2
+
namespace {
void checkFramebuffer() {