mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 923290 - Don't use the window CGContext as a source with Moz2D. r=Bas
This commit is contained in:
parent
a567cd9101
commit
043a00f400
@ -31,6 +31,8 @@
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::gfx;
|
||||
|
||||
UserDataKey gfxContext::sDontUseAsSourceKey;
|
||||
|
||||
/* This class lives on the stack and allows gfxContext users to easily, and
|
||||
* performantly get a gfx::Pattern to use for drawing in their current context.
|
||||
*/
|
||||
@ -1614,8 +1616,9 @@ gfxContext::PushGroupAndCopyBackground(gfxContentType content)
|
||||
gfxRect clipRect = GetRoundOutDeviceClipExtents(this);
|
||||
clipExtents = IntRect(clipRect.x, clipRect.y, clipRect.width, clipRect.height);
|
||||
}
|
||||
if (mDT->GetFormat() == FORMAT_B8G8R8X8 ||
|
||||
mDT->GetOpaqueRect().Contains(clipExtents)) {
|
||||
if ((mDT->GetFormat() == FORMAT_B8G8R8X8 ||
|
||||
mDT->GetOpaqueRect().Contains(clipExtents)) &&
|
||||
!mDT->GetUserData(&sDontUseAsSourceKey)) {
|
||||
DrawTarget *oldDT = mDT;
|
||||
RefPtr<SourceSurface> source = mDT->Snapshot();
|
||||
Point oldDeviceOffset = CurrentState().deviceOffset;
|
||||
|
@ -708,6 +708,8 @@ public:
|
||||
void CopyAsDataURL();
|
||||
#endif
|
||||
|
||||
static mozilla::gfx::UserDataKey sDontUseAsSourceKey;
|
||||
|
||||
private:
|
||||
friend class GeneralPattern;
|
||||
friend struct GlyphBufferAzure;
|
||||
|
@ -3377,12 +3377,14 @@ NSEvent* gLastDragMouseDownEvent = nil;
|
||||
gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(targetSurface,
|
||||
gfx::IntSize(backingSize.width,
|
||||
backingSize.height));
|
||||
dt->AddUserData(&gfxContext::sDontUseAsSourceKey, dt, nullptr);
|
||||
targetContext = new gfxContext(dt);
|
||||
} else if (gfxPlatform::GetPlatform()->SupportsAzureContentForType(gfx::BACKEND_COREGRAPHICS)) {
|
||||
RefPtr<gfx::DrawTarget> dt =
|
||||
gfx::Factory::CreateDrawTargetForCairoCGContext(aContext,
|
||||
gfx::IntSize(backingSize.width,
|
||||
backingSize.height));
|
||||
dt->AddUserData(&gfxContext::sDontUseAsSourceKey, dt, nullptr);
|
||||
targetContext = new gfxContext(dt);
|
||||
} else {
|
||||
targetContext = new gfxContext(targetSurface);
|
||||
|
Loading…
Reference in New Issue
Block a user