summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/context.hpp
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.hpp
parent29c5c13aa2860a0e8c1ac9a826b08330708d3f29 (diff)
downloadqtlocation-mapboxgl-7b772611d576ed99b148208c21824bb089663599.tar.gz
[core] move pixel blitting to gl::Context
Diffstat (limited to 'src/mbgl/gl/context.hpp')
-rw-r--r--src/mbgl/gl/context.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mbgl/gl/context.hpp b/src/mbgl/gl/context.hpp
index 169aa5566e..438450fe14 100644
--- a/src/mbgl/gl/context.hpp
+++ b/src/mbgl/gl/context.hpp
@@ -71,6 +71,14 @@ public:
return { size, readFramebuffer(size, format, flip) };
}
+#if not MBGL_USE_GLES2
+ template <typename Image>
+ void drawPixels(const Image& image) {
+ auto format = image.channels == 4 ? TextureFormat::RGBA : TextureFormat::Alpha;
+ drawPixels(image.size, image.data.get(), format);
+ }
+#endif // MBGL_USE_GLES2
+
// Create a texture from an image with data.
template <typename Image>
Texture createTexture(const Image& image, TextureUnit unit = 0) {
@@ -177,6 +185,9 @@ private:
UniqueFramebuffer createFramebuffer();
UniqueRenderbuffer createRenderbuffer(RenderbufferType, Size size);
std::unique_ptr<uint8_t[]> readFramebuffer(Size, TextureFormat, bool flip);
+#if not MBGL_USE_GLES2
+ void drawPixels(Size size, const void* data, TextureFormat);
+#endif // MBGL_USE_GLES2
PrimitiveType operator()(const Points&);
PrimitiveType operator()(const Lines&);