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

Direct2D: Move bitmap helpers to shared DirectX header

This commit is contained in:
reuk 2024-08-12 18:03:07 +01:00
parent f0f77db261
commit f3a74896fc
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C
3 changed files with 92 additions and 90 deletions

View file

@ -351,7 +351,7 @@ public:
JUCE_D2DMETRICS_SCOPED_ELAPSED_TIME (Direct2DMetricsHub::getInstance()->imageContextMetrics, createBitmapTime);
return Direct2DBitmap::fromImage (fillType.image, deviceResources.deviceContext.context, Image::ARGB);
return Direct2DBitmap::toBitmap (fillType.image, deviceResources.deviceContext.context, Image::ARGB);
}();
if (d2d1Bitmap != nullptr)
@ -1188,7 +1188,7 @@ void Direct2DGraphicsContext::clipToImageAlpha (const Image& sourceImage, const
if (! d2d1Bitmap)
{
// Convert sourceImage to single-channel alpha-only maskImage
d2d1Bitmap = Direct2DBitmap::fromImage (sourceImage, deviceContext, Image::SingleChannel);
d2d1Bitmap = Direct2DBitmap::toBitmap (sourceImage, deviceContext, Image::SingleChannel);
}
if (d2d1Bitmap)
@ -1474,7 +1474,7 @@ void Direct2DGraphicsContext::drawImage (const Image& image, const AffineTransfo
{
JUCE_D2DMETRICS_SCOPED_ELAPSED_TIME (Direct2DMetricsHub::getInstance()->imageContextMetrics, createBitmapTime);
d2d1Bitmap = Direct2DBitmap::fromImage (image, deviceContext, Image::ARGB);
d2d1Bitmap = Direct2DBitmap::toBitmap (image, deviceContext, Image::ARGB);
imageClipArea = image.getBounds();
}