зеркало из https://github.com/mozilla/gecko-dev.git
Bugzilla Bug 95952 Waste of offscreen pixmaps
patch by Roland.Mainz@informatik.med.uni-giessen.de r=kmcclusk@netscape.com, sr=attinasi
This commit is contained in:
Родитель
a7fb7f967c
Коммит
12246fda79
|
@ -53,7 +53,6 @@ nsDrawingSurfaceXlibImpl::nsDrawingSurfaceXlibImpl()
|
|||
NS_INIT_REFCNT();
|
||||
PR_LOG(DrawingSurfaceXlibLM, PR_LOG_DEBUG, ("nsDrawingSurfaceXlibImpl::nsDrawingSurfaceXlibImpl()\n"));
|
||||
mDrawable = 0;
|
||||
mDestroyDrawable = PR_FALSE;
|
||||
mImage = nsnull;
|
||||
mXlibRgbHandle = nsnull;
|
||||
mDisplay = nsnull;
|
||||
|
@ -78,7 +77,7 @@ nsDrawingSurfaceXlibImpl::~nsDrawingSurfaceXlibImpl()
|
|||
{
|
||||
PR_LOG(DrawingSurfaceXlibLM, PR_LOG_DEBUG, ("nsDrawingSurfaceXlibImpl::~nsDrawingSurfaceXlibImpl()\n"));
|
||||
// if it's been labeled as destroy, it's a pixmap.
|
||||
if (mDestroyDrawable) {
|
||||
if (mDrawable!=None && mIsOffscreen) {
|
||||
XFreePixmap(mDisplay, mDrawable);
|
||||
}
|
||||
if (mImage) {
|
||||
|
|
|
@ -123,7 +123,6 @@ private:
|
|||
|
||||
// are we offscreen
|
||||
PRBool mIsOffscreen;
|
||||
PRBool mDestroyDrawable;
|
||||
|
||||
private:
|
||||
static PRUint8 ConvertMaskToCount(unsigned long val);
|
||||
|
|
|
@ -1590,6 +1590,22 @@ nsRenderingContextXlib::DrawImage(nsIImage *aImage, const nsRect& aSRect, const
|
|||
dr.width, dr.height);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsRenderingContextXlib::GetBackbuffer(const nsRect &aRequestedSize, const nsRect &aMaxSize, nsDrawingSurface &aBackbuffer)
|
||||
{
|
||||
PR_LOG(RenderingContextXlibLM, PR_LOG_DEBUG, ("nsRenderingContextXlib::GetBackbuffer()\n"));
|
||||
/* Do not cache the backbuffer. On X11 it is more efficient to allocate
|
||||
* the backbuffer as needed and it doesn't cause a performance hit. @see bug 95952 */
|
||||
return AllocateBackbuffer(aRequestedSize, aMaxSize, aBackbuffer, PR_FALSE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsRenderingContextXlib::ReleaseBackbuffer(void)
|
||||
{
|
||||
PR_LOG(RenderingContextXlibLM, PR_LOG_DEBUG, ("nsRenderingContextXlib::ReleaseBackbuffer()\n"));
|
||||
/* Do not cache the backbuffer. On X11 it is more efficient to allocate
|
||||
* the backbuffer as needed and it doesn't cause a performance hit. @see bug 95952 */
|
||||
return DestroyCachedBackbuffer();
|
||||
}
|
||||
|
||||
#if 0
|
||||
// in nsRenderingContextImpl
|
||||
/** ---------------------------------------------------
|
||||
|
|
|
@ -197,6 +197,9 @@ class nsRenderingContextXlib : public nsRenderingContextImpl
|
|||
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aRect);
|
||||
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aSRect, const nsRect& aDRect);
|
||||
|
||||
NS_IMETHOD GetBackbuffer(const nsRect &aRequestedSize, const nsRect &aMaxSize, nsDrawingSurface &aBackbuffer);
|
||||
NS_IMETHOD ReleaseBackbuffer(void);
|
||||
|
||||
NS_IMETHOD CopyOffScreenBits(nsDrawingSurface aSrcSurf, PRInt32 aSrcX, PRInt32 aSrcY,
|
||||
const nsRect &aDestBounds, PRUint32 aCopyFlags);
|
||||
NS_IMETHOD RetrieveCurrentNativeGraphicData(PRUint32 * ngd);
|
||||
|
|
Загрузка…
Ссылка в новой задаче