diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2017-03-22 14:20:35 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2017-03-28 13:53:19 +0200 |
commit | a84aa453a9124867cb285f012abd97077ab2a019 (patch) | |
tree | 6181d5a39960df96e6dcd2d5c9d905c537b964fe /src/mbgl/map | |
parent | 3f0f4575e77ef289ca209323c0000cf743ab9db2 (diff) | |
download | qtlocation-mapboxgl-a84aa453a9124867cb285f012abd97077ab2a019.tar.gz |
[core] Privatize OpenGL/Context headers
Diffstat (limited to 'src/mbgl/map')
-rw-r--r-- | src/mbgl/map/backend.cpp | 32 | ||||
-rw-r--r-- | src/mbgl/map/map.cpp | 4 |
2 files changed, 36 insertions, 0 deletions
diff --git a/src/mbgl/map/backend.cpp b/src/mbgl/map/backend.cpp index c228719ba6..0b4fd01050 100644 --- a/src/mbgl/map/backend.cpp +++ b/src/mbgl/map/backend.cpp @@ -21,6 +21,38 @@ gl::Context& Backend::getContext() { return *context; } +PremultipliedImage Backend::readFramebuffer(const Size& size) const { + assert(context); + return context->readFramebuffer<PremultipliedImage>(size); +} + +void Backend::assumeFramebufferBinding(const gl::FramebufferID fbo) { + getContext().bindFramebuffer.setCurrentValue(fbo); + if (fbo != ImplicitFramebufferBinding) { + assert(gl::value::BindFramebuffer::Get() == getContext().bindFramebuffer.getCurrentValue()); + } +} +void Backend::assumeViewportSize(const Size& size) { + getContext().viewport.setCurrentValue({ 0, 0, size }); + assert(gl::value::Viewport::Get() == getContext().viewport.getCurrentValue()); +} + +bool Backend::implicitFramebufferBound() { + return getContext().bindFramebuffer.getCurrentValue() == ImplicitFramebufferBinding; +} + +void Backend::setFramebufferBinding(const gl::FramebufferID fbo) { + getContext().bindFramebuffer = fbo; + if (fbo != ImplicitFramebufferBinding) { + assert(gl::value::BindFramebuffer::Get() == getContext().bindFramebuffer.getCurrentValue()); + } +} + +void Backend::setViewportSize(const Size& size) { + getContext().viewport = { 0, 0, size }; + assert(gl::value::Viewport::Get() == getContext().viewport.getCurrentValue()); +} + Backend::~Backend() = default; } // namespace mbgl diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index 9e0b1a7575..8957f3272e 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -285,6 +285,8 @@ void Map::Impl::render(View& view) { contextMode, debugOptions }; + backend.updateAssumedState(); + painter->render(*style, frameData, view, @@ -323,6 +325,8 @@ void Map::Impl::render(View& view) { contextMode, debugOptions }; + backend.updateAssumedState(); + try { painter->render(*style, frameData, |