Browse Source

Fixes for Quicktime, DrawableComposite.

tags/2021-05-28
Julian Storer 14 years ago
parent
commit
c583b68cd6
3 changed files with 34 additions and 18 deletions
  1. +17
    -9
      juce_amalgamated.cpp
  2. +5
    -1
      src/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp
  3. +12
    -8
      src/gui/graphics/drawables/juce_DrawableComposite.cpp

+ 17
- 9
juce_amalgamated.cpp View File

@@ -22626,6 +22626,7 @@ public:
extractor (0),
dataHandle (0)
{
JUCE_AUTORELEASEPOOL
bufferList.calloc (256, 1);

#if JUCE_WINDOWS
@@ -22751,6 +22752,9 @@ public:

~QTAudioReader()
{
JUCE_AUTORELEASEPOOL
checkThreadIsAttached();

if (dataHandle != 0)
DisposeHandle (dataHandle);

@@ -22760,7 +22764,6 @@ public:
extractor = 0;
}

checkThreadIsAttached();
DisposeMovie (movie);

#if JUCE_MAC
@@ -22771,6 +22774,7 @@ public:
bool readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
int64 startSampleInFile, int numSamples)
{
JUCE_AUTORELEASEPOOL
checkThreadIsAttached();
bool ok = true;

@@ -86401,17 +86405,21 @@ void DrawableComposite::render (const Drawable::RenderingContext& context) const
// we need to render everything opaquely into a temp buffer, then blend that
// with the target opacity...
const Rectangle<int> clipBounds (context.g.getClipBounds());
Image tempImage (Image::ARGB, clipBounds.getWidth(), clipBounds.getHeight(), true);

if (! clipBounds.isEmpty())
{
Graphics tempG (tempImage);
tempG.setOrigin (-clipBounds.getX(), -clipBounds.getY());
Drawable::RenderingContext tempContext (tempG, context.transform, 1.0f);
render (tempContext);
}
Image tempImage (Image::ARGB, clipBounds.getWidth(), clipBounds.getHeight(), true);

context.g.setOpacity (context.opacity);
context.g.drawImageAt (tempImage, clipBounds.getX(), clipBounds.getY());
{
Graphics tempG (tempImage);
tempG.setOrigin (-clipBounds.getX(), -clipBounds.getY());
Drawable::RenderingContext tempContext (tempG, context.transform, 1.0f);
render (tempContext);
}

context.g.setOpacity (context.opacity);
context.g.drawImageAt (tempImage, clipBounds.getX(), clipBounds.getY());
}
}
}
}


+ 5
- 1
src/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp View File

@@ -86,6 +86,7 @@ public:
extractor (0),
dataHandle (0)
{
JUCE_AUTORELEASEPOOL
bufferList.calloc (256, 1);
#if JUCE_WINDOWS
@@ -211,6 +212,9 @@ public:
~QTAudioReader()
{
JUCE_AUTORELEASEPOOL
checkThreadIsAttached();
if (dataHandle != 0)
DisposeHandle (dataHandle);
@@ -220,7 +224,6 @@ public:
extractor = 0;
}
checkThreadIsAttached();
DisposeMovie (movie);
#if JUCE_MAC
@@ -231,6 +234,7 @@ public:
bool readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
int64 startSampleInFile, int numSamples)
{
JUCE_AUTORELEASEPOOL
checkThreadIsAttached();
bool ok = true;


+ 12
- 8
src/gui/graphics/drawables/juce_DrawableComposite.cpp View File

@@ -232,17 +232,21 @@ void DrawableComposite::render (const Drawable::RenderingContext& context) const
// we need to render everything opaquely into a temp buffer, then blend that
// with the target opacity...
const Rectangle<int> clipBounds (context.g.getClipBounds());
Image tempImage (Image::ARGB, clipBounds.getWidth(), clipBounds.getHeight(), true);
if (! clipBounds.isEmpty())
{
Graphics tempG (tempImage);
tempG.setOrigin (-clipBounds.getX(), -clipBounds.getY());
Drawable::RenderingContext tempContext (tempG, context.transform, 1.0f);
render (tempContext);
}
Image tempImage (Image::ARGB, clipBounds.getWidth(), clipBounds.getHeight(), true);
context.g.setOpacity (context.opacity);
context.g.drawImageAt (tempImage, clipBounds.getX(), clipBounds.getY());
{
Graphics tempG (tempImage);
tempG.setOrigin (-clipBounds.getX(), -clipBounds.getY());
Drawable::RenderingContext tempContext (tempG, context.transform, 1.0f);
render (tempContext);
}
context.g.setOpacity (context.opacity);
context.g.drawImageAt (tempImage, clipBounds.getX(), clipBounds.getY());
}
}
}
}


Loading…
Cancel
Save