@@ -88,7 +88,7 @@ void MCImage::drawme(MCDC *dc, int2 sx, int2 sy, uint2 sw, uint2 sh, int2 dx, in
8888 // source images from flushing everything else out of the cache.
8989 bool t_success = true ;
9090
91- MCImageFrame *t_frame = nil;
91+ MCGImageFrame *t_frame = nil;
9292
9393 bool t_printer = dc->gettype () == CONTEXT_TYPE_PRINTER ;
9494 bool t_update = !((state & CS_SIZE ) && (state & CS_EDITED ));
@@ -138,7 +138,7 @@ void MCImage::drawme(MCDC *dc, int2 sx, int2 sy, uint2 sw, uint2 sh, int2 dx, in
138138
139139 // IM-2014-01-31: [[ HiDPI ]] Get the appropriate image for the combined
140140 // context device & image transforms
141- t_success = t_rep->LockImageFrame (currentframe, true , t_device_scale, t_frame);
141+ t_success = t_rep->LockImageFrame (currentframe, t_device_scale, t_frame);
142142 if (t_success)
143143 {
144144 MCImageDescriptor t_image;
@@ -169,7 +169,7 @@ void MCImage::drawme(MCDC *dc, int2 sx, int2 sy, uint2 sw, uint2 sh, int2 dx, in
169169 break ;
170170 }
171171
172- t_image . bitmap = t_frame->image ;
172+ t_image . image = t_frame->image ;
173173
174174 if (t_printer && m_rep->GetType () == kMCImageRepResident )
175175 {
@@ -202,8 +202,8 @@ void MCImage::drawme(MCDC *dc, int2 sx, int2 sy, uint2 sw, uint2 sh, int2 dx, in
202202
203203 if (state & CS_DO_START )
204204 {
205- MCImageFrame *t_frame = nil;
206- if (m_rep->LockImageFrame (currentframe, true , getdevicescale (), t_frame))
205+ MCGImageFrame *t_frame = nil;
206+ if (m_rep->LockImageFrame (currentframe, getdevicescale (), t_frame))
207207 {
208208 MCscreen->addtimer (this , MCM_internal, t_frame->duration );
209209 m_rep->UnlockImageFrame (currentframe, t_frame);
@@ -401,15 +401,22 @@ void MCImage::magredrawrect(MCContext *dest_context, const MCRectangle &drect)
401401 // OVERHAUL - REVISIT: may be able to use scaling transform with nearest filter
402402 // instead of manually scaling image
403403
404+ MCGImageRef t_line_img;
405+ t_line_img = nil;
406+
407+ /* UNCHECKED */ MCGImageCreateWithRasterNoCopy (MCImageBitmapGetMCGRaster (t_line, true ), t_line_img);
408+
404409 // Render the scanline into the destination context.
405410 MCImageDescriptor t_image;
406411 memset (&t_image, 0 , sizeof (MCImageDescriptor));
407- t_image . bitmap = t_line ;
412+ t_image . image = t_line_img ;
408413
409414 dest_context -> drawimage (t_image, 0 , 0 , linewidth, MCmagnification, 0 , dy);
410415
411416 dy += MCmagnification;
412417 yoffset += t_magimage->stride ;
418+
419+ MCGImageRelease (t_line_img);
413420 }
414421
415422 MCImageFreeBitmap (t_line);
0 commit comments