Review fixes.

This commit is contained in:
Daria Volvenkova 2017-05-19 13:52:56 +03:00
parent 3434dd895e
commit df1b714e8d
7 changed files with 24 additions and 25 deletions

View file

@ -36,8 +36,8 @@ using namespace qt::common;
namespace qt
{
DrawWidget::DrawWidget(Framework & framework, bool useOpenGL3, QWidget * parent)
: TBase(framework, useOpenGL3, parent)
DrawWidget::DrawWidget(Framework & framework, bool apiOpenGLES3, QWidget * parent)
: TBase(framework, apiOpenGLES3, parent)
, m_rubberBand(nullptr)
, m_emulatingLocation(false)
{
@ -405,7 +405,7 @@ void DrawWidget::SetRouter(routing::RouterType routerType)
void DrawWidget::SetSelectionMode(bool mode) { m_selectionMode = mode; }
// static
void DrawWidget::SetDefaultSurfaceFormat(bool useOpenGL3)
void DrawWidget::SetDefaultSurfaceFormat(bool apiOpenGLES3)
{
QSurfaceFormat fmt;
fmt.setAlphaBufferSize(8);
@ -417,7 +417,7 @@ void DrawWidget::SetDefaultSurfaceFormat(bool useOpenGL3)
fmt.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
fmt.setSwapInterval(1);
fmt.setDepthBufferSize(16);
if (useOpenGL3)
if (apiOpenGLES3)
{
fmt.setProfile(QSurfaceFormat::CoreProfile);
fmt.setVersion(3, 2);

View file

@ -43,7 +43,7 @@ public Q_SLOTS:
void OnUpdateCountryStatusByTimer();
public:
DrawWidget(Framework & framework, bool useOpenGL3, QWidget * parent);
DrawWidget(Framework & framework, bool apiOpenGLES3, QWidget * parent);
~DrawWidget();
bool Search(search::EverywhereSearchParams const & params);
@ -72,7 +72,7 @@ public:
void SetSelectionMode(bool mode);
static void SetDefaultSurfaceFormat(bool useOpenGL3);
static void SetDefaultSurfaceFormat(bool apiOpenGLES3);
protected:
/// @name Overriden from MapWidget.

View file

@ -16,7 +16,6 @@
#include "3party/Alohalytics/src/alohalytics.h"
#include <QSurfaceFormat>
#include <QtCore/QDir>
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
@ -104,14 +103,14 @@ int main(int argc, char * argv[])
int returnCode = -1;
if (eulaAccepted) // User has accepted EULA
{
bool useOpenGL3 = false;
bool apiOpenGLES3 = false;
#if defined(OMIM_OS_MAC)
useOpenGL3 = a.arguments().contains("gl3");
apiOpenGLES3 = a.arguments().contains("es3", Qt::CaseInsensitive);
#endif
qt::MainWindow::SetDefaultSurfaceFormat(useOpenGL3);
qt::MainWindow::SetDefaultSurfaceFormat(apiOpenGLES3);
Framework framework;
qt::MainWindow w(framework, useOpenGL3);
qt::MainWindow w(framework, apiOpenGLES3);
w.show();
returnCode = a.exec();
}

View file

@ -121,7 +121,7 @@ namespace qt
extern char const * kTokenKeySetting;
extern char const * kTokenSecretSetting;
MainWindow::MainWindow(Framework & framework, bool useOpenGL3)
MainWindow::MainWindow(Framework & framework, bool apiOpenGLES3)
: m_Docks{}
, m_locationService(CreateDesktopLocationService(*this))
{
@ -129,7 +129,7 @@ MainWindow::MainWindow(Framework & framework, bool useOpenGL3)
QDesktopWidget const * desktop(QApplication::desktop());
setGeometry(desktop->screenGeometry(desktop->primaryScreen()));
m_pDrawWidget = new DrawWidget(framework, useOpenGL3, this);
m_pDrawWidget = new DrawWidget(framework, apiOpenGLES3, this);
setCentralWidget(m_pDrawWidget);
QObject::connect(m_pDrawWidget, SIGNAL(BeforeEngineCreation()), this, SLOT(OnBeforeEngineCreation()));
@ -684,9 +684,9 @@ void MainWindow::OnQuitTrafficMode()
}
// static
void MainWindow::SetDefaultSurfaceFormat(bool useOpenGL3)
void MainWindow::SetDefaultSurfaceFormat(bool apiOpenGLES3)
{
DrawWidget::SetDefaultSurfaceFormat(useOpenGL3);
DrawWidget::SetDefaultSurfaceFormat(apiOpenGLES3);
}
} // namespace qt

View file

@ -55,12 +55,12 @@ namespace qt
Q_OBJECT
public:
MainWindow(Framework & framework, bool useOpenGL3);
MainWindow(Framework & framework, bool apiOpenGLES3);
virtual void OnLocationError(location::TLocationError errorCode);
virtual void OnLocationUpdated(location::GpsInfo const & info);
static void SetDefaultSurfaceFormat(bool useOpenGL3);
static void SetDefaultSurfaceFormat(bool apiOpenGLES3);
protected:
string GetIniFile();

View file

@ -21,10 +21,10 @@ namespace qt
{
namespace common
{
MapWidget::MapWidget(Framework & framework, bool useOpenGL3, QWidget * parent)
MapWidget::MapWidget(Framework & framework, bool apiOpenGLES3, QWidget * parent)
: QOpenGLWidget(parent)
, m_framework(framework)
, m_useOpenGL3(useOpenGL3)
, m_apiOpenGLES3(apiOpenGLES3)
, m_slider(nullptr)
, m_sliderState(SliderState::Released)
, m_ratio(1.0)
@ -78,7 +78,7 @@ void MapWidget::CreateEngine()
{
Framework::DrapeCreationParams p;
p.m_apiVersion = m_useOpenGL3 ? dp::ApiVersion::OpenGLES3 : dp::ApiVersion::OpenGLES2;
p.m_apiVersion = m_apiOpenGLES3 ? dp::ApiVersion::OpenGLES3 : dp::ApiVersion::OpenGLES2;
p.m_surfaceWidth = m_ratio * width();
p.m_surfaceHeight = m_ratio * height();
p.m_visualScale = m_ratio;
@ -166,9 +166,9 @@ void MapWidget::UpdateScaleControl()
void MapWidget::Build()
{
string vertexSrc;
string fragmentSrc;
if (m_useOpenGL3)
std::string vertexSrc;
std::string fragmentSrc;
if (m_apiOpenGLES3)
{
vertexSrc =
"\

View file

@ -29,7 +29,7 @@ class MapWidget : public QOpenGLWidget
Q_OBJECT
public:
MapWidget(Framework & framework, bool useOpenGL3, QWidget * parent);
MapWidget(Framework & framework, bool apiOpenGLES3, QWidget * parent);
~MapWidget() override;
void BindHotkeys(QWidget & parent);
@ -77,7 +77,7 @@ protected:
void wheelEvent(QWheelEvent * e) override;
Framework & m_framework;
bool m_useOpenGL3;
bool m_apiOpenGLES3;
ScaleSlider * m_slider;
SliderState m_sliderState;