Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Kuznetsov <r.kuznetsow@gmail.com>2016-03-24 13:41:53 +0300
committerRoman Kuznetsov <r.kuznetsow@gmail.com>2016-03-24 13:41:53 +0300
commit55f2a67e955fb69afca28dbca11ba1274400b6f9 (patch)
treeccd1f1f47d72b0a37d47dbcf70aa57e869bfa97c
parent76cb6e84ab2e0ea0ff34790ff1c3ed2ac6331120 (diff)
Revert "[ios] Improved safety of present calls"
-rwxr-xr-xdrape_frontend/frontend_renderer.cpp4
-rw-r--r--iphone/Maps/Classes/EAGLView.h1
-rw-r--r--iphone/Maps/Classes/EAGLView.mm5
-rw-r--r--iphone/Maps/Classes/MapViewController.h2
-rw-r--r--iphone/Maps/Classes/MapViewController.mm10
-rw-r--r--iphone/Maps/Classes/MapsAppDelegate.mm2
-rw-r--r--iphone/Maps/Platform/opengl/iosOGLContext.h6
-rw-r--r--iphone/Maps/Platform/opengl/iosOGLContext.mm12
-rw-r--r--iphone/Maps/Platform/opengl/iosOGLContextFactory.h2
-rw-r--r--iphone/Maps/Platform/opengl/iosOGLContextFactory.mm6
10 files changed, 5 insertions, 45 deletions
diff --git a/drape_frontend/frontend_renderer.cpp b/drape_frontend/frontend_renderer.cpp
index 115d337240..2f904b5978 100755
--- a/drape_frontend/frontend_renderer.cpp
+++ b/drape_frontend/frontend_renderer.cpp
@@ -1473,7 +1473,9 @@ void FrontendRenderer::Routine::Do()
while (availableTime > 0);
}
- context->present();
+ if (m_renderer.IsRenderingEnabled())
+ context->present();
+
frameTime = timer.ElapsedSeconds();
timer.Reset();
diff --git a/iphone/Maps/Classes/EAGLView.h b/iphone/Maps/Classes/EAGLView.h
index dffcb6f167..600ce61de8 100644
--- a/iphone/Maps/Classes/EAGLView.h
+++ b/iphone/Maps/Classes/EAGLView.h
@@ -28,6 +28,5 @@ namespace dp
- (CGPoint)viewPoint2GlobalPoint:(CGPoint)pt;
- (CGPoint)globalPoint2ViewPoint:(CGPoint)pt;
- (void)initialize;
-- (void)setPresentAvailable:(BOOL)available;
@end
diff --git a/iphone/Maps/Classes/EAGLView.mm b/iphone/Maps/Classes/EAGLView.mm
index eb9dc73d01..6b8c1bcbcf 100644
--- a/iphone/Maps/Classes/EAGLView.mm
+++ b/iphone/Maps/Classes/EAGLView.mm
@@ -173,9 +173,4 @@ double getExactDPI(double contentScaleFactor)
return CGPointMake(ptP.x / scaleFactor, ptP.y / scaleFactor);
}
-- (void)setPresentAvailable:(BOOL)available
-{
- static_cast<iosOGLContextFactory*>(m_factory.get())->setPresentAvailable(available);
-}
-
@end
diff --git a/iphone/Maps/Classes/MapViewController.h b/iphone/Maps/Classes/MapViewController.h
index 4cd5ba4d1e..c5c694c871 100644
--- a/iphone/Maps/Classes/MapViewController.h
+++ b/iphone/Maps/Classes/MapViewController.h
@@ -21,8 +21,6 @@ namespace search { struct AddressInfo; }
- (void)onTerminate;
- (void)onEnterForeground;
- (void)onEnterBackground;
-- (void)onGetFocus;
-- (void)onLoseFocus;
- (void)setMapStyle:(MapStyle)mapStyle;
diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm
index d7dc0e9337..dc98413c7f 100644
--- a/iphone/Maps/Classes/MapViewController.mm
+++ b/iphone/Maps/Classes/MapViewController.mm
@@ -362,16 +362,6 @@ NSString * const kReportSegue = @"Map2ReportSegue";
GetFramework().EnterForeground();
}
-- (void)onGetFocus
-{
- [(EAGLView *)self.view setPresentAvailable:YES];
-}
-
-- (void)onLoseFocus
-{
- [(EAGLView *)self.view setPresentAvailable:NO];
-}
-
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm
index 28f47d394f..e674b2e6b6 100644
--- a/iphone/Maps/Classes/MapsAppDelegate.mm
+++ b/iphone/Maps/Classes/MapsAppDelegate.mm
@@ -559,7 +559,6 @@ using namespace osm_auth_ios;
- (void)applicationWillResignActive:(UIApplication *)application
{
- [self.mapViewController onLoseFocus];
[self.mapViewController.appWallAd close];
[RouteState save];
GetFramework().SetRenderingEnabled(false);
@@ -586,7 +585,6 @@ using namespace osm_auth_ios;
{
if (application.applicationState == UIApplicationStateBackground)
return;
- [self.mapViewController onGetFocus];
[self handleURLs];
[self restoreRouteState];
[[Statistics instance] applicationDidBecomeActive];
diff --git a/iphone/Maps/Platform/opengl/iosOGLContext.h b/iphone/Maps/Platform/opengl/iosOGLContext.h
index 41127e68df..24f905f551 100644
--- a/iphone/Maps/Platform/opengl/iosOGLContext.h
+++ b/iphone/Maps/Platform/opengl/iosOGLContext.h
@@ -6,8 +6,6 @@
#import <OpenGLES/ES2/gl.h>
#import <OpenGLES/ES2/glext.h>
-#include "std/atomic.hpp"
-
class iosOGLContext : public dp::OGLContext
{
public:
@@ -18,8 +16,6 @@ public:
virtual void present();
virtual void setDefaultFramebuffer();
virtual void resize(int w, int h);
-
- void setPresentAvailable(bool available);
private:
CAEAGLLayer * m_layer;
@@ -36,6 +32,4 @@ private:
GLuint m_depthBufferId;
GLuint m_frameBufferId;
//@} buffers
-
- atomic<bool> m_presentAvailable;
}; \ No newline at end of file
diff --git a/iphone/Maps/Platform/opengl/iosOGLContext.mm b/iphone/Maps/Platform/opengl/iosOGLContext.mm
index e881c67426..0ec7e221de 100644
--- a/iphone/Maps/Platform/opengl/iosOGLContext.mm
+++ b/iphone/Maps/Platform/opengl/iosOGLContext.mm
@@ -12,7 +12,6 @@ iosOGLContext::iosOGLContext(CAEAGLLayer * layer, iosOGLContext * contextToShare
, m_renderBufferId(0)
, m_depthBufferId(0)
, m_frameBufferId(0)
- , m_presentAvailable(true)
{
if (contextToShareWith != NULL)
{
@@ -37,23 +36,16 @@ void iosOGLContext::makeCurrent()
initBuffers();
}
-void iosOGLContext::setPresentAvailable(bool available)
-{
- m_presentAvailable = available;
-}
-
void iosOGLContext::present()
{
ASSERT(m_nativeContext != NULL, ());
ASSERT(m_renderBufferId, ());
-
+
GLenum const discards[] = { GL_DEPTH_ATTACHMENT, GL_COLOR_ATTACHMENT0 };
GLCHECK(glDiscardFramebufferEXT(GL_FRAMEBUFFER, 1, discards));
glBindRenderbuffer(GL_RENDERBUFFER, m_renderBufferId);
-
- if (m_presentAvailable)
- [m_nativeContext presentRenderbuffer: GL_RENDERBUFFER];
+ [m_nativeContext presentRenderbuffer: GL_RENDERBUFFER];
GLCHECK(glDiscardFramebufferEXT(GL_FRAMEBUFFER, 1, discards + 1));
}
diff --git a/iphone/Maps/Platform/opengl/iosOGLContextFactory.h b/iphone/Maps/Platform/opengl/iosOGLContextFactory.h
index bcec895726..928454ffcb 100644
--- a/iphone/Maps/Platform/opengl/iosOGLContextFactory.h
+++ b/iphone/Maps/Platform/opengl/iosOGLContextFactory.h
@@ -14,8 +14,6 @@ public:
virtual bool isDrawContextCreated() const;
virtual bool isUploadContextCreated() const;
-
- void setPresentAvailable(bool available);
private:
CAEAGLLayer * m_layer;
diff --git a/iphone/Maps/Platform/opengl/iosOGLContextFactory.mm b/iphone/Maps/Platform/opengl/iosOGLContextFactory.mm
index 60751ff34c..501f3c3ccf 100644
--- a/iphone/Maps/Platform/opengl/iosOGLContextFactory.mm
+++ b/iphone/Maps/Platform/opengl/iosOGLContextFactory.mm
@@ -35,9 +35,3 @@ bool iosOGLContextFactory::isUploadContextCreated() const
{
return m_uploadContext != nullptr;
}
-
-void iosOGLContextFactory::setPresentAvailable(bool available)
-{
- if (m_drawContext != nullptr)
- m_drawContext->setPresentAvailable(available);
-}