VirtualBox

Ignore:
Timestamp:
May 8, 2012 6:05:41 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
77855
Message:

Frontends: back out the Framebuffer cleanup, to be retried later

File:
1 edited

Legend:

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

    r41215 r41216  
    66
    77/*
    8  * Copyright (C) 2006-2012 Oracle Corporation
     8 * Copyright (C) 2006-2007 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4343
    4444class VBoxSDLFB :
    45     public CComObjectRootEx<CComMultiThreadModelNoCS>,
    4645    VBOX_SCRIPTABLE_IMPL(IFramebuffer)
    4746{
    4847public:
    49     DECLARE_NOT_AGGREGATABLE(VBoxSDLFB)
    50 
    51     DECLARE_PROTECT_FINAL_CONSTRUCT()
    52 
    53     VBoxSDLFB() { /* empty */ }
    54     ~VBoxSDLFB() { /* empty */ }
    55 
    56     HRESULT FinalConstruct();
    57     void FinalRelease();
    58 
    59     HRESULT init(uint32_t uScreenId,
    60                  bool fFullscreen = false, bool fResizable = true, bool fShowSDLConfig = false,
    61                  bool fKeepHostRes = false, uint32_t u32FixedWidth = ~(uint32_t)0,
    62                  uint32_t u32FixedHeight = ~(uint32_t)0, uint32_t u32FixedBPP = ~(uint32_t)0);
    63     void uninit();
    64 
    65     static bool initSDL(bool fShowSDLConfig);
    66     static void uninitSDL();
    67 
    68     BEGIN_COM_MAP(VBoxSDLFB)
    69         VBOX_MINIMAL_INTERFACE_ENTRIES(IFramebuffer)
    70     END_COM_MAP()
     48    VBoxSDLFB(uint32_t uScreenId,
     49              bool fFullscreen = false, bool fResizable = true, bool fShowSDLConfig = false,
     50              bool fKeepHostRes = false, uint32_t u32FixedWidth = ~(uint32_t)0,
     51              uint32_t u32FixedHeight = ~(uint32_t)0, uint32_t u32FixedBPP = ~(uint32_t)0);
     52    virtual ~VBoxSDLFB();
     53
     54    static bool init(bool fShowSDLConfig);
     55    static void uninit();
     56
     57#ifdef RT_OS_WINDOWS
     58    STDMETHOD_(ULONG, AddRef)()
     59    {
     60        return ::InterlockedIncrement (&refcnt);
     61    }
     62    STDMETHOD_(ULONG, Release)()
     63    {
     64        long cnt = ::InterlockedDecrement (&refcnt);
     65        if (cnt == 0)
     66            delete this;
     67        return cnt;
     68    }
     69#endif
     70    VBOX_SCRIPTABLE_DISPATCH_IMPL(IFramebuffer)
     71
     72    NS_DECL_ISUPPORTS
    7173
    7274    STDMETHOD(COMGETTER(Width))(ULONG *width);
     
    185187    /** secure label offset from the top of the secure label */
    186188    uint32_t mLabelOffs;
    187 #endif
    188 
     189
     190#endif
     191#ifdef RT_OS_WINDOWS
     192    long refcnt;
     193#endif
    189194    SDL_Surface *mSurfVRAM;
    190195
     
    198203
    199204class VBoxSDLFBOverlay :
    200     public CComObjectRootEx<CComMultiThreadModelNoCS>,
    201     VBOX_SCRIPTABLE_IMPL(IFramebufferOverlay)
     205    public IFramebufferOverlay
    202206{
    203207public:
    204     DECLARE_NOT_AGGREGATABLE(VBoxSDLFBOverlay)
    205 
    206208    VBoxSDLFBOverlay(ULONG x, ULONG y, ULONG width, ULONG height, BOOL visible,
    207209                     VBoxSDLFB *aParent);
    208210    virtual ~VBoxSDLFBOverlay();
    209211
    210     BEGIN_COM_MAP(VBoxSDLFBOverlay)
    211         VBOX_MINIMAL_INTERFACE_ENTRIES(IFramebufferOverlay)
    212     END_COM_MAP()
     212#ifdef RT_OS_WINDOWS
     213    STDMETHOD_(ULONG, AddRef)()
     214    {
     215        return ::InterlockedIncrement (&refcnt);
     216    }
     217    STDMETHOD_(ULONG, Release)()
     218    {
     219        long cnt = ::InterlockedDecrement (&refcnt);
     220        if (cnt == 0)
     221            delete this;
     222        return cnt;
     223    }
     224#endif
     225    VBOX_SCRIPTABLE_DISPATCH_IMPL(IFramebuffer)
     226
     227    NS_DECL_ISUPPORTS
    213228
    214229    STDMETHOD(COMGETTER(X))(ULONG *x);
     
    260275    /** Additional SDL surface used for combining the framebuffer and the overlay */
    261276    SDL_Surface *mBlendedBits;
     277#ifdef RT_OS_WINDOWS
     278    long refcnt;
     279#endif
    262280};
    263281
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