VirtualBox

Changeset 22921 in vbox


Ignore:
Timestamp:
Sep 10, 2009 4:45:29 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
52185
Message:

video hw fixes: display list initialization fixes & fallback impl

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

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/include/VBoxFBOverlay.h

    r22855 r22921  
    580580    void deleteDisplay();
    581581
    582     GLuint createDisplay(VBoxVHWASurfaceBase *pPrimary);
     582    int createDisplay(VBoxVHWASurfaceBase *pPrimary, GLuint *pDisplay);
    583583    void doDisplay(VBoxVHWASurfaceBase *pPrimary, VBoxVHWAGlProgramVHWA * pProgram, bool bBindDst);
    584584    bool synchTexMem(const QRect * aRect);
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp

    r22920 r22921  
    27372737        )
    27382738{
    2739     {
    2740         if(mVisibleDisplayInitialized)
     2739    if(mVisibleDisplayInitialized)
     2740    {
     2741        if(mVisibleDisplay)
    27412742        {
    27422743            glDeleteLists(mVisibleDisplay, 1);
    2743             mVisibleDisplayInitialized = false;
    2744         }
     2744        }
     2745        mVisibleDisplayInitialized = false;
    27452746    }
    27462747}
     
    28262827}
    28272828
    2828 GLuint VBoxVHWASurfaceBase::createDisplay(VBoxVHWASurfaceBase *pPrimary)
     2829int VBoxVHWASurfaceBase::createDisplay(VBoxVHWASurfaceBase *pPrimary, GLuint *pDisplay)
    28292830{
    28302831    if(mVisibleTargRect.isEmpty())
     
    28372838    if(mVisibleSrcRect.isEmpty())
    28382839    {
    2839         return 0;
     2840        *pDisplay = 0;
     2841        return VINF_SUCCESS;
    28402842    }
    28412843
     
    28572859    }
    28582860
     2861    glGetError(); /* clear the err flag */
    28592862    GLuint display = glGenLists(1);
    2860     VBOXQGL_ASSERTNOERR();
    2861     glNewList(display, GL_COMPILE);
    2862 
    2863     doDisplay(pPrimary, pProgram, pDstCKey != NULL);
    2864 
    2865     glEndList();
    2866     VBOXQGL_ASSERTNOERR();
    2867 
    2868     return display;
     2863    GLenum err = glGetError();
     2864    if(err == GL_NO_ERROR)
     2865    {
     2866        Assert(display);
     2867        if(!display)
     2868        {
     2869            /* well, it seems it should not return 0 on success according to the spec,
     2870             * but just in case, pick another one */
     2871            display = glGenLists(1);
     2872            err = glGetError();
     2873            if(err == GL_NO_ERROR)
     2874            {
     2875                Assert(display);
     2876            }
     2877            else
     2878            {
     2879                /* we are failed */
     2880                Assert(!display);
     2881                display = 0;
     2882            }
     2883        }
     2884
     2885        if(display)
     2886        {
     2887            glNewList(display, GL_COMPILE);
     2888
     2889            doDisplay(pPrimary, pProgram, pDstCKey != NULL);
     2890
     2891            glEndList();
     2892            VBOXQGL_ASSERTNOERR();
     2893            *pDisplay = display;
     2894            return VINF_SUCCESS;
     2895        }
     2896    }
     2897    else
     2898    {
     2899        VBOXQGLLOG(("gl error ocured (0x%x)\n", err));
     2900        Assert(err == GL_NO_ERROR);
     2901    }
     2902
     2903    return VERR_GENERAL_FAILURE;
    28692904}
    28702905
     
    28732908    deleteDisplay();
    28742909
    2875     mVisibleDisplay = createDisplay(pPrimary);
    2876     mVisibleDisplayInitialized = true;
     2910    int rc = createDisplay(pPrimary, &mVisibleDisplay);
     2911    if(RT_SUCCESS(rc))
     2912    {
     2913        mVisibleDisplayInitialized = true;
     2914    }
    28772915}
    28782916
     
    29182956        return false;
    29192957
    2920 #ifdef DEBUG_misha
    2921     if(0)
     2958    Assert(mVisibleDisplay);
     2959
     2960    if(!mVisibleDisplayInitialized)
    29222961    {
    29232962        VBoxVHWAGlProgramVHWA * pProgram = NULL;
     
    29432982    }
    29442983    else
    2945 #endif
    29462984    {
    29472985        VBOXQGL_CHECKERR(
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