Closed Bug 576437 Opened 14 years ago Closed 14 years ago

CreateOffscreenSurface should not silently translate ImageFormat24 into ImageFormat16_565

Categories

(Core :: Graphics, defect)

ARM
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- betaN+

People

(Reporter: vlad, Assigned: reportbase)

References

Details

Attachments

(3 files, 1 obsolete file)

gfxPlatform has a CreateOffscreenSurface API that takes a gfxImageFormat.  When the 565 patch landed, the mobile implementations of this silently translate ImageFormatRGB24 to ImageFormatRGB16_565.  They need to not do this -- it's pretty broken to give back something extremely different than what the caller requested.  This causes crashes when code expects the RGB24 format it requested.

Instead, if we want to have CreateOffscreen choose the best type of surface, then instead of a gfxImageFormat it should take a gfxContentType -- that way callers will know to only expect a RGBA or RGB surface, and not a particular format.
This doesn't need to block beta 2, but it needs to be fixed.
Assignee: nobody → romaxa
blocking2.0: beta2+ → betaN+
One simple fix would be to change CreateOffscreenSurface to take a ContentType instead of a format; that way no format promise is made.
I wasn't able to build all targets and I was only able to do a desk check on this code.
Attachment #474260 - Flags: review?(joe)
Attachment #474260 - Attachment is patch: true
Attachment #474260 - Attachment mime type: application/octet-stream → text/plain
Assignee: romaxa → reportbase
I think this fix should be useful for handling such bugs like
bug 593175
chris ^
Attachment #474260 - Flags: review?(joe) → review+
Blocks: 593175
Attached patch Fixed apply to m-c (obsolete) — Splinter Review
This patch is not full, and don't change all CreateOffscreenSurface entries...

We need one more patch which contain CreateOffscreenSurface changes for tests and non-linux platforms...
Attachment #475923 - Flags: review+
Comment on attachment 475923 [details] [diff] [review]
Fixed apply to m-c

this is previous patch just fix apply to latest m-c
Attachment #475923 - Attachment is patch: true
Attachment #475923 - Attachment mime type: application/octet-stream → text/plain
Attachment #475923 - Flags: review+
Attachment #474260 - Attachment description: Change CreateOffscreenSurface to take a ContentType instead of a format. → Change CreateOffscreenSurface to take a ContentType instead of a format. (NOT FULL DON'T checking without second part)
Attachment #475935 - Flags: review? → review?(joe)
Attachment #475935 - Flags: review?(joe) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: