From 26fca8b440e5c1c85f27ee0c4c04b5c343d409e7 Mon Sep 17 00:00:00 2001 From: ExMix Date: Tue, 17 Feb 2015 14:17:03 +0300 Subject: [PATCH] review fixes --- .../com/mapswithme/opengl/androidoglcontextfactory.cpp | 8 ++++---- drape/glfunctions.cpp | 5 +---- drape_head/drape_surface.cpp | 8 ++++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/android/jni/com/mapswithme/opengl/androidoglcontextfactory.cpp b/android/jni/com/mapswithme/opengl/androidoglcontextfactory.cpp index 31c660c3f7..3cee4b03c5 100644 --- a/android/jni/com/mapswithme/opengl/androidoglcontextfactory.cpp +++ b/android/jni/com/mapswithme/opengl/androidoglcontextfactory.cpp @@ -141,7 +141,7 @@ dp::OGLContext * AndroidOGLContextFactory::getDrawContext() { ASSERT(IsValid(), ()); ASSERT(m_windowSurface != EGL_NO_SURFACE, ()); - if (m_drawContext == NULL) + if (m_drawContext == nullptr) m_drawContext = new AndroidOGLContext(m_display, m_windowSurface, m_config, m_uploadContext); return m_drawContext; } @@ -150,19 +150,19 @@ dp::OGLContext * AndroidOGLContextFactory::getResourcesUploadContext() { ASSERT(IsValid(), ()); ASSERT(m_pixelbufferSurface != EGL_NO_SURFACE, ()); - if (m_uploadContext == NULL) + if (m_uploadContext == nullptr) m_uploadContext = new AndroidOGLContext(m_display, m_pixelbufferSurface, m_config, m_drawContext); return m_uploadContext; } bool AndroidOGLContextFactory::isDrawContextCreated() const { - return m_drawContext != NULL; + return m_drawContext != nullptr; } bool AndroidOGLContextFactory::isUploadContextCreated() const { - return m_uploadContext != NULL; + return m_uploadContext != nullptr; } bool AndroidOGLContextFactory::createWindowSurface() diff --git a/drape/glfunctions.cpp b/drape/glfunctions.cpp index 8056a49b48..485656c290 100644 --- a/drape/glfunctions.cpp +++ b/drape/glfunctions.cpp @@ -12,9 +12,6 @@ #include "std/map.hpp" #endif -#include "std/cstring.hpp" -#include "std/atomic.hpp" - #if defined(OMIM_OS_WINDOWS) #define DP_APIENTRY __stdcall #elif defined(OMIM_OS_ANDROID) @@ -253,7 +250,7 @@ void GLFunctions::Init() #else typedef void (DP_APIENTRY *glShaderSource_Type)(GLuint shaderID, GLsizei count, GLchar const ** string, GLint const * length); glShaderSourceFn = reinterpret_cast(&::glShaderSource); -#endif` +#endif glCompileShaderFn = LOAD_GL_FUNC(TglCompileShaderFn, glCompileShader); glDeleteShaderFn = LOAD_GL_FUNC(TglDeleteShaderFn, glDeleteShader); glGetShaderivFn = LOAD_GL_FUNC(TglGetShaderivFn, glGetShaderiv); diff --git a/drape_head/drape_surface.cpp b/drape_head/drape_surface.cpp index 28a553e57f..14658d52d3 100644 --- a/drape_head/drape_surface.cpp +++ b/drape_head/drape_surface.cpp @@ -38,7 +38,7 @@ void DrapeSurface::CreateEngine() { dp::RefPointer f(m_contextFactory.GetRefPointer()); - float pixelRatio = devicePixelRatio(); + float const pixelRatio = devicePixelRatio(); m_drapeEngine = TEnginePrt(new df::TestingEngine(f, df::Viewport(0, 0, pixelRatio * width(), pixelRatio * height()), pixelRatio)); } @@ -47,9 +47,9 @@ void DrapeSurface::sizeChanged(int) { if (!m_drapeEngine.IsNull()) { - float vs = devicePixelRatio(); - int w = width() * vs; - int h = height() * vs; + float const vs = devicePixelRatio(); + int const w = width() * vs; + int const h = height() * vs; m_drapeEngine->Resize(w, h); } }