VirtualBox

Changeset 51606 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jun 11, 2014 2:54:11 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
94341
Message:

Main,Frontends: IFramebuffer::NotifyUpdateImage

Location:
trunk/src/VBox/Frontends
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp

    r51605 r51606  
    1818
    1919#include <VBox/com/com.h>
     20#include <VBox/com/array.h>
    2021#include <VBox/com/string.h>
    2122#include <VBox/com/Guid.h>
     
    419420}
    420421
     422STDMETHODIMP VBoxSDLFB::NotifyUpdateImage(ULONG aX,
     423                                          ULONG aY,
     424                                          ULONG aWidth,
     425                                          ULONG aHeight,
     426                                          ComSafeArrayIn(BYTE, aImage))
     427{
     428    LogFlow(("NotifyUpdateImage: %d,%d %dx%d\n", aX, aY, aWidth, aHeight));
     429
     430    com::SafeArray<BYTE> image(ComSafeArrayInArg(aImage));
     431
     432    /* Copy to mSurfVRAM. */
     433    SDL_Rect srcRect;
     434    SDL_Rect dstRect;
     435    srcRect.x = 0;
     436    srcRect.y = 0;
     437    srcRect.w = (uint16_t)aWidth;
     438    srcRect.h = (uint16_t)aHeight;
     439    dstRect.x = (int16_t)aX;
     440    dstRect.y = (int16_t)aY;
     441    dstRect.w = (uint16_t)aWidth;
     442    dstRect.h = (uint16_t)aHeight;
     443
     444    const uint32_t Rmask = 0x00FF0000, Gmask = 0x0000FF00, Bmask = 0x000000FF, Amask = 0;
     445    SDL_Surface *surfSrc = SDL_CreateRGBSurfaceFrom(image.raw(), aWidth, aHeight, 32, aWidth * 4,
     446                                                    Rmask, Gmask, Bmask, Amask);
     447    if (surfSrc)
     448    {
     449        SDL_BlitSurface(surfSrc, &srcRect, mSurfVRAM, &dstRect);
     450        SDL_FreeSurface(surfSrc);
     451    }
     452
     453    return NotifyUpdate(aX, aY, aWidth, aHeight);
     454}
     455
    421456extern ComPtr<IDisplay> gpDisplay;
    422457
     
    434469    /* Disable screen updates. */
    435470    mfUpdates = false;
     471
     472    // gpDisplay->COMSETTER(FramebufferUpdateMode)(FramebufferUpdateMode_NotifyUpdateImage);
    436473
    437474    /* Save the new bitmap. */
  • trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.h

    r51605 r51606  
    8282
    8383    STDMETHOD(NotifyUpdate)(ULONG x, ULONG y, ULONG w, ULONG h);
     84    STDMETHOD(NotifyUpdateImage)(ULONG x, ULONG y, ULONG w, ULONG h, ComSafeArrayIn(BYTE, aImage));
    8485    STDMETHOD(NotifyChange)(ULONG aScreenId,
    8586                            ULONG aXOrigin,
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp

    r51605 r51606  
    263263}
    264264
     265STDMETHODIMP UIFrameBuffer::NotifyUpdateImage(ULONG aX,
     266                                              ULONG aY,
     267                                              ULONG aWidth,
     268                                              ULONG aHeight,
     269                                              ComSafeArrayIn(BYTE, aImage))
     270{
     271    return E_NOTIMPL;
     272}
     273
    265274STDMETHODIMP UIFrameBuffer::VideoModeSupported(ULONG uWidth, ULONG uHeight, ULONG uBPP, BOOL *pfSupported)
    266275{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h

    r51605 r51606  
    127127      * @note         Calls to this and #setMarkAsUnused method are synchronized (from GUI side). */
    128128    STDMETHOD(NotifyUpdate)(ULONG uX, ULONG uY, ULONG uWidth, ULONG uHeight);
     129    STDMETHOD(NotifyUpdateImage)(ULONG x, ULONG y, ULONG w, ULONG h, ComSafeArrayIn(BYTE, aImage));
    129130
    130131    /** EMT callback: Returns whether the frame-buffer implementation is willing to support a given video-mode.
Note: See TracChangeset for help on using the changeset viewer.

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