summaryrefslogtreecommitdiff
path: root/platform/glfw
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2019-04-02 14:11:37 +0200
committerKonstantin Käfer <mail@kkaefer.com>2019-05-28 16:11:05 +0200
commite52ce34fb578e2c9f9f61fcea11e1ebb2251b6f4 (patch)
treed635ed17006c9cca828ec56d45365d7e20794c6c /platform/glfw
parent7f9274035bad30980e03574c315904ab7a85fe83 (diff)
downloadqtlocation-mapboxgl-e52ce34fb578e2c9f9f61fcea11e1ebb2251b6f4.tar.gz
[core] remove platform::show(Color)?DebugImage
Diffstat (limited to 'platform/glfw')
-rw-r--r--platform/glfw/glfw_view.cpp75
1 files changed, 0 insertions, 75 deletions
diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp
index 82519e6ac2..cba3419672 100644
--- a/platform/glfw/glfw_view.cpp
+++ b/platform/glfw/glfw_view.cpp
@@ -720,78 +720,3 @@ void GLFWView::toggleCustomSource() {
mbgl::style::VisibilityType::None : mbgl::style::VisibilityType::Visible);
}
}
-
-namespace mbgl {
-namespace platform {
-
-#ifndef MBGL_USE_GLES2
-void showDebugImage(std::string name, const char *data, size_t width, size_t height) {
- glfwInit();
-
- static GLFWwindow *debugWindow = nullptr;
- if (!debugWindow) {
- debugWindow = glfwCreateWindow(static_cast<int>(width), static_cast<int>(height), name.c_str(), nullptr, nullptr);
- if (!debugWindow) {
- glfwTerminate();
- fprintf(stderr, "Failed to initialize window\n");
- exit(1);
- }
- }
-
- GLFWwindow *currentWindow = glfwGetCurrentContext();
-
- glfwSetWindowSize(debugWindow, static_cast<int>(width), static_cast<int>(height));
- glfwMakeContextCurrent(debugWindow);
-
- int fbWidth, fbHeight;
- glfwGetFramebufferSize(debugWindow, &fbWidth, &fbHeight);
- float scale = static_cast<float>(fbWidth) / static_cast<float>(width);
-
- glPixelZoom(scale, -scale);
- glRasterPos2f(-1.0f, 1.0f);
- glDrawPixels(width, height, GL_LUMINANCE, GL_UNSIGNED_BYTE, data);
-
- glfwSwapBuffers(debugWindow);
-
- glfwMakeContextCurrent(currentWindow);
-}
-
-void showColorDebugImage(std::string name, const char *data, size_t logicalWidth, size_t logicalHeight, size_t width, size_t height) {
- glfwInit();
-
- static GLFWwindow *debugWindow = nullptr;
- if (!debugWindow) {
- debugWindow = glfwCreateWindow(static_cast<int>(logicalWidth), static_cast<int>(logicalHeight), name.c_str(), nullptr, nullptr);
- if (!debugWindow) {
- glfwTerminate();
- fprintf(stderr, "Failed to initialize window\n");
- exit(1);
- }
- }
-
- GLFWwindow *currentWindow = glfwGetCurrentContext();
-
- glfwSetWindowSize(debugWindow, static_cast<int>(logicalWidth), static_cast<int>(logicalHeight));
- glfwMakeContextCurrent(debugWindow);
-
- int fbWidth, fbHeight;
- glfwGetFramebufferSize(debugWindow, &fbWidth, &fbHeight);
- float xScale = static_cast<float>(fbWidth) / static_cast<float>(width);
- float yScale = static_cast<float>(fbHeight) / static_cast<float>(height);
-
- glClearColor(0.8, 0.8, 0.8, 1);
- glClear(GL_COLOR_BUFFER_BIT);
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glPixelZoom(xScale, -yScale);
- glRasterPos2f(-1.0f, 1.0f);
- glDrawPixels(width, height, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, data);
-
- glfwSwapBuffers(debugWindow);
-
- glfwMakeContextCurrent(currentWindow);
-}
-#endif
-
-} // namespace platform
-} // namespace mbgl