Status

()

Core
Graphics
5 years ago
5 years ago

People

(Reporter: jrmuizel, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Created attachment 773002 [details] [diff] [review]
Azure OMTC Mac

Not the most beautiful way to hook this up. But it does work and should have minimal casualties.
Attachment #773002 - Flags: review?(matt.woodrow)
Comment on attachment 773002 [details] [diff] [review]
Azure OMTC Mac

Review of attachment 773002 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/2d/DrawTargetCG.cpp
@@ +1034,5 @@
>    // CGContext's default to have the origin at the bottom left
>    // so flip it to the top left
>    CGContextTranslateCTM(mCg, 0, mSize.height);
>    CGContextScaleCTM(mCg, 1, -1);
> +#endif

Assuming that there are no other callers for this function, can we just get rid of this entirely and add a comment about why we don't need to do it.

::: gfx/2d/Factory.cpp
@@ +507,5 @@
> +Factory::CreateDrawTargetForCG(CGContextRef cg, const IntSize& aSize)
> +{
> +  RefPtr<DrawTarget> retVal;
> +
> +#ifdef XP_MACOSX

I think we should move these outside the function and only define it on OSX. This is what the other platform specific factory functions seem to do.

::: gfx/thebes/gfxPlatform.cpp
@@ +553,5 @@
> +#ifdef XP_MACOSX
> +  if (aSurface->GetType() == gfxASurface::SurfaceTypeQuartz) {
> +    RefPtr<DrawTarget> drawTarget = Factory::CreateDrawTargetForCG(static_cast<gfxQuartzSurface*>(aSurface)->GetCGContext(), aSize);
> +    aSurface->AddRef();
> +    drawTarget->AddUserData(&kSurface, aSurface, SurfaceDestroy);

We don't need to hold a reference to the gfxQuartzSurface, our DrawTargetQuartz will hold a reference to the CGContext.

Let's just move this into its own function since it has different semantics.

@@ +556,5 @@
> +    aSurface->AddRef();
> +    drawTarget->AddUserData(&kSurface, aSurface, SurfaceDestroy);
> +    return drawTarget;
> +  }
> +#endif

Add a gfxPlatformMac override of this function so we can avoid the #ifdefs
Attachment #773002 - Flags: review?(matt.woodrow) → review+
(In reply to Jeff Muizelaar [:jrmuizel] from comment #0)
> Created attachment 773002 [details] [diff] [review]
> Azure OMTC Mac
> 
> Not the most beautiful way to hook this up. But it does work and should have
> minimal casualties.

The dual target bits feel like a separate bug, or at least a separate patch?
You need to log in before you can comment on or make changes to this bug.