diff options
author | Aleksandar Stojiljkovic <aleksandar.stojiljkovic@mapbox.com> | 2019-06-09 14:18:59 +0300 |
---|---|---|
committer | Aleksandar Stojiljkovic <aleksandar.stojiljkovic@mapbox.com> | 2019-06-11 11:39:51 +0300 |
commit | d7fa18efa693bcb282755d86cc2f4c3d17e908b8 (patch) | |
tree | 782db36c66bceab7868db4d1170f23795764b40f | |
parent | df062afe6de7ec6e4a4d3c88389bbb5279b63a06 (diff) | |
download | qtlocation-mapboxgl-d7fa18efa693bcb282755d86cc2f4c3d17e908b8.tar.gz |
[core] Remove unused OffscreenTexture variant with depth render target
-rw-r--r-- | src/mbgl/gfx/context.hpp | 5 | ||||
-rw-r--r-- | src/mbgl/gl/context.cpp | 7 | ||||
-rw-r--r-- | src/mbgl/gl/context.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/gl/offscreen_texture.cpp | 24 | ||||
-rw-r--r-- | src/mbgl/gl/offscreen_texture.hpp | 6 |
5 files changed, 2 insertions, 44 deletions
diff --git a/src/mbgl/gfx/context.hpp b/src/mbgl/gfx/context.hpp index 53cd318642..64eddf3e5a 100644 --- a/src/mbgl/gfx/context.hpp +++ b/src/mbgl/gfx/context.hpp @@ -42,11 +42,6 @@ public: virtual std::unique_ptr<OffscreenTexture> createOffscreenTexture(Size, TextureChannelDataType = TextureChannelDataType::UnsignedByte) = 0; - virtual std::unique_ptr<OffscreenTexture> - createOffscreenTexture(Size, - Renderbuffer<RenderbufferPixelType::Depth>&, - TextureChannelDataType = TextureChannelDataType::UnsignedByte) = 0; - public: // Creates an empty texture with the specified dimensions. Texture createTexture(const Size size, diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp index 626e1f4b66..3e88624d4f 100644 --- a/src/mbgl/gl/context.cpp +++ b/src/mbgl/gl/context.cpp @@ -437,13 +437,6 @@ Context::createOffscreenTexture(const Size size, const gfx::TextureChannelDataTy return std::make_unique<gl::OffscreenTexture>(*this, size, type); } -std::unique_ptr<gfx::OffscreenTexture> -Context::createOffscreenTexture(const Size size, - gfx::Renderbuffer<gfx::RenderbufferPixelType::Depth>& depth, - gfx::TextureChannelDataType type) { - return std::make_unique<gl::OffscreenTexture>(*this, size, depth, type); -} - std::unique_ptr<gfx::DrawScopeResource> Context::createDrawScopeResource() { return std::make_unique<gl::DrawScopeResource>(createVertexArray()); } diff --git a/src/mbgl/gl/context.hpp b/src/mbgl/gl/context.hpp index c7e182f192..80278718d1 100644 --- a/src/mbgl/gl/context.hpp +++ b/src/mbgl/gl/context.hpp @@ -181,10 +181,6 @@ private: std::unique_ptr<gfx::OffscreenTexture> createOffscreenTexture( Size, gfx::TextureChannelDataType = gfx::TextureChannelDataType::UnsignedByte) override; - std::unique_ptr<gfx::OffscreenTexture> createOffscreenTexture( - Size, - gfx::Renderbuffer<gfx::RenderbufferPixelType::Depth>&, - gfx::TextureChannelDataType = gfx::TextureChannelDataType::UnsignedByte) override; std::unique_ptr<gfx::TextureResource> createTextureResource(Size, gfx::TexturePixelType, gfx::TextureChannelDataType) override; diff --git a/src/mbgl/gl/offscreen_texture.cpp b/src/mbgl/gl/offscreen_texture.cpp index 5feef95edf..92f80a87b4 100644 --- a/src/mbgl/gl/offscreen_texture.cpp +++ b/src/mbgl/gl/offscreen_texture.cpp @@ -15,23 +15,11 @@ public: assert(!size.isEmpty()); } - OffscreenTextureResource(gl::Context& context_, - const Size size_, - gfx::Renderbuffer<gfx::RenderbufferPixelType::Depth>& depth_, - const gfx::TextureChannelDataType type_) - : context(context_), size(size_), depth(&depth_), type(type_) { - assert(!size.isEmpty()); - } - void bind() override { if (!framebuffer) { assert(!texture); texture = context.createTexture(size, gfx::TexturePixelType::RGBA, type); - if (depth) { - framebuffer = context.createFramebuffer(*texture, *depth); - } else { - framebuffer = context.createFramebuffer(*texture); - } + framebuffer = context.createFramebuffer(*texture); } else { context.bindFramebuffer = framebuffer->framebuffer; } @@ -56,7 +44,6 @@ private: gl::Context& context; const Size size; optional<gfx::Texture> texture; - gfx::Renderbuffer<gfx::RenderbufferPixelType::Depth>* depth = nullptr; const gfx::TextureChannelDataType type; optional<gl::Framebuffer> framebuffer; }; @@ -67,15 +54,6 @@ OffscreenTexture::OffscreenTexture(gl::Context& context, : gfx::OffscreenTexture(size, std::make_unique<OffscreenTextureResource>(context, size_, type)) { } -OffscreenTexture::OffscreenTexture( - gl::Context& context, - const Size size_, - gfx::Renderbuffer<gfx::RenderbufferPixelType::Depth>& renderbuffer, - const gfx::TextureChannelDataType type) - : gfx::OffscreenTexture( - size, std::make_unique<OffscreenTextureResource>(context, size_, renderbuffer, type)) { -} - bool OffscreenTexture::isRenderable() { try { getResource<OffscreenTextureResource>().bind(); diff --git a/src/mbgl/gl/offscreen_texture.hpp b/src/mbgl/gl/offscreen_texture.hpp index 07da4f57e2..5f3863d3e9 100644 --- a/src/mbgl/gl/offscreen_texture.hpp +++ b/src/mbgl/gl/offscreen_texture.hpp @@ -1,7 +1,7 @@ #pragma once #include <mbgl/gfx/offscreen_texture.hpp> -#include <mbgl/gfx/renderbuffer.hpp> +#include <mbgl/gfx/types.hpp> namespace mbgl { namespace gl { @@ -13,10 +13,6 @@ public: OffscreenTexture(gl::Context&, Size size, gfx::TextureChannelDataType type = gfx::TextureChannelDataType::UnsignedByte); - OffscreenTexture(gl::Context&, - Size size, - gfx::Renderbuffer<gfx::RenderbufferPixelType::Depth>&, - gfx::TextureChannelDataType type = gfx::TextureChannelDataType::UnsignedByte); bool isRenderable() override; |