VirtualBox

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


Ignore:
Timestamp:
May 31, 2010 5:38:48 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
62189
Message:

wddm/2d: overlay surface creation fixes

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r29812 r29922  
    144144 VirtualBox_DEFS        += VBOX_WITH_VIRTIO
    145145endif
    146 
     146ifdef VBOXWDDM
     147 VirtualBox_DEFS        += VBOXWDDM
     148endif
    147149ifdef VBOX_BLEEDING_EDGE
    148150VirtualBox_src/VBoxSelectorWnd.cpp_DEFS += \
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp

    r29794 r29922  
    24222422}
    24232423
     2424#ifdef VBOXWDDM
     2425int VBoxVHWAImage::vhwaSurfaceGetInfo(struct _VBOXVHWACMD_SURF_GETINFO *pCmd)
     2426{
     2427    VBoxVHWAColorFormat format;
     2428    Assert(!format.isValid());
     2429    if (pCmd->SurfInfo.PixelFormat.flags & VBOXVHWA_PF_RGB)
     2430        format = VBoxVHWAColorFormat(pCmd->SurfInfo.PixelFormat.c.rgbBitCount,
     2431                                        pCmd->SurfInfo.PixelFormat.m1.rgbRBitMask,
     2432                                        pCmd->SurfInfo.PixelFormat.m2.rgbGBitMask,
     2433                                        pCmd->SurfInfo.PixelFormat.m3.rgbBBitMask);
     2434    else if (pCmd->SurfInfo.PixelFormat.flags & VBOXVHWA_PF_FOURCC)
     2435        format = VBoxVHWAColorFormat(pCmd->SurfInfo.PixelFormat.fourCC);
     2436    else
     2437        AssertBreakpoint();
     2438
     2439    Assert(format.isValid());
     2440    if (format.isValid())
     2441    {
     2442        pCmd->SurfInfo.pitch = format.bitsPerPixel() * pCmd->SurfInfo.width / 8;
     2443//        pCmd->SurfInfo.pitch = ((pCmd->SurfInfo.pitch + 3) & (~3));
     2444        pCmd->SurfInfo.sizeX = format.bitsPerPixelMem() * pCmd->SurfInfo.width / 8;
     2445//        pCmd->SurfInfo.sizeX = ((pCmd->SurfInfo.sizeX + 3) & (~3));
     2446        pCmd->SurfInfo.sizeX *= pCmd->SurfInfo.height;
     2447        pCmd->SurfInfo.sizeY = 1;
     2448        return VINF_SUCCESS;
     2449    }
     2450    return VERR_INVALID_PARAMETER;
     2451}
     2452#endif
    24242453int VBoxVHWAImage::vhwaSurfaceDestroy(struct _VBOXVHWACMD_SURF_DESTROY *pCmd)
    24252454{
     
    38833912        case FOURCC_AYUV:
    38843913            mBitsPerPixel = 32;
     3914#ifdef VBOXWDDM
     3915            mBitsPerPixelMem = 32;
     3916#endif
    38853917            mWidthCompression = 1;
    38863918            break;
     
    38883920        case FOURCC_YUY2:
    38893921            mBitsPerPixel = 16;
     3922#ifdef VBOXWDDM
     3923            mBitsPerPixelMem = 16;
     3924#endif
    38903925            mWidthCompression = 2;
    38913926            break;
    38923927        case FOURCC_YV12:
    38933928            mBitsPerPixel = 8;
     3929#ifdef VBOXWDDM
     3930            mBitsPerPixelMem = 12;
     3931#endif
    38943932            mWidthCompression = 4;
    38953933            break;
     
    38983936            mBitsPerPixel = 0;
    38993937            mBitsPerPixelTex = 0;
     3938#ifdef VBOXWDDM
     3939            mBitsPerPixelMem = 0;
     3940#endif
    39003941            mWidthCompression = 0;
    39013942            break;
     
    39073948    mBitsPerPixel = bitsPerPixel;
    39083949    mBitsPerPixelTex = bitsPerPixel;
     3950#ifdef VBOXWDDM
     3951    mBitsPerPixelMem = bitsPerPixel;
     3952#endif
    39093953    mDataFormat = 0;
    39103954    switch (bitsPerPixel)
     
    39644008            mBitsPerPixel = 0;
    39654009            mBitsPerPixelTex = 0;
     4010#ifdef VBOXWDDM
     4011            mBitsPerPixelMem = 0;
     4012#endif
    39664013            break;
    39674014    }
     
    45944641            pCmd->rc = vhwaConstruct(pBody);
    45954642        } break;
     4643#ifdef VBOXWDDM
     4644        case VBOXVHWACMD_TYPE_SURF_GETINFO:
     4645        {
     4646            VBOXVHWACMD_SURF_GETINFO * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_GETINFO);
     4647            pCmd->rc = mOverlayImage.vhwaSurfaceGetInfo(pBody);
     4648        } break;
     4649#endif
    45964650        default:
    45974651            Assert(0);
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h

    r28800 r29922  
    232232    uint32_t bitsPerPixel() const { return mBitsPerPixel; }
    233233    uint32_t bitsPerPixelTex() const { return mBitsPerPixelTex; }
     234#ifdef VBOXWDDM
     235    uint32_t bitsPerPixelMem() const { return mBitsPerPixelMem; }
     236#endif
    234237    void pixel2Normalized(uint32_t pix, float *r, float *g, float *b) const;
    235238    uint32_t widthCompression() const {return mWidthCompression;}
     
    267270    uint32_t mBitsPerPixel;
    268271    uint32_t mBitsPerPixelTex;
     272#ifdef VBOXWDDM
     273    uint32_t mBitsPerPixelMem;
     274#endif
    269275    uint32_t mWidthCompression;
    270276    uint32_t mHeightCompression;
     
    14791485    int vhwaSurfaceCanCreate(struct _VBOXVHWACMD_SURF_CANCREATE *pCmd);
    14801486    int vhwaSurfaceCreate(struct _VBOXVHWACMD_SURF_CREATE *pCmd);
     1487#ifdef VBOXWDDM
     1488    int vhwaSurfaceGetInfo(struct _VBOXVHWACMD_SURF_GETINFO *pCmd);
     1489#endif
    14811490    int vhwaSurfaceDestroy(struct _VBOXVHWACMD_SURF_DESTROY *pCmd);
    14821491    int vhwaSurfaceLock(struct _VBOXVHWACMD_SURF_LOCK *pCmd);
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