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

D2D: Remove unnecessary scaling in HwndPimpl::setSize

This commit is contained in:
reuk 2024-04-22 18:01:21 +01:00
parent 238edf6437
commit e005a41d6b
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C
2 changed files with 14 additions and 14 deletions

View file

@ -428,7 +428,7 @@ public:
{
ScopedMultithread scopedMultithread { directX->getD2DMultithread() };
auto hr = swap.resize (size * (float) owner.getPhysicalPixelScaleFactor(), deviceContext);
auto hr = swap.resize (size, deviceContext);
jassert (SUCCEEDED (hr));
if (FAILED (hr))
teardown();

View file

@ -4776,21 +4776,21 @@ private:
// and then tells the swap chain to present the next swap chain back buffer.
direct2DContext->setPhysicalPixelScaleFactor ((float) peer.getPlatformScaleFactor());
if (direct2DContext->startFrame())
{
peer.handlePaint (*direct2DContext);
direct2DContext->endFrame();
if (! direct2DContext->startFrame())
return;
#if JUCE_DIRECT2D_METRICS
if (lastPaintStartTicks > 0)
{
direct2DContext->metrics->addValueTicks (Direct2DMetrics::messageThreadPaintDuration,
Time::getHighResolutionTicks() - paintStartTicks);
direct2DContext->metrics->addValueTicks (Direct2DMetrics::frameInterval, paintStartTicks - lastPaintStartTicks);
}
lastPaintStartTicks = paintStartTicks;
#endif
peer.handlePaint (*direct2DContext);
direct2DContext->endFrame();
#if JUCE_DIRECT2D_METRICS
if (lastPaintStartTicks > 0)
{
direct2DContext->metrics->addValueTicks (Direct2DMetrics::messageThreadPaintDuration,
Time::getHighResolutionTicks() - paintStartTicks);
direct2DContext->metrics->addValueTicks (Direct2DMetrics::frameInterval, paintStartTicks - lastPaintStartTicks);
}
lastPaintStartTicks = paintStartTicks;
#endif
}
HWNDComponentPeer& peer;