VirtualBox

Changeset 3761 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jul 22, 2007 10:43:14 AM (17 years ago)
Author:
vboxsync
Message:

Main/Frontends: Cleaned up IFramebuffer interface.

Location:
trunk/src/VBox/Main
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ConsoleVRDPServer.cpp

    r3720 r3761  
    633633
    634634        ULONG bitsPerPixel = 0;
    635         pfb->COMGETTER(ColorDepth) (&bitsPerPixel);
     635        pfb->COMGETTER(BitsPerPixel) (&bitsPerPixel);
    636636
    637637        BYTE *address = NULL;
  • trunk/src/VBox/Main/DisplayImpl.cpp

    r3681 r3761  
    8686
    8787    mLastAddress = NULL;
    88     mLastLineSize = 0;
    89     mLastColorDepth = 0,
     88    mLastBytesPerLine = 0;
     89    mLastBitsPerPixel = 0,
    9090    mLastWidth = 0;
    9191    mLastHeight = 0;
     
    222222 *  @thread EMT
    223223 */
    224 static int callFramebufferResize (IFramebuffer *pFramebuffer, unsigned uScreenId, FramebufferPixelFormat_T pixelFormat, void *pvVRAM, uint32_t cbLine, int w, int h)
     224static int callFramebufferResize (IFramebuffer *pFramebuffer, unsigned uScreenId,
     225                                  ULONG pixelFormat, void *pvVRAM,
     226                                  uint32_t bpp, uint32_t cbLine,
     227                                  int w, int h)
    225228{
    226229    Assert (pFramebuffer);
     
    229232    BOOL finished = TRUE;
    230233
    231     pFramebuffer->RequestResize (uScreenId, pixelFormat, (BYTE *) pvVRAM, cbLine, w, h, &finished);
     234    pFramebuffer->RequestResize (uScreenId, pixelFormat, (BYTE *) pvVRAM,
     235                                 bpp, cbLine, w, h, &finished);
    232236
    233237    if (!finished)
     
    252256 *  @thread EMT
    253257 */
    254 int Display::handleDisplayResize (unsigned uScreenId, uint32_t bpp, void *pvVRAM, uint32_t cbLine, int w, int h)
    255 {
    256     LogRel (("Display::handleDisplayResize(): uScreenId = %d, pvVRAM=%p w=%d h=%d bpp=%d cbLine=0x%X\n",
     258int Display::handleDisplayResize (unsigned uScreenId, uint32_t bpp, void *pvVRAM,
     259                                  uint32_t cbLine, int w, int h)
     260{
     261    LogRel (("Display::handleDisplayResize(): uScreenId = %d, pvVRAM=%p "
     262             "w=%d h=%d bpp=%d cbLine=0x%X\n",
    257263             uScreenId, pvVRAM, w, h, bpp, cbLine));
    258264
     
    265271
    266272    mLastAddress = pvVRAM;
    267     mLastLineSize = cbLine;
    268     mLastColorDepth = bpp,
     273    mLastBytesPerLine = cbLine;
     274    mLastBitsPerPixel = bpp,
    269275    mLastWidth = w;
    270276    mLastHeight = h;
    271277
    272     FramebufferPixelFormat_T pixelFormat;
     278    ULONG pixelFormat;
    273279
    274280    switch (bpp)
    275281    {
    276         case 32:  pixelFormat = FramebufferPixelFormat_PixelFormatRGB32; break;
    277         case 24:  pixelFormat = FramebufferPixelFormat_PixelFormatRGB24; break;
    278         case 16:  pixelFormat = FramebufferPixelFormat_PixelFormatRGB16; break;
    279         default:  pixelFormat = FramebufferPixelFormat_PixelFormatOpaque; cbLine = 0;
     282        case 32:
     283        case 24:
     284        case 16:
     285            pixelFormat = FramebufferPixelFormat_FOURCC_RGB;
     286            break;
     287        default:
     288            pixelFormat = FramebufferPixelFormat_PixelFormatOpaque;
     289            bpp = cbLine = 0;
     290            break;
    280291    }
    281292
     
    283294     * disable access to the VGA device by the EMT thread.
    284295     */
    285     bool f = ASMAtomicCmpXchgU32 (&maFramebuffers[uScreenId].u32ResizeStatus, ResizeStatus_InProgress, ResizeStatus_Void);
     296    bool f = ASMAtomicCmpXchgU32 (&maFramebuffers[uScreenId].u32ResizeStatus,
     297                                  ResizeStatus_InProgress, ResizeStatus_Void);
    286298    AssertReleaseMsg(f, ("f = %d\n", f));NOREF(f);
    287299
     
    291303    maFramebuffers[uScreenId].pFramebuffer->Lock();
    292304
    293     int rc = callFramebufferResize (maFramebuffers[uScreenId].pFramebuffer, uScreenId, pixelFormat, pvVRAM, cbLine, w, h);
     305    int rc = callFramebufferResize (maFramebuffers[uScreenId].pFramebuffer, uScreenId,
     306                                    pixelFormat, pvVRAM, bpp, cbLine, w, h);
    294307    if (rc == VINF_VGA_RESIZE_IN_PROGRESS)
    295308    {
     
    303316
    304317    /* Set the status so the 'handleResizeCompleted' would work.  */
    305     f = ASMAtomicCmpXchgU32 (&maFramebuffers[uScreenId].u32ResizeStatus, ResizeStatus_UpdateDisplayData, ResizeStatus_InProgress);
     318    f = ASMAtomicCmpXchgU32 (&maFramebuffers[uScreenId].u32ResizeStatus,
     319                             ResizeStatus_UpdateDisplayData, ResizeStatus_InProgress);
    306320    AssertRelease(f);NOREF(f);
    307321
     
    342356   
    343357            /* Check the framebuffer pixel format to setup the rendering in VGA device. */
    344             FramebufferPixelFormat_T newPixelFormat;
    345             pFBInfo->pFramebuffer->COMGETTER(PixelFormat) (&newPixelFormat);
    346 
    347             pFBInfo->fDefaultFormat = (newPixelFormat == FramebufferPixelFormat_PixelFormatOpaque);
     358            BOOL usesGuestVRAM = FALSE;
     359            pFBInfo->pFramebuffer->COMGETTER(UsesGuestVRAM) (&usesGuestVRAM);
     360
     361            pFBInfo->fDefaultFormat = (usesGuestVRAM == FALSE);
    348362
    349363            mpDrv->pUpPort->pfnSetRenderVRAM (mpDrv->pUpPort, pFBInfo->fDefaultFormat);
     
    12651279 *
    12661280 * @returns COM status code
    1267  * @param colorDepth Address of result variable.
    1268  */
    1269 STDMETHODIMP Display::COMGETTER(ColorDepth) (ULONG *colorDepth)
    1270 {
    1271     if (!colorDepth)
     1281 * @param bitsPerPixel Address of result variable.
     1282 */
     1283STDMETHODIMP Display::COMGETTER(BitsPerPixel) (ULONG *bitsPerPixel)
     1284{
     1285    if (!bitsPerPixel)
    12721286        return E_INVALIDARG;
    12731287
     
    12801294    int rc = mpDrv->pUpPort->pfnQueryColorDepth(mpDrv->pUpPort, &cBits);
    12811295    AssertRC(rc);
    1282     *colorDepth = cBits;
     1296    *bitsPerPixel = cBits;
    12831297    return S_OK;
    12841298}
     
    14811495}
    14821496
    1483 STDMETHODIMP Display::SetVideoModeHint(ULONG aWidth, ULONG aHeight, ULONG aColorDepth, ULONG aDisplay)
     1497STDMETHODIMP Display::SetVideoModeHint(ULONG aWidth, ULONG aHeight, ULONG aBitsPerPixel, ULONG aDisplay)
    14841498{
    14851499    AutoLock lock(this);
     
    14971511    if (!height)
    14981512        height   = mpDrv->Connector.cy;
    1499     ULONG bpp    = aColorDepth;
     1513    ULONG bpp    = aBitsPerPixel;
    15001514    if (!bpp)
    15011515    {
     
    15221536    lock.leave ();
    15231537    if (mParent->getVMMDev())
    1524         mParent->getVMMDev()->getVMMDevPort()->pfnRequestDisplayChange(mParent->getVMMDev()->getVMMDevPort(), aWidth, aHeight, aColorDepth, aDisplay);
     1538        mParent->getVMMDev()->getVMMDevPort()->pfnRequestDisplayChange(mParent->getVMMDev()->getVMMDevPort(), aWidth, aHeight, aBitsPerPixel, aDisplay);
    15251539    return S_OK;
    15261540}
     
    18051819        rc = pFramebuffer->COMGETTER(Address) (&address);
    18061820        AssertComRC (rc);
    1807         ULONG lineSize = 0;
    1808         rc = pFramebuffer->COMGETTER(LineSize) (&lineSize);
     1821        ULONG bytesPerLine = 0;
     1822        rc = pFramebuffer->COMGETTER(BytesPerLine) (&bytesPerLine);
    18091823        AssertComRC (rc);
    1810         ULONG colorDepth = 0;
    1811         rc = pFramebuffer->COMGETTER(ColorDepth) (&colorDepth);
     1824        ULONG bitsPerPixel = 0;
     1825        rc = pFramebuffer->COMGETTER(BitsPerPixel) (&bitsPerPixel);
    18121826        AssertComRC (rc);
    18131827        ULONG width = 0;
     
    18261840        if (aCheckParams &&
    18271841            (mLastAddress != address ||
    1828              mLastLineSize != lineSize ||
    1829              mLastColorDepth != colorDepth ||
     1842             mLastBytesPerLine != bytesPerLine ||
     1843             mLastBitsPerPixel != bitsPerPixel ||
    18301844             mLastWidth != (int) width ||
    18311845             mLastHeight != (int) height))
    18321846        {
    1833             handleDisplayResize (VBOX_VIDEO_PRIMARY_SCREEN, mLastColorDepth,
     1847            handleDisplayResize (VBOX_VIDEO_PRIMARY_SCREEN, mLastBitsPerPixel,
    18341848                                 mLastAddress,
    1835                                  mLastLineSize,
     1849                                 mLastBytesPerLine,
    18361850                                 mLastWidth,
    18371851                                 mLastHeight);
     
    18401854
    18411855        mpDrv->Connector.pu8Data = (uint8_t *) address;
    1842         mpDrv->Connector.cbScanline = lineSize;
    1843         mpDrv->Connector.cBits = colorDepth;
     1856        mpDrv->Connector.cbScanline = bytesPerLine;
     1857        mpDrv->Connector.cBits = bitsPerPixel;
    18441858        mpDrv->Connector.cx = width;
    18451859        mpDrv->Connector.cy = height;
     
    23352349        pData->pDisplay->mpVMMDev = NULL;
    23362350        pData->pDisplay->mLastAddress = NULL;
    2337         pData->pDisplay->mLastLineSize = 0;
    2338         pData->pDisplay->mLastColorDepth = 0,
     2351        pData->pDisplay->mLastBytesPerLine = 0;
     2352        pData->pDisplay->mLastBitsPerPixel = 0,
    23392353        pData->pDisplay->mLastWidth = 0;
    23402354        pData->pDisplay->mLastHeight = 0;
  • trunk/src/VBox/Main/FramebufferImpl.cpp

    r3611 r3761  
    4646    mWidth = width;
    4747    mHeight = height;
    48     mDepth = depth;
    49     mLineSize = ((width * depth + 31) / 32) * 4;
    50     mData = new uint8_t[mLineSize * height];
    51     memset(mData, 0, mLineSize * height);
     48    mBitsPerPixel = depth;
     49    mBytesPerLine = ((width * depth + 31) / 32) * 4;
     50    mData = new uint8_t [mBytesPerLine * height];
     51    memset (mData, 0, mBytesPerLine * height);
    5252
    5353    return S_OK;
     
    8181}
    8282
    83 STDMETHODIMP InternalFramebuffer::COMGETTER(ColorDepth) (ULONG *colorDepth)
    84 {
    85     if (!colorDepth)
    86         return E_POINTER;
    87     *colorDepth = mDepth;
    88     return S_OK;
    89 }
    90 
    91 STDMETHODIMP InternalFramebuffer::COMGETTER(LineSize) (ULONG *lineSize)
    92 {
    93     if (!lineSize)
    94         return E_POINTER;
    95     *lineSize = mLineSize;
    96     return S_OK;
    97 }
    98 
    99 STDMETHODIMP InternalFramebuffer::COMGETTER(PixelFormat) (FramebufferPixelFormat_T *pixelFormat)
     83STDMETHODIMP InternalFramebuffer::COMGETTER(BitsPerPixel) (ULONG *bitsPerPixel)
     84{
     85    if (!bitsPerPixel)
     86        return E_POINTER;
     87    *bitsPerPixel = mBitsPerPixel;
     88    return S_OK;
     89}
     90
     91STDMETHODIMP InternalFramebuffer::COMGETTER(BytesPerLine) (ULONG *bytesPerLine)
     92{
     93    if (!bytesPerLine)
     94        return E_POINTER;
     95    *bytesPerLine = mBytesPerLine;
     96    return S_OK;
     97}
     98
     99STDMETHODIMP InternalFramebuffer::COMGETTER(PixelFormat) (ULONG *pixelFormat)
    100100{
    101101    if (!pixelFormat)
    102102        return E_POINTER;
    103     *pixelFormat = FramebufferPixelFormat_PixelFormatOpaque;
     103    *pixelFormat = FramebufferPixelFormat_FOURCC_RGB;
     104    return S_OK;
     105}
     106
     107STDMETHODIMP InternalFramebuffer::COMGETTER(UsesGuestVRAM) (BOOL *usesGuestVRAM)
     108{
     109    if (!usesGuestVRAM)
     110        return E_POINTER;
     111    *usesGuestVRAM = FALSE;
    104112    return S_OK;
    105113}
     
    151159
    152160STDMETHODIMP
    153 InternalFramebuffer::RequestResize(ULONG iScreenId, FramebufferPixelFormat_T pixelFormat, BYTE *vram,
    154                                    ULONG lineSize, ULONG w, ULONG h,
     161InternalFramebuffer::RequestResize(ULONG iScreenId, ULONG pixelFormat, BYTE *vram,
     162                                   ULONG bpp, ULONG bpl, ULONG w, ULONG h,
    155163                                   BOOL *finished)
    156164{
     165    NOREF (bpp);
     166    NOREF (bpl);
     167
    157168    if (!finished)
    158169        return E_POINTER;
     
    164175    mWidth = w;
    165176    mHeight = h;
    166     mLineSize = ((w * mDepth + 31) / 32) * 4;
    167     mData = new uint8_t[mLineSize * h];
    168     memset(mData, 0, mLineSize * h);
     177    mBytesPerLine = ((w * mBitsPerPixel + 31) / 32) * 4;
     178    mData = new uint8_t [mBytesPerLine * h];
     179    memset (mData, 0, mBytesPerLine * h);
    169180
    170181    return S_OK;
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r3652 r3761  
    32863286        refuses to release it for some reason.
    32873287
    3288         <see>IUSBController::DeviceFilters, USBDeviceState</see>
     3288        <see>IUSBController::deviceFilters, USBDeviceState</see>
    32893289      </desc>
    32903290      <param name="id" type="uuid" dir="in">
     
    33033303        a possible automatic reattachment.
    33043304
    3305         <see>IUSBController::DeviceFilters, USBDeviceState</see>
     3305        <see>IUSBController::deviceFilters, USBDeviceState</see>
    33063306      </desc>
    33073307      <param name="id" type="uuid" dir="in">
     
    37773777        Unless the device is ignored by these filters, filters of all
    37783778        currently running virtual machines
    3779         (<link to="IUSBController::DeviceFilters"/>) are applied to it.
     3779        (<link to="IUSBController::deviceFilters"/>) are applied to it.
    37803780
    37813781        <see>IHostUSBDeviceFilter, USBDeviceState</see>
     
    61426142  <enum
    61436143     name="FramebufferPixelFormat"
    6144      uuid="3bd87520-2b5f-4786-a891-f8c6aeb19a1f"
     6144     uuid="6b27d1fc-4f2c-4e9c-a166-01d06540305d"
    61456145     >
    61466146    <desc>
    6147       Format of the virtual video card's memory buffer.  See
    6148       <link to="IFramebuffer::requestResize()"/> for more information.
     6147      Format of the video memory buffer. Constants represented by this enum can
     6148      be used to test for particular values of <link
     6149      to="IFramebuffer::pixelFormat"/>. See also <link
     6150      to="IFramebuffer::requestResize()"/>.
     6151
     6152      See also www.fourcc.org for more informantion about FOURCC pixel formats.
    61496153    </desc>
    6150     <const name="PixelFormatOpaque"       value="0"/>
    6151     <const name="PixelFormatRGB16"        value="1"/>
    6152     <const name="PixelFormatRGB24"        value="2"/>
    6153     <const name="PixelFormatRGB32"        value="3"/>
     6154    <const name="PixelFormatOpaque"       value="0xFFFFFFFF">
     6155      <desc>
     6156        Unknown buffer format. The user may not assume any particular
     6157        format of the buffer.
     6158      </desc>
     6159    </const>
     6160    <const name="FOURCC_RGB"              value="0x32424752">
     6161      <desc>
     6162        Basic RGB format. <link to="IFramebuffer::bitsPerPixel"/> determines
     6163        the bit layout.
     6164      </desc>
     6165    </const>
    61546166  </enum>
    61556167
    61566168  <interface
    61576169     name="IFramebuffer" extends="$unknown"
    6158      uuid="450058a4-fef0-4987-81c2-7b89bfc2242f"
     6170     uuid="af431304-5b09-40e2-94da-3c3cb03822c1"
    61596171     wsmap="suppress"
    61606172     >
     
    61646176
    61656177    <attribute name="width" type="unsigned long" readonly="yes">
    6166       <desc>Framebuffer width.</desc>
     6178      <desc>Framebuffer width, in pixels.</desc>
    61676179    </attribute>
    61686180
    61696181    <attribute name="height" type="unsigned long" readonly="yes">
    6170       <desc>Framebuffer height.</desc>
    6171     </attribute>
    6172 
    6173     <attribute name="colorDepth" type="unsigned long" readonly="yes">
    6174       <desc>Framebuffer color depth.</desc>
    6175     </attribute>
    6176 
    6177     <attribute name="lineSize" type="unsigned long" readonly="yes">
    6178       <desc>framebuffer scan line size in bytes.</desc>
    6179     </attribute>
    6180 
    6181     <attribute name="pixelFormat" type="FramebufferPixelFormat" readonly="yes">
    6182       <desc>Framebuffer pixel format.</desc>
     6182      <desc>Framebuffer height, in pixels.</desc>
     6183    </attribute>
     6184
     6185    <attribute name="bitsPerPixel" type="unsigned long" readonly="yes">
     6186      <desc>
     6187        Color depth, in bits per pixel. When <link to="#pixelFormat"/> is <link
     6188        to="FramebufferPixelFormat::FOURCC_RGB">FOURCC_RGB</link>, valid values
     6189        are: 8, 15, 16, 24 and 32.
     6190      </desc>
     6191    </attribute>
     6192
     6193    <attribute name="bytesPerLine" type="unsigned long" readonly="yes">
     6194      <desc>
     6195        Scan line size, in bytes. When <link to="#pixelFormat"/> is <link
     6196        to="FramebufferPixelFormat::FOURCC_RGB">FOURCC_RGB</link>, the
     6197        size of the scan line must be aligned to 32 bits.
     6198      </desc>
     6199    </attribute>
     6200
     6201    <attribute name="pixelFormat" type="unsigned long" readonly="yes">
     6202      <desc>
     6203        Framebuffer pixel format. It's either one of the values defined by <link
     6204        to="FramebufferPixelFormat"/> or a raw FOURCC code.
     6205        <note>
     6206          This attribute must never return <link
     6207          to="PixelFormat::PixelFormatOpaque"/> -- the format of the buffer
     6208          <link to="#address"/> points to must be always known.
     6209        </note>
     6210      </desc>
     6211    </attribute>
     6212
     6213    <attribute name="usesGuestVRAM" type="boolean" readonly="yes">
     6214      <desc>
     6215        Defines whether this framebuffer uses the virtual video card's memory
     6216        buffer (guest VRAM) directly or not. See <link
     6217        to="IFramebuffer::requestResize()"/> for more information.
     6218      </desc>
    61836219    </attribute>
    61846220
     
    62416277        Requests a size and pixel format change.
    62426278
    6243         There are two strategies of working with the video buffer of the
    6244         virtual machine. The first strategy implies that the IFramebuffer
     6279        There are two modes of working with the video buffer of the virtual
     6280        machine. The <i>indirect</i> mode implies that the IFramebuffer
    62456281        implementation allocates a memory buffer for the requested display mode
    6246         and provides it to the virtual machine. In the second strategy, the
     6282        and provides it to the virtual machine. In <i>direct</i> mode, the
    62476283        IFramebuffer implementation uses the memory buffer allocated and owned
    6248         by the virtual machine. The second strategy is usually faster because
    6249         the implementation gets a pointer to the virtual machine video card's
    6250         memory which it can directly use for visualising the contents of the
    6251         virtual display, as opposed to the first strategy where the video
    6252         card's memory contents are copied to the memory buffer provided by the
    6253         implementation every time a display update occurs.
    6254 
    6255         It is important to note that the second strategy is really fast only
    6256         when the implementation uses the provided video buffer directly, for
    6257         example, by blitting it to the window representing the virtual
    6258         machine's display, which saves at least one copy operation comparing
    6259         to the first strategy. However, using the video card's memory directly
    6260         is not always possible: for example, the format and the color depth of
    6261         the window representing the virtual display may differ from the format
    6262         or the color depth of the virtual video buffer, or the format of the
    6263         latter may be unknown or unsupported. In this case, the first strategy
    6264         (that is always available) is used as a fallback: when the virtual
    6265         video card's memory contents are copied to the implementation-provided
    6266         memory buffer, color and format conversion is done authomatically by
    6267         the underlying code.
    6268 
    6269         The @a pixelFormat and @a VRAM parameters define whether the second
    6270         strategy is available or not. If @a pixelFormat is
    6271         <link to="PixelFormat::PixelFormatOpaque"/> (which usually indicates a
    6272         text mode of the virtual display) or if @a VRAM is <tt>null</tt>
    6273         (which means a non-linear graphical mode), then direct access to the
    6274         virtual card's video memory buffer is not available, the @a VRAM
    6275         parameter must be ignored and the implementation must use the first
    6276         strategy. In all other cases, @a pixelFormat together with @a lineSize
    6277         define the format of the video memory buffer pointed to by the @a VRAM
    6278         parameter and the implementation is free to choose which strategy to
    6279         use. To indicate that this framebuffer uses the second strategy, its
    6280         implementation of the <link to="#address()"/> method must return the
    6281         same address as it gets in the @a VRAM parameter of this method;
    6282         otherwise it is assumed that the first strategy is chosen.
     6284        by the virtual machine. The direct mode is usually faster because the
     6285        implementation gets a pointer to the virtual machine video card's memory
     6286        which it can directly use for visualising the contents of the virtual
     6287        display, as opposed to the indirect mode where the video card's memory
     6288        contents are copied to the memory buffer provided by the implementation
     6289        every time a display update occurs.
     6290
     6291        It is important to note that the direct mode is really fast only when
     6292        the implementation uses the provided video buffer directly, for example,
     6293        by blitting it to the window representing the virtual machine's display,
     6294        which saves at least one copy operation comparing to the indirect mode.
     6295        However, using the video card's memory directly is not always possible:
     6296        for example, the format and the color depth of the window representing
     6297        the virtual display may differ from the format or the color depth of the
     6298        virtual video buffer, or the format of the latter may be unknown or
     6299        unsupported. In this case, the indirect mode (that is always available)
     6300        should be used as a fallback: when the virtual video card's memory
     6301        contents are copied to the implementation-provided memory buffer, color
     6302        and format conversion is done authomatically by the underlying code.
     6303
     6304        The @a pixelFormat parameter defines whether the direct mode is
     6305        available or not. If @a pixelFormat is <link
     6306        to="PixelFormat::PixelFormatOpaque"/> (which usually indicates either a
     6307        text or a non-linear graphics mode of the virtual display), then direct
     6308        access to the virtual card's video memory buffer is not available, the
     6309        @a VRAM, @a bitsPerPixel and @a bytesPerLine parameters must be ingored
     6310        and the implementation must use the indirect mode when it will provide
     6311        its own values for the pixel format, color depth and scan line size. In
     6312        all other cases, @a pixelFormat together with @a bitsPerPixel and @a
     6313        bytesPerLine define the format of the video memory buffer pointed to by
     6314        the @a VRAM parameter and the implementation is free to choose which
     6315        mode to use. To indicate that this framebuffer uses the direct mode, the
     6316        implementation of the <link to="#usesGuestVRAM"/> attribute must
     6317        return <tt>true</tt> and <link to="#address"/> must return exactly the
     6318        same address that is passed in the @a VRAM parameter of this method;
     6319        otherwise it is assumed that the indirect strategy is chosen.
    62836320
    62846321        The @a width and @a height parameters represent the size of the
    6285         requested display mode in both cases. In case of the first strategy,
    6286         the provided memory buffer should be enough to store data of the given
    6287         display mode. In case of the second strategy, it is guaranteed that
    6288         the given @a VRAM buffer contains enough space to represent the
    6289         display mode of the given size. Note that this framebuffer's
    6290         <link to="#width()"/> and <link to="#height()"/> properties must
    6291         return exactly the same values as passed to this method after the
    6292         resize is completed (see below).
     6322        requested display mode in both modes. In case of indirect mode, the
     6323        provided memory buffer should be big enough to store data of the given
     6324        display mode. In case of direct mode, it is guaranteed that the given @a
     6325        VRAM buffer contains enough space to represent the display mode of the
     6326        given size. Note that this framebuffer's <link to="#width"/> and <link
     6327        to="#height"/> attributes must return exactly the same values as
     6328        passed to this method after the resize is completed (see below).
    62936329
    62946330        The @a finished output parameter determines if the implementation has
     
    63016337        <link to="IDisplay::resizeCompleted()"/> is called.
    63026338
    6303         Note that if the second strategy is choosen, the
    6304         <link to="#colorDepth()"/>, <link to="#lineSize()"/> and
    6305         <link to="#pixelFormat()"/> properties of this framebuffer must return
    6306         exactly the same values as specified in the parameters of this method
    6307         after the resize is completed. In case of the first strategy these
    6308         properties must return values describing the format of the
    6309         implementation's own memory buffer <link to="#address()"/> points
    6310         to. Note also that the <link to="#colorDepth()"/> value must always
    6311         correlate with <link to="#pixelFormat()"/> when the latter returns any
    6312         value other than <link to="PixelFormat::PixelFormatOpaque"/>.
     6339        Note that if the direct mode is chosen, the <link to="#bitsPerPixel"/>,
     6340        <link to="#bytesPerLine"/> and <link to="#pixelFormat"/> attributes of
     6341        this framebuffer must return exactly the same values as specified in the
     6342        parameters of this method, after the resize is completed. If the
     6343        indirect mode is chosen, these attributes must return values describing
     6344        the format of the implementation's own memory buffer <link
     6345        to="#address"/> points to. Note also that the <link to="#bitsPerPixel"/>
     6346        value must always correlate with <link to="#pixelFormat"/>. Note that
     6347        the <link to="#pixelFormat"/> attribute must never return <link
     6348        to="PixelFormat::PixelFormatOpaque"/> regardless of the selected mode.
    63136349
    63146350        <note>
     
    63266362        </desc>
    63276363      </param>
    6328       <param name="pixelFormat" type="FramebufferPixelFormat" dir="in">
    6329         <desc>Pixel format of the memory buffer pointed to by @a VRAM.</desc>
     6364      <param name="pixelFormat" type="unsigned long" dir="in">
     6365        <desc>
     6366          Pixel format of the memory buffer pointed to by @a VRAM.
     6367          See also <link to="FramebufferPixelFormat"/>.
     6368        </desc>
    63306369      </param>
    63316370      <param name="VRAM" type="octet" mod="ptr" dir="in">
    63326371        <desc>Pointer to the virtual video card's VRAM (may be @c null).</desc>
    63336372      </param>
    6334       <param name="lineSize" type="unsigned long" dir="in">
     6373      <param name="bitsPerPixel" type="unsigned long" dir="in">
     6374        <desc>Color depth, bits per pixel.</desc>
     6375      </param>
     6376      <param name="bytesPerLine" type="unsigned long" dir="in">
    63356377        <desc>Size of one scan line, in bytes.</desc>
    63366378      </param>
     
    65126554  <interface
    65136555     name="IDisplay" extends="$unknown"
    6514      uuid="e740a435-88d1-4f14-b9ca-a1b30e2c5038"
     6556     uuid="010b00f4-9223-4545-9db3-866809da94a0"
    65156557     wsmap="suppress"
    65166558     >
     
    65236565    </attribute>
    65246566
    6525     <attribute name="colorDepth" type="unsigned long" readonly="yes">
     6567    <attribute name="bitsPerPixel" type="unsigned long" readonly="yes">
    65266568      <desc>
    65276569        Current guest display color depth. Note that this may differ
    6528         from <link to="IFramebuffer::colorDepth">IFramebuffer::colorDepth</link>.
     6570        from <link to="IFramebuffer::bitsPerPixel"/>.
    65296571      </desc>
    65306572    </attribute>
     
    65916633      <param name="width" type="unsigned long" dir="in"/>
    65926634      <param name="height" type="unsigned long" dir="in"/>
    6593       <param name="colorDepth" type="unsigned long" dir="in"/>
     6635      <param name="bitsPerPixel" type="unsigned long" dir="in"/>
    65946636      <param name="display" type="unsigned long" dir="in"/>
    65956637    </method>
     
    70117053        <link to="#insertDeviceFilter()"/>.
    70127054
    7013         <see>#DeviceFilters</see>
     7055        <see>#deviceFilters</see>
    70147056      </desc>
    70157057      <param name="name" type="wstring" dir="in">
     
    70397081        </note>
    70407082
    7041         <see>#DeviceFilters</see>
     7083        <see>#deviceFilters</see>
    70427084      </desc>
    70437085      <param name="position" type="unsigned long" dir="in">
     
    70587100        the list will produce an error.
    70597101
    7060         <see>#DeviceFilters</see>
     7102        <see>#deviceFilters</see>
    70617103      </desc>
    70627104      <param name="position" type="unsigned long" dir="in">
     
    72817323      </note>
    72827324
    7283       <see>IUSBController::DeviceFilters, IHostUSBDeviceFilter</see>
     7325      <see>IUSBController::deviceFilters, IHostUSBDeviceFilter</see>
    72847326    </desc>
    72857327
     
    73857427      either ignore the device, or put ot to #USBDeviceHeld state, or do
    73867428      nothing. Unless the device is ignored by global filters, filters of
    7387       all currently running guests (<link to="IUSBController::DeviceFilters"/>)
     7429      all currently running guests (<link to="IUSBController::deviceFilters"/>)
    73887430      are activated that can put it to #USBDeviceCaptured state.
    73897431
     
    75747616        The <link to="#remote"/> attribute is ignored by this type of
    75757617        filters, because it makes sense only for
    7576         <link to="IUSBController::DeviceFilters">machine USB filters</link>.
     7618        <link to="IUSBController::deviceFilters">machine USB filters</link>.
    75777619      </note>
    75787620
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r3576 r3761  
    166166    STDMETHOD(COMGETTER(Width)) (ULONG *width);
    167167    STDMETHOD(COMGETTER(Height)) (ULONG *height);
    168     STDMETHOD(COMGETTER(ColorDepth)) (ULONG *colorDepth);
     168    STDMETHOD(COMGETTER(BitsPerPixel)) (ULONG *bitsPerPixel);
    169169
    170170    // IDisplay methods
     
    175175    STDMETHOD(SetFramebuffer)(ULONG aScreenId, IFramebuffer *aFramebuffer);
    176176    STDMETHOD(GetFramebuffer)(ULONG aScreenId, IFramebuffer **aFramebuffer, LONG *aXOrigin, LONG *aYOrigin);
    177     STDMETHOD(SetVideoModeHint)(ULONG width, ULONG height, ULONG colorDepth, ULONG display);
     177    STDMETHOD(SetVideoModeHint)(ULONG width, ULONG height, ULONG bitsPerPixel, ULONG display);
    178178    STDMETHOD(TakeScreenShot)(BYTE *address, ULONG width, ULONG height);
    179179    STDMETHOD(DrawToScreen)(BYTE *address, ULONG x, ULONG y, ULONG width, ULONG height);
     
    226226    /* arguments of the last handleDisplayResize() call */
    227227    void *mLastAddress;
    228     uint32_t mLastLineSize;
    229     uint32_t mLastColorDepth;
     228    uint32_t mLastBytesPerLine;
     229    uint32_t mLastBitsPerPixel;
    230230    int mLastWidth;
    231231    int mLastHeight;
  • trunk/src/VBox/Main/include/FramebufferImpl.h

    r3578 r3761  
    5151    STDMETHOD(COMGETTER(Width)) (ULONG *width);
    5252    STDMETHOD(COMGETTER(Height)) (ULONG *height);
    53     STDMETHOD(COMGETTER(ColorDepth)) (ULONG *colorDepth);
    54     STDMETHOD(COMGETTER(LineSize)) (ULONG *lineSize);
    55     STDMETHOD(COMGETTER(PixelFormat)) (FramebufferPixelFormat_T *pixelFormat);
     53    STDMETHOD(COMGETTER(BitsPerPixel)) (ULONG *bitsPerPixel);
     54    STDMETHOD(COMGETTER(BytesPerLine)) (ULONG *bytesPerLine);
     55    STDMETHOD(COMGETTER(PixelFormat)) (ULONG *pixelFormat);
     56    STDMETHOD(COMGETTER(UsesGuestVRAM)) (BOOL *usesGuestVRAM);
    5657    STDMETHOD(COMGETTER(HeightReduction)) (ULONG *heightReduction);
    5758    STDMETHOD(COMGETTER(Overlay)) (IFramebufferOverlay **aOverlay);
     
    6364                            ULONG w, ULONG h,
    6465                            BOOL *finished);
    65     STDMETHOD(RequestResize)(ULONG uScreenId, FramebufferPixelFormat_T pixelFormat, BYTE *vram,
    66                              ULONG lineSize, ULONG w, ULONG h,
     66    STDMETHOD(RequestResize)(ULONG uScreenId, ULONG pixelFormat, BYTE *vram,
     67                             ULONG bpp, ULONG bpl, ULONG w, ULONG h,
    6768                             BOOL *finished);
    6869    STDMETHOD(OperationSupported)(FramebufferAccelerationOperation_T operation,
     
    8081    int mWidth;
    8182    int mHeight;
    82     int mDepth;
    83     int mLineSize;
     83    int mBitsPerPixel;
     84    int mBytesPerLine;
    8485    uint8_t *mData;
    8586    RTSEMMUTEX mMutex;
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