VirtualBox

Changeset 15868 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 8, 2009 2:38:28 PM (16 years ago)
Author:
vboxsync
Message:

VBoxSDL framebuffer resize optimization (xTracker #3487).

Location:
trunk/src/VBox/Frontends/VBoxSDL
Files:
2 edited

Legend:

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

    r12449 r15868  
    116116    mBitsPerPixel   = 0;
    117117    mBytesPerLine   = 0;
     118    mfSameSizeRequested = false;
    118119#ifdef VBOX_SECURELABEL
    119120    mLabelFont      = NULL;
     
    477478    }
    478479
     480    /*
     481     * Optimize the case when the guest has changed only the VRAM ptr
     482     * and the framebuffer uses the guest VRAM as the source bitmap.
     483     */
     484    if (   mGuestXRes    == w
     485        && mGuestYRes    == h
     486        && mPixelFormat  == pixelFormat
     487        && mBitsPerPixel == bitsPerPixel
     488        && mBytesPerLine == bytesPerLine
     489        && mUsesGuestVRAM
     490       )
     491    {
     492        mfSameSizeRequested = true;
     493    }
     494    else
     495    {
     496        mfSameSizeRequested = false;
     497    }
     498
    479499    mGuestXRes   = w;
    480500    mGuestYRes   = h;
     
    702722    }
    703723    LogFlow(("VBoxSDL:: created VRAM surface %p\n", mSurfVRAM));
     724
     725    if (mfSameSizeRequested && mUsesGuestVRAM)
     726    {
     727        /*
     728         * Same size has been requested and the framebuffer still uses the guest VRAM.
     729         * Reset the condition and return.
     730         */
     731        mfSameSizeRequested = false;
     732        LogFlow(("VBoxSDL:: the same resolution requested, skipping the resize.\n"));
     733        return;
     734    }
    704735
    705736    /* now adjust the SDL resolution */
  • trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.h

    r12449 r15868  
    204204    ULONG mPixelFormat;
    205205    BOOL mUsesGuestVRAM;
     206    BOOL mfSameSizeRequested;
    206207
    207208    /** the application Icon */
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