Bug 623852. gfxContext::PushGroupAndCopyBackground should not try to copy the background if the underlying surface cannot be used as a source. r=mstange,a=blocking

This commit is contained in:
Robert O'Callahan 2011-01-15 22:40:33 +13:00
parent fceda9686a
commit 7193a092f0
3 changed files with 4 additions and 4 deletions

View File

@ -222,8 +222,6 @@ public:
/**
* Mark the surface as being allowed/not allowed to be used as a source.
* This currently has no effect other than triggering assertions in some
* cases.
*/
void SetAllowUseAsSource(PRBool aAllow) { mAllowUseAsSource = aAllow; }
PRBool GetAllowUseAsSource() { return mAllowUseAsSource; }

View File

@ -772,8 +772,9 @@ gfxContext::PushGroupAndCopyBackground(gfxASurface::gfxContentType content)
{
if (content == gfxASurface::CONTENT_COLOR_ALPHA) {
nsRefPtr<gfxASurface> s = CurrentSurface();
if (s->GetContentType() == gfxASurface::CONTENT_COLOR ||
s->GetOpaqueRect().Contains(GetRoundOutDeviceClipExtents(this))) {
if ((s->GetAllowUseAsSource() || s->GetType() == gfxASurface::SurfaceTypeTee) &&
(s->GetContentType() == gfxASurface::CONTENT_COLOR ||
s->GetOpaqueRect().Contains(GetRoundOutDeviceClipExtents(this)))) {
cairo_push_group_with_content(mCairo, CAIRO_CONTENT_COLOR);
nsRefPtr<gfxASurface> d = CurrentSurface();

View File

@ -2736,6 +2736,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
NSSize bufferSize = [self bounds].size;
nsRefPtr<gfxQuartzSurface> targetSurface =
new gfxQuartzSurface(aContext, gfxSize(bufferSize.width, bufferSize.height));
targetSurface->SetAllowUseAsSource(PR_FALSE);
nsRefPtr<gfxContext> targetContext = new gfxContext(targetSurface);