VirtualBox

Changeset 47082 in vbox


Ignore:
Timestamp:
Jul 10, 2013 2:53:52 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Quartz2D frame-buffer: Seamless mode: Paint-region redraw optimization.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBufferQuartz2D.cpp

    r47081 r47082  
    306306        if (pRgnRcts && pRgnRcts->used > 0)
    307307        {
    308             /* Create a subimage of the current view.
    309              * Currently this subimage is the whole screen. */
     308            /* Create a subimage of the current view in the size
     309             * of the bounding box of the current paint event: */
     310            CGRect cgPaintRect = ::darwinToCGRect(aEvent->rect());
    310311            CGImageRef subImage;
    311312            if (!m_pMachineView->pauseShot().isNull())
    312313            {
    313314                CGImageRef pauseImg = ::darwinToCGImageRef(&m_pMachineView->pauseShot());
    314                 subImage = CGImageCreateWithImageInRect(pauseImg, CGRectMake(m_pMachineView->contentsX(), m_pMachineView->contentsY(), m_pMachineView->visibleWidth(), m_pMachineView->visibleHeight()));
     315                subImage = CGImageCreateWithImageInRect(pauseImg, cgPaintRect);
    315316                CGImageRelease(pauseImg);
    316317            }
     
    322323                 * using CGImageCreateWithImageInRect without making a copy. We saw
    323324                 * something like this already with the scale mode. */
    324                 CGImageRef tmpImage = CGImageCreateWithImageInRect(m_image, CGRectMake(m_pMachineView->contentsX(), m_pMachineView->contentsY(), m_pMachineView->visibleWidth(), m_pMachineView->visibleHeight()));
     325                CGImageRef tmpImage = CGImageCreateWithImageInRect(m_image, cgPaintRect);
    325326                subImage = CGImageCreateCopy(tmpImage);
    326327                CGImageRelease(tmpImage);
     
    334335            CGContextClipToRect(ctx, viewRect);
    335336            /* At this point draw the real vm image: */
    336             CGContextDrawImage(ctx, ::darwinFlipCGRect(viewRect, viewRect.size.height), subImage);
     337            CGContextDrawImage(ctx, ::darwinFlipCGRect(cgPaintRect, viewRect.size.height), subImage);
    337338
    338339            /* Release the subimage: */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette