From a511ea6b31c90fc499a562a9ef27f3d83020d826 Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 16 Jan 2012 09:58:43 +0000 Subject: [PATCH] Mac GL fix for some older graphics cards. --- .../layout/juce_ComponentBuilder.cpp | 7 +++---- .../juce_gui_basics/layout/juce_ComponentBuilder.h | 13 ++++--------- .../juce_opengl/native/juce_mac_OpenGLComponent.mm | 2 +- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/modules/juce_gui_basics/layout/juce_ComponentBuilder.cpp b/modules/juce_gui_basics/layout/juce_ComponentBuilder.cpp index 21d37bd33a..d93c1eb05a 100644 --- a/modules/juce_gui_basics/layout/juce_ComponentBuilder.cpp +++ b/modules/juce_gui_basics/layout/juce_ComponentBuilder.cpp @@ -164,7 +164,7 @@ ComponentBuilder::TypeHandler* ComponentBuilder::getHandlerForState (const Value { TypeHandler* const t = types.getUnchecked(i); - if (t->getType() == targetType) + if (t->type == targetType) return t; } @@ -217,9 +217,8 @@ void ComponentBuilder::valueTreeParentChanged (ValueTree& tree) } //============================================================================== -ComponentBuilder::TypeHandler::TypeHandler (const Identifier& valueTreeType_) - : builder (nullptr), - valueTreeType (valueTreeType_) +ComponentBuilder::TypeHandler::TypeHandler (const Identifier& valueTreeType) + : type (valueTreeType), builder (nullptr) { } diff --git a/modules/juce_gui_basics/layout/juce_ComponentBuilder.h b/modules/juce_gui_basics/layout/juce_ComponentBuilder.h index bb5939f1bb..5232275c55 100644 --- a/modules/juce_gui_basics/layout/juce_ComponentBuilder.h +++ b/modules/juce_gui_basics/layout/juce_ComponentBuilder.h @@ -58,13 +58,10 @@ public: /** Destructor. */ ~ComponentBuilder(); + /** This is the ValueTree data object that the builder is working with. */ + ValueTree state; + //============================================================================== - /** Returns the ValueTree that this builder is working with. */ - ValueTree& getState() noexcept { return state; } - - /** Returns the ValueTree that this builder is working with. */ - const ValueTree& getState() const noexcept { return state; } - /** Returns the builder's component (creating it if necessary). The first time that this method is called, the builder will attempt to create a component @@ -111,7 +108,7 @@ public: virtual ~TypeHandler(); /** Returns the type of the ValueTrees that this handler can parse. */ - const Identifier& getType() const noexcept { return valueTreeType; } + const Identifier type; /** Returns the builder that this type is registered with. */ ComponentBuilder* getBuilder() const noexcept; @@ -144,7 +141,6 @@ public: //============================================================================== friend class ComponentBuilder; ComponentBuilder* builder; - const Identifier valueTreeType; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TypeHandler); }; @@ -238,7 +234,6 @@ public: private: //============================================================================= - ValueTree state; OwnedArray types; ScopedPointer component; ImageProvider* imageProvider; diff --git a/modules/juce_opengl/native/juce_mac_OpenGLComponent.mm b/modules/juce_opengl/native/juce_mac_OpenGLComponent.mm index ebd210a1f8..6b4f807b37 100644 --- a/modules/juce_opengl/native/juce_mac_OpenGLComponent.mm +++ b/modules/juce_opengl/native/juce_mac_OpenGLComponent.mm @@ -137,7 +137,7 @@ public: NSOpenGLPFAStencilSize, pixelFormat.stencilBufferBits, NSOpenGLPFAAccumSize, pixelFormat.accumulationBufferRedBits + pixelFormat.accumulationBufferGreenBits + pixelFormat.accumulationBufferBlueBits + pixelFormat.accumulationBufferAlphaBits, - NSOpenGLPFASampleBuffers, 1, + pixelFormat.multisamplingLevel > 0 ? NSOpenGLPFASamples : 0, pixelFormat.multisamplingLevel, 0 };