1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-24 01:54:22 +00:00

Big rewrite of the LowLevelGraphicsSoftwareRenderer class, adding internal support for complex clipping regions - this will temporarily make font rendering quite slow, until it gets re-optimised for this new design. Changed the Image class to remove the lockPixelData methods, and replaced these with an object Image::BitmapData, which is easier to use.

This commit is contained in:
Julian Storer 2009-11-26 21:36:45 +00:00
parent 9fc4b6d822
commit 6fdde63a63
25 changed files with 3542 additions and 4458 deletions

View file

@ -152,19 +152,17 @@ void ImageConvolutionKernel::applyToImage (Image& destImage,
const int dx2 = dx + dw;
const int dy2 = dy + dh;
int lineStride, pixelStride;
uint8* pixels = destImage.lockPixelDataReadWrite (dx, dy, dw, dh, lineStride, pixelStride);
uint8* line = pixels;
const Image::BitmapData destData (destImage, dx, dy, dw, dh, true);
uint8* line = destData.data;
int srcLineStride, srcPixelStride;
const uint8* srcPixels = sourceImage->lockPixelDataReadOnly (0, 0, sourceImage->getWidth(), sourceImage->getHeight(), srcLineStride, srcPixelStride);
const Image::BitmapData srcData (*sourceImage, 0, 0, sourceImage->getWidth(), sourceImage->getHeight());
if (pixelStride == 4)
if (destData.pixelStride == 4)
{
for (int y = dy; y < dy2; ++y)
{
uint8* dest = line;
line += lineStride;
line += destData.lineStride;
for (int x = dx; x < dx2; ++x)
{
@ -183,7 +181,7 @@ void ImageConvolutionKernel::applyToImage (Image& destImage,
if (sy >= 0)
{
int sx = x - (size >> 1);
const uint8* src = srcPixels + srcLineStride * sy + srcPixelStride * sx;
const uint8* src = srcData.getPixelPointer (sx, sy);
for (int xx = 0; xx < size; ++xx)
{
@ -215,12 +213,12 @@ void ImageConvolutionKernel::applyToImage (Image& destImage,
}
}
}
else if (pixelStride == 3)
else if (destData.pixelStride == 3)
{
for (int y = dy; y < dy2; ++y)
{
uint8* dest = line;
line += lineStride;
line += destData.lineStride;
for (int x = dx; x < dx2; ++x)
{
@ -238,7 +236,7 @@ void ImageConvolutionKernel::applyToImage (Image& destImage,
if (sy >= 0)
{
int sx = x - (size >> 1);
const uint8* src = srcPixels + srcLineStride * sy + srcPixelStride * sx;
const uint8* src = srcData.getPixelPointer (sx, sy);
for (int xx = 0; xx < size; ++xx)
{
@ -269,11 +267,7 @@ void ImageConvolutionKernel::applyToImage (Image& destImage,
}
}
sourceImage->releasePixelDataReadOnly (srcPixels);
destImage.releasePixelDataReadWrite (pixels);
if (imageCreated != 0)
delete imageCreated;
delete imageCreated;
}
END_JUCE_NAMESPACE