@@ -95,19 +95,16 @@ void Compositor::init_bitmaps()
95
95
auto physical_size = screen.physical_size ();
96
96
97
97
m_front_bitmap = Gfx::Bitmap::create_wrapper (Gfx::BitmapFormat::RGB32, physical_size, screen.pitch (), screen.scanline (0 ));
98
- m_front_painter = make<Gfx::Painter>(*m_front_bitmap);
99
- m_front_painter->scale (screen.scale_factor ());
98
+ m_front_painter = make<Gfx::Painter>(*m_front_bitmap, screen.scale_factor ());
100
99
101
100
if (m_screen_can_set_buffer)
102
101
m_back_bitmap = Gfx::Bitmap::create_wrapper (Gfx::BitmapFormat::RGB32, physical_size, screen.pitch (), screen.scanline (physical_size.height ()));
103
102
else
104
103
m_back_bitmap = Gfx::Bitmap::create (Gfx::BitmapFormat::RGB32, physical_size);
105
- m_back_painter = make<Gfx::Painter>(*m_back_bitmap);
106
- m_back_painter->scale (screen.scale_factor ());
104
+ m_back_painter = make<Gfx::Painter>(*m_back_bitmap, screen.scale_factor ());
107
105
108
106
m_temp_bitmap = Gfx::Bitmap::create (Gfx::BitmapFormat::RGB32, physical_size);
109
- m_temp_painter = make<Gfx::Painter>(*m_temp_bitmap);
110
- m_temp_painter->scale (screen.scale_factor ());
107
+ m_temp_painter = make<Gfx::Painter>(*m_temp_bitmap, screen.scale_factor ());
111
108
112
109
m_buffers_are_flipped = false ;
113
110
@@ -456,7 +453,7 @@ void Compositor::compose()
456
453
{
457
454
// FIXME: Give Bitmap an intrinsic scale factor and make Painter::blit() do the right thing if both it and the passed bitmap have scale factors:
458
455
// If a 2x scaled bitmap is blitted on a 2x scaled painter, it should be blitted without scale.
459
- Gfx::Painter unscaled_back_painter (*m_back_bitmap);
456
+ Gfx::Painter unscaled_back_painter (*m_back_bitmap, 1 );
460
457
auto scale = Screen::the ().scale_factor ();
461
458
for (auto & rect : flush_transparent_rects.rects ())
462
459
unscaled_back_painter.blit (rect.location () * scale, *m_temp_bitmap, rect * scale);
@@ -825,7 +822,7 @@ void Compositor::restore_cursor_back()
825
822
826
823
// FIXME: Give Bitmap an intrinsic scale factor and make Painter::blit() do the right thing if both it and the passed bitmap have scale factors:
827
824
// If a 2x scaled bitmap is blitted on a 2x scaled painter, it should be blitted without scale.
828
- Gfx::Painter unscaled_back_painter (*m_back_bitmap);
825
+ Gfx::Painter unscaled_back_painter (*m_back_bitmap, 1 );
829
826
auto last_physical_cursor_rect = (m_last_cursor_rect * Screen::the ().scale_factor ()).intersected (Screen::the ().physical_rect ());
830
827
unscaled_back_painter.blit (last_physical_cursor_rect.location (), *m_cursor_back_bitmap, { { 0 , 0 }, last_physical_cursor_rect.size () });
831
828
}
0 commit comments