Bug 624152. Don't do the 'copy background' part of PushGroupAndCopyBackground for non-pixel-based surfaces; it shouldn't be necessary. r=jrmuizel,a=blocker

This commit is contained in:
Robert O'Callahan 2011-01-15 22:40:33 +13:00
Родитель 785dc45b3a
Коммит 1d5fa13201
5 изменённых файлов: 16 добавлений и 5 удалений

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

@ -770,7 +770,8 @@ CopySurface(gfxASurface* aSrc, gfxASurface* aDest)
void
gfxContext::PushGroupAndCopyBackground(gfxASurface::gfxContentType content)
{
if (content == gfxASurface::CONTENT_COLOR_ALPHA) {
if (content == gfxASurface::CONTENT_COLOR_ALPHA &&
!(GetFlags() & FLAG_DISABLE_COPY_BACKGROUND)) {
nsRefPtr<gfxASurface> s = CurrentSurface();
if ((s->GetAllowUseAsSource() || s->GetType() == gfxASurface::SurfaceTypeTee) &&
(s->GetContentType() == gfxASurface::CONTENT_COLOR ||

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

@ -649,7 +649,11 @@ public:
* When this flag is set, snapping to device pixels is disabled.
* It simply never does anything.
*/
FLAG_DISABLE_SNAPPING = (1 << 1)
FLAG_DISABLE_SNAPPING = (1 << 1),
/**
* Disable copying of backgrounds in PushGroupAndCopyBackground.
*/
FLAG_DISABLE_COPY_BACKGROUND = (1 << 2)
};
void SetFlag(PRInt32 aFlag) { mFlags |= aFlag; }

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

@ -69,7 +69,8 @@ public:
virtual PRInt32 GetDefaultContextFlags() const
{
return gfxContext::FLAG_SIMPLIFY_OPERATORS |
gfxContext::FLAG_DISABLE_SNAPPING;
gfxContext::FLAG_DISABLE_SNAPPING |
gfxContext::FLAG_DISABLE_COPY_BACKGROUND;
}
private:

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

@ -61,7 +61,11 @@ public:
CGContextRef GetCGContext() { return mCGContext; }
virtual PRInt32 GetDefaultContextFlags() const { return gfxContext::FLAG_DISABLE_SNAPPING; }
virtual PRInt32 GetDefaultContextFlags() const
{
return gfxContext::FLAG_DISABLE_SNAPPING |
gfxContext::FLAG_DISABLE_COPY_BACKGROUND;
}
protected:
CGContextRef mCGContext;

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

@ -286,7 +286,8 @@ gfxWindowsSurface::GetDefaultContextFlags() const
{
if (mForPrinting)
return gfxContext::FLAG_SIMPLIFY_OPERATORS |
gfxContext::FLAG_DISABLE_SNAPPING;
gfxContext::FLAG_DISABLE_SNAPPING |
gfxContext::FLAG_DISABLE_COPY_BACKGROUND;
return 0;
}