Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Factor out common code from RasterImage checking whether flags match

RESOLVED FIXED in mozilla17

Status

()

Core
ImageLib
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: khuey, Assigned: khuey)

Tracking

unspecified
mozilla17
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

RasterImage has some code that checks whether or not the flags it's handed match the flags it was decoded with and if not, whether another decode can be done.  This code exists in triplicate and should be factored out.
Created attachment 566011 [details] [diff] [review]
Patch
Assignee: nobody → khuey
Status: NEW → ASSIGNED
Attachment #566011 - Flags: review?(bobbyholley+bmo)
Comment on attachment 566011 [details] [diff] [review]
Patch

>+  bool TryToChangeFlags(PRUint32 aNewFlags);

Looks great except for the name. In particular, it doesn't specify the type of flags (decode flags), and we might not even be changing them at all.

ApplyDecodeFlags, maybe? Use your judgement here.

r=bholley with that
Attachment #566011 - Flags: review?(bobbyholley+bmo) → review+
Comment on attachment 566011 [details] [diff] [review]
Patch

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

::: modules/libpr0n/src/RasterImage.cpp
@@ +854,5 @@
>  
> +bool
> +RasterImage::TryToChangeFlags(PRUint32 aNewFlags)
> +{
> +  if (mFrameDecodeFlags == aNewFlags & DECODE_FLAGS_MASK)

That wants to be if (mFrameDecodeFlags == (aNewFlags & DECODE_FLAGS_MASK)), of course ..

/me whistles
https://hg.mozilla.org/mozilla-central/rev/a33215aa549c
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in before you can comment on or make changes to this bug.