Closed Bug 1255342 Opened 9 years ago Closed 9 years ago

Add LockBits support for cairo win32 surfaces

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: jrmuizel, Assigned: lsalzman)

References

(Blocks 1 open bug)

Details

(Whiteboard: gfx-noted)

Attachments

(1 file, 1 obsolete file)

No description provided.
Blocks: 1254010
Attachment #8728885 - Attachment is patch: true
Attachment #8728885 - Flags: review?(lsalzman)
Comment on attachment 8728885 [details] [diff] [review] Add LockBits support for cairo win32 surfaces Review of attachment 8728885 [details] [diff] [review]: ----------------------------------------------------------------- I just built the patch and the following needs to be updated. ::: gfx/2d/DrawTargetCairo.cpp @@ +719,5 @@ > IntPoint* aOrigin) > { > cairo_surface_t* surf = cairo_get_group_target(mContext); > + if (cairo_surface_get_type(surf) == CAIRO_SURFACE_TYPE_WIN32) { > + cairo_surface_t *imgsurf = cairo_win32_surface_get_image(); missing parameter. @@ +758,5 @@ > MOZ_ASSERT(mLockedBits == aData); > mLockedBits = nullptr; > cairo_surface_t* surf = cairo_get_group_target(mContext); > + if (cairo_surface_get_type(surf) == CAIRO_SURFACE_TYPE_WIN32) { > + cairo_surface_t *imgsurf = cairo_win32_surface_get_image(); missing parameter.
Comment on attachment 8728885 [details] [diff] [review] Add LockBits support for cairo win32 surfaces In LockBits, cairo_surface_get_device_offset will always return the wrong value here in because it's querying the embedded image surface and not the original win32 surface. Just that one particular call needs to make sure it uses the original group target, though the other usage looks correct. The ReleaseBits part probably needs to mark both the original win32 surface and the image surface as dirty, or otherwise one or the other might accidentally be left as clear.
Comment on attachment 8728885 [details] [diff] [review] Add LockBits support for cairo win32 surfaces Review of attachment 8728885 [details] [diff] [review]: ----------------------------------------------------------------- r- for now since the patch won't work as it is until above issues resolved.
Attachment #8728885 - Flags: review?(lsalzman) → review-
This solves a few problems that cropped up with Jeff's original patch: It makes sure to get the device offset from the original group target and not the image surface. It makes sure to mark both surfaces as dirty just in case. It #ifdefs out Win32 details depending on whether it is available. Fixes code formatting.
Assignee: nobody → lsalzman
Attachment #8728885 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8737332 - Flags: review?(sotaro.ikeda.g)
Attachment #8737332 - Flags: review?(sotaro.ikeda.g) → review+
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Blocks: 1255703
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: