10 interface IPooledAllocator
12 STDMETHOD_(void, ReleaseItem
)(void* Item
) PURE
;
13 STDMETHOD_(void, OnItemDestruct
)(void* Item
) PURE
;
16 class CPooledSubPicAllocator
: public CSubPicExAllocatorImpl
//, public IPooledAllocator
19 STDMETHODIMP_(void) ReleaseItem(void* Item
);
20 STDMETHODIMP_(void) OnItemDestruct(void* Item
);
22 bool STDMETHODCALLTYPE
InitPool(int capacity
);
24 CPooledSubPicAllocator(int alpha_blt_dst_type
, SIZE maxsize
, int capacity
, int type
=-1 );
25 virtual ~CPooledSubPicAllocator();
30 int _alpha_blt_dst_type
;
33 CAtlList
<CPooledSubPic
*> _free
;
34 CAtlList
<CPooledSubPic
*> _using
;
36 CPooledSubPic
* DoAlloc();
37 virtual bool AllocEx(bool fStatic
, ISubPicEx
** ppSubPic
);
39 void CollectUnUsedItem();
40 STDMETHODIMP_(int) SetSpdColorType(int color_type
);
41 STDMETHODIMP_(bool) IsSpdColorTypeSupported(int type
);
44 class CPooledSubPic
: public CMemSubPic
46 friend class CPooledSubPicAllocator
;
48 CPooledSubPic(SubPicDesc
& spd
, int alpha_blt_dst_type
, CPooledSubPicAllocator
* pool
):CMemSubPic(spd
, alpha_blt_dst_type
),_pool(pool
){}
49 virtual ~CPooledSubPic();
53 CPooledSubPicAllocator
* _pool
;