mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-24 01:54:22 +00:00
Minor clean-ups.
This commit is contained in:
parent
9a1171a7ef
commit
da3838db8a
4 changed files with 17 additions and 12 deletions
|
|
@ -256,7 +256,10 @@ void Image::duplicateIfShared()
|
|||
|
||||
Image Image::createCopy() const
|
||||
{
|
||||
return Image (image != nullptr ? image->clone() : nullptr);
|
||||
if (image != nullptr)
|
||||
return Image (image->clone());
|
||||
|
||||
return Image();
|
||||
}
|
||||
|
||||
Image Image::rescaled (const int newWidth, const int newHeight, const Graphics::ResamplingQuality quality) const
|
||||
|
|
|
|||
|
|
@ -131,10 +131,11 @@ Component* ComponentBuilder::createComponent()
|
|||
{
|
||||
jassert (types.size() > 0); // You need to register all the necessary types before you can load a component!
|
||||
|
||||
TypeHandler* const type = getHandlerForState (state);
|
||||
jassert (type != nullptr); // trying to create a component from an unknown type of ValueTree
|
||||
if (TypeHandler* const type = getHandlerForState (state))
|
||||
return ComponentBuilderHelpers::createNewComponent (*type, state, nullptr);
|
||||
|
||||
return type != nullptr ? ComponentBuilderHelpers::createNewComponent (*type, state, nullptr) : nullptr;
|
||||
jassertfalse; // trying to create a component from an unknown type of ValueTree
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ComponentBuilder::registerTypeHandler (ComponentBuilder::TypeHandler* const type)
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@
|
|||
class OpenGLFrameBufferImage : public ImagePixelData
|
||||
{
|
||||
public:
|
||||
OpenGLFrameBufferImage (OpenGLContext& context_, int w, int h)
|
||||
OpenGLFrameBufferImage (OpenGLContext& c, int w, int h)
|
||||
: ImagePixelData (Image::ARGB, w, h),
|
||||
context (context_),
|
||||
context (c),
|
||||
pixelStride (4),
|
||||
lineStride (width * pixelStride)
|
||||
{
|
||||
|
|
@ -116,8 +116,8 @@ private:
|
|||
|
||||
struct Writer
|
||||
{
|
||||
Writer (OpenGLFrameBuffer& frameBuffer_, int x, int y, int w, int h) noexcept
|
||||
: frameBuffer (frameBuffer_), area (x, y, w, h)
|
||||
Writer (OpenGLFrameBuffer& fb, int x, int y, int w, int h) noexcept
|
||||
: frameBuffer (fb), area (x, y, w, h)
|
||||
{}
|
||||
|
||||
void write (const PixelARGB* const data) const noexcept
|
||||
|
|
@ -195,7 +195,8 @@ ImagePixelData::Ptr OpenGLImageType::create (Image::PixelFormat, int width, int
|
|||
|
||||
OpenGLFrameBuffer* OpenGLImageType::getFrameBufferFrom (const Image& image)
|
||||
{
|
||||
OpenGLFrameBufferImage* const glImage = dynamic_cast<OpenGLFrameBufferImage*> (image.getPixelData());
|
||||
if (OpenGLFrameBufferImage* const glImage = dynamic_cast<OpenGLFrameBufferImage*> (image.getPixelData()))
|
||||
return &(glImage->frameBuffer);
|
||||
|
||||
return glImage != nullptr ? &(glImage->frameBuffer) : nullptr;
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@
|
|||
|
||||
#if JUCE_USE_OPENGL_SHADERS
|
||||
|
||||
OpenGLShaderProgram::OpenGLShaderProgram (const OpenGLContext& context_) noexcept
|
||||
: context (context_)
|
||||
OpenGLShaderProgram::OpenGLShaderProgram (const OpenGLContext& c) noexcept
|
||||
: context (c)
|
||||
{
|
||||
// This object can only be created and used when the current thread has an active OpenGL context.
|
||||
jassert (OpenGLHelpers::isContextActive());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue