summaryrefslogtreecommitdiff
path: root/src/mbgl/util/offscreen_texture.hpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-10-10 17:16:37 +0200
committerKonstantin Käfer <mail@kkaefer.com>2016-10-25 13:52:36 -0700
commita4d259c33f9bb890bba97fd89552720e3e0ec09b (patch)
tree342ecc27a6993c48f3a2e1d739fce890350bc44d /src/mbgl/util/offscreen_texture.hpp
parent5cc390d694fc7510d445310d8eb9e32429a5e67b (diff)
downloadqtlocation-mapboxgl-a4d259c33f9bb890bba97fd89552720e3e0ec09b.tar.gz
[core] move gl::Context to Backend and refactor View
Diffstat (limited to 'src/mbgl/util/offscreen_texture.hpp')
-rw-r--r--src/mbgl/util/offscreen_texture.hpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/mbgl/util/offscreen_texture.hpp b/src/mbgl/util/offscreen_texture.hpp
index c71c0e51d9..8928bc2434 100644
--- a/src/mbgl/util/offscreen_texture.hpp
+++ b/src/mbgl/util/offscreen_texture.hpp
@@ -1,6 +1,10 @@
#pragma once
+#include <mbgl/map/view.hpp>
+#include <mbgl/gl/framebuffer.hpp>
#include <mbgl/gl/texture.hpp>
+#include <mbgl/util/optional.hpp>
+#include <mbgl/util/image.hpp>
namespace mbgl {
@@ -8,15 +12,20 @@ namespace gl {
class Context;
} // namespace gl
-class OffscreenTexture {
+class OffscreenTexture : public View {
public:
- void bind(gl::Context&, std::array<uint16_t, 2> size);
+ OffscreenTexture(gl::Context&, std::array<uint16_t, 2> size = {{ 256, 256 }});
+
+ void bind() override;
+
+ PremultipliedImage readStillImage();
gl::Texture& getTexture();
- std::array<uint16_t, 2> getSize() const;
private:
- optional<gl::UniqueFramebuffer> framebuffer;
+ gl::Context& context;
+ std::array<uint16_t, 2> size;
+ optional<gl::Framebuffer> framebuffer;
optional<gl::Texture> texture;
};