Browse Source

A couple of tweaks to improve iOS/android openGL.

tags/2021-05-28
jules 12 years ago
parent
commit
c018cba8c8
1 changed files with 7 additions and 15 deletions
  1. +7
    -15
      modules/juce_opengl/opengl/juce_OpenGLContext.cpp

+ 7
- 15
modules/juce_opengl/opengl/juce_OpenGLContext.cpp View File

@@ -71,9 +71,7 @@ public:
//==============================================================================
void paint (Graphics&)
{
ComponentPeer* const peer = component.getPeer();
if (peer != nullptr)
if (ComponentPeer* const peer = component.getPeer())
peer->addMaskedRegion (peer->getComponent().getLocalArea (&component, component.getLocalBounds()));
}
@@ -196,7 +194,8 @@ public:
JUCE_CHECK_OPENGL_ERROR
}
context.makeActive();
if (! context.isActive())
context.makeActive();
}
JUCE_CHECK_OPENGL_ERROR
@@ -347,9 +346,7 @@ void OpenGLContext::NativeContext::renderCallback()
{
isInsideGLCallback = true;
CachedImage* const c = CachedImage::get (component);
if (c != nullptr)
if (CachedImage* const c = CachedImage::get (component))
c->renderFrame();
isInsideGLCallback = false;
@@ -449,8 +446,8 @@ private:
void detach()
{
Component& comp = *getComponent();
CachedImage* oldCachedImage = CachedImage::get (comp);
if (oldCachedImage != nullptr)
if (CachedImage* const oldCachedImage = CachedImage::get (comp))
oldCachedImage->stop(); // (must stop this before detaching it from the component)
comp.setCachedComponentImage (nullptr);
@@ -559,13 +556,8 @@ void OpenGLContext::deactivateCurrentContext() { NativeContext::deactivateC
void OpenGLContext::triggerRepaint()
{
CachedImage* const cachedImage = getCachedImage();
if (cachedImage != nullptr)
{
if (CachedImage* const cachedImage = getCachedImage())
cachedImage->triggerRepaint();
cachedImage->component.repaint();
}
}
void OpenGLContext::swapBuffers()


Loading…
Cancel
Save