forked from organicmaps/organicmaps
[drape] code review fix
This commit is contained in:
parent
1ba387f7cd
commit
472fba5f6f
9 changed files with 37 additions and 38 deletions
|
@ -376,7 +376,7 @@ void GLFunctions::glGetActiveUniform(uint32_t programID, uint32_t uniformIndex,
|
|||
ASSERT(glGetActiveUniformFn != NULL, ());
|
||||
char buff[256];
|
||||
GLCHECK(glGetActiveUniformFn(programID, uniformIndex, 256, NULL, uniformSize, type, buff));
|
||||
name = string(buff);
|
||||
name = buff;
|
||||
}
|
||||
|
||||
int8_t GLFunctions::glGetUniformLocation(uint32_t programID, const string & name)
|
||||
|
|
|
@ -141,13 +141,13 @@ public:
|
|||
TransferPointer(const TransferPointer<T> & other)
|
||||
: base_t(other)
|
||||
{
|
||||
ASSERT(GET_CHECK_FLAG(other) == true, ());
|
||||
ASSERT(GET_CHECK_FLAG(other), ());
|
||||
other.SetToNull();
|
||||
}
|
||||
|
||||
TransferPointer<T> & operator=(TransferPointer<T> const & other)
|
||||
{
|
||||
ASSERT(GET_CHECK_FLAG(other) == true, ());;
|
||||
ASSERT(GET_CHECK_FLAG(other), ());;
|
||||
base_t::operator =(other);
|
||||
other.SetToNull();
|
||||
return *this;
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
|
||||
namespace df
|
||||
{
|
||||
BackendRenderer::BackendRenderer(RefPointer<ThreadsCommutator> commutator
|
||||
,RefPointer<OGLContextFactory> oglcontextfactory
|
||||
,double visualScale
|
||||
,int surfaceWidth
|
||||
,int surfaceHeight)
|
||||
BackendRenderer::BackendRenderer(RefPointer<ThreadsCommutator> commutator,
|
||||
RefPointer<OGLContextFactory> oglcontextfactory,
|
||||
double visualScale,
|
||||
int surfaceWidth,
|
||||
int surfaceHeight)
|
||||
: m_commutator(commutator)
|
||||
{
|
||||
m_impl.Reset(new BackendRendererImpl(m_commutator, oglcontextfactory, visualScale, surfaceWidth, surfaceHeight));
|
||||
|
|
|
@ -16,11 +16,11 @@ namespace df
|
|||
class BackendRenderer
|
||||
{
|
||||
public:
|
||||
BackendRenderer(RefPointer<ThreadsCommutator> commutator
|
||||
,RefPointer<OGLContextFactory> oglcontextfactory
|
||||
,double visualScale
|
||||
,int surfaceWidth
|
||||
,int surfaceHeight);
|
||||
BackendRenderer(RefPointer<ThreadsCommutator> commutator,
|
||||
RefPointer<OGLContextFactory> oglcontextfactory,
|
||||
double visualScale,
|
||||
int surfaceWidth,
|
||||
int surfaceHeight);
|
||||
|
||||
~BackendRenderer();
|
||||
|
||||
|
|
|
@ -28,14 +28,14 @@ DrapeEngine::~DrapeEngine()
|
|||
void DrapeEngine::OnSizeChanged(int x0, int y0, int w, int h)
|
||||
{
|
||||
m_backend->Resize(x0, y0, w, h);
|
||||
m_threadCommutator->PostMessage(ThreadsCommutator::RenderThread
|
||||
,MovePointer<Message>(new ResizeMessage(x0, y0, w, h)));
|
||||
m_threadCommutator->PostMessage(ThreadsCommutator::RenderThread,
|
||||
MovePointer<Message>(new ResizeMessage(x0, y0, w, h)));
|
||||
}
|
||||
|
||||
void DrapeEngine::SetAngle(float radians)
|
||||
{
|
||||
m_threadCommutator->PostMessage(ThreadsCommutator::RenderThread
|
||||
, MovePointer<Message>(new RotateMessage(radians)));
|
||||
m_threadCommutator->PostMessage(ThreadsCommutator::RenderThread,
|
||||
MovePointer<Message>(new RotateMessage(radians)));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,8 +12,9 @@
|
|||
|
||||
namespace df
|
||||
{
|
||||
FrontendRenderer::FrontendRenderer(RefPointer<ThreadsCommutator> commutator
|
||||
, RefPointer<OGLContextFactory> oglcontextfactory, int w, int h)
|
||||
FrontendRenderer::FrontendRenderer(RefPointer<ThreadsCommutator> commutator,
|
||||
RefPointer<OGLContextFactory> oglcontextfactory,
|
||||
int w, int h)
|
||||
: m_commutator(commutator)
|
||||
, m_gpuProgramManager(new GpuProgramManager())
|
||||
, m_contextFactory(oglcontextfactory)
|
||||
|
@ -184,11 +185,9 @@ namespace df
|
|||
while (!IsCancelled())
|
||||
{
|
||||
ProcessSingleMessage(false);
|
||||
{
|
||||
context->setDefaultFramebuffer();
|
||||
RenderScene();
|
||||
context->present();
|
||||
}
|
||||
context->setDefaultFramebuffer();
|
||||
RenderScene();
|
||||
context->present();
|
||||
}
|
||||
|
||||
ReleaseResources();
|
||||
|
|
|
@ -23,9 +23,9 @@ namespace df
|
|||
public threads::IRoutine
|
||||
{
|
||||
public:
|
||||
FrontendRenderer(RefPointer<ThreadsCommutator> commutator
|
||||
,RefPointer<OGLContextFactory> oglcontextfactory
|
||||
, int w, int h);
|
||||
FrontendRenderer(RefPointer<ThreadsCommutator> commutator,
|
||||
RefPointer<OGLContextFactory> oglcontextfactory,
|
||||
int w, int h);
|
||||
|
||||
~FrontendRenderer();
|
||||
|
||||
|
|
|
@ -40,11 +40,11 @@ namespace
|
|||
|
||||
namespace df
|
||||
{
|
||||
BackendRendererImpl::BackendRendererImpl(RefPointer<ThreadsCommutator> commutator
|
||||
,RefPointer<OGLContextFactory> oglcontextfactory
|
||||
,double visualScale
|
||||
,int surfaceWidth
|
||||
,int surfaceHeight)
|
||||
BackendRendererImpl::BackendRendererImpl(RefPointer<ThreadsCommutator> commutator,
|
||||
RefPointer<OGLContextFactory> oglcontextfactory,
|
||||
double visualScale,
|
||||
int surfaceWidth,
|
||||
int surfaceHeight)
|
||||
: m_engineContext(commutator)
|
||||
, m_commutator(commutator)
|
||||
, m_contextFactory(oglcontextfactory)
|
||||
|
@ -54,7 +54,7 @@ namespace df
|
|||
|
||||
m_commutator->RegisterThread(ThreadsCommutator::ResourceUploadThread, this);
|
||||
|
||||
int readerCount = 1;//max(1, GetPlatform().CpuCores() - 2);
|
||||
int readerCount = max(1, GetPlatform().CpuCores() - 2);
|
||||
m_threadPool.Reset(new threads::ThreadPool(readerCount, bind(&PostFinishTask, commutator, _1)));
|
||||
m_batchersPool.Reset(new BatchersPool(readerCount, bind(&BackendRendererImpl::PostToRenderThreads, this, _1)));
|
||||
|
||||
|
|
|
@ -28,11 +28,11 @@ namespace df
|
|||
public threads::IRoutine
|
||||
{
|
||||
public:
|
||||
BackendRendererImpl(RefPointer<ThreadsCommutator> commutator
|
||||
,RefPointer<OGLContextFactory> oglcontextfactory
|
||||
,double visualScale
|
||||
,int surfaceWidth
|
||||
,int surfaceHeight);
|
||||
BackendRendererImpl(RefPointer<ThreadsCommutator> commutator,
|
||||
RefPointer<OGLContextFactory> oglcontextfactory,
|
||||
double visualScale,
|
||||
int surfaceWidth,
|
||||
int surfaceHeight);
|
||||
|
||||
~BackendRendererImpl();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue