[BeOS], Bug 343987, changing clipregion in CopyOffScreenBits to safe version, p=sergei_d@fi.tartu.ee, r=thesuckiestemail. BeOS-only

This commit is contained in:
sergei_d%fi.tartu.ee 2006-07-11 13:17:16 +00:00
Родитель 4451e7f11c
Коммит de8bf8f40e
1 изменённых файлов: 10 добавлений и 4 удалений

Просмотреть файл

@ -1445,7 +1445,7 @@ NS_IMETHODIMP nsRenderingContextBeOS::CopyOffScreenBits(nsIDrawingSurface* aSrcS
srcsurf->AcquireView(&srcview);
srcsurf->AcquireBitmap(&srcbitmap);
// XXX - No more use for that, should be removed in future
if (aCopyFlags & NS_COPYBITS_TO_BACK_BUFFER)
{
NS_ASSERTION(nsnull != mSurface, "no back buffer");
@ -1501,9 +1501,15 @@ NS_IMETHODIMP nsRenderingContextBeOS::CopyOffScreenBits(nsIDrawingSurface* aSrcS
if (aCopyFlags & NS_COPYBITS_USE_SOURCE_CLIP_REGION)
{
BRegion r;
srcview->GetClippingRegion(&r);
destview->ConstrainClippingRegion(&r);
BRegion *region = nsnull;
if(mClipRegion && mSurface == aSrcSurf)
mClipRegion->GetNativeRegion((void *&)region);
// Following else-code has sense only if srcview and destview frames
// are equal and is incompatible with #define NOBBCACHE.
// Keeping it here for fallback case.
else if(srcview->Bounds() == destview->Bounds())
srcview->GetClippingRegion(region);
destview->ConstrainClippingRegion(region);
}
// Draw to destination synchronously to make sure srcbitmap doesn't change