Closed
Bug 898228
Opened 11 years ago
Closed 11 years ago
Wasted work in gfxContext::ClipContainsRect()
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: pchang9, Assigned: pchang9)
Details
(Keywords: perf, Whiteboard: patch)
Attachments
(1 file, 3 obsolete files)
2.23 KB,
patch
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0 (Beta/Release) Build ID: 20130116073211 Steps to reproduce: The problem appears in changeset 138350:18467a85acf6. I have attached a simple one-line patch that fixes it. In method gfxContext::ClipContainsRect() in gfx/thebes/gfxContext.cpp, the loop in line 1232 keeps overriding "lastReset" with "i" when "mStateStack[i].clipWasReset" is true. Therefore, only the last written value is visible out of the loop and all the other writes and iterations are not necessary. The patch iterates from the start of "lastReset" and breaks the first time when "i" is set. Similar problems also appear in loops at line 2073 and 2184, function gfxContext::PushClipsToDT() and gfxContext::ChangeTransform().
Updated•11 years ago
|
Component: Untriaged → Graphics
Product: Firefox → Core
Whiteboard: patch
Comment 1•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/file/18467a85acf6/gfx/thebes/gfxContext.cpp#l1230
Assignee: nobody → pchang9
Updated•11 years ago
|
Attachment #781387 -
Attachment is patch: true
Attachment #784375 -
Flags: review?(jmuizelaar)
Updated•11 years ago
|
Attachment #784375 -
Flags: review?(jmuizelaar) → review?(bas)
Comment 3•11 years ago
|
||
Comment on attachment 784375 [details] [diff] [review] 898228.patch Review of attachment 784375 [details] [diff] [review]: ----------------------------------------------------------------- Ouch! I think the current behavior is actually wrong! We're currently catching the first reset instead of the last one. This is a very nice catch, but the right solution is inserting a break in the existing loops without changing the loops itself. I'm actually surprised this hasn't caused any bugs, I suppose we don't often have multiple resets in a clip stack. When we fix this we should keep a careful eye open on whether nothing breaks.
Attachment #784375 -
Flags: review?(bas) → review-
Attachment #781387 -
Attachment is obsolete: true
Attachment #784375 -
Attachment is obsolete: true
Attachment #784394 -
Flags: review?(bas)
Comment 5•11 years ago
|
||
Comment on attachment 784394 [details] [diff] [review] 898228-1.patch Review of attachment 784394 [details] [diff] [review]: ----------------------------------------------------------------- This looks like a great change!
Attachment #784394 -
Flags: review?(bas) → review+
(In reply to Bas Schouten (:bas.schouten) from comment #5) > Comment on attachment 784394 [details] [diff] [review] > 898228-1.patch > > Review of attachment 784394 [details] [diff] [review]: > ----------------------------------------------------------------- > > This looks like a great change! Thanks! Could you be my voucher so that I can test on try servers ?
Landed on try server: https://tbpl.mozilla.org/?tree=Try&rev=75b0a15266b3
Keywords: checkin-needed
Updated•11 years ago
|
Attachment #784394 -
Attachment is obsolete: true
Comment 9•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/d215826d8637
Keywords: checkin-needed
Comment 10•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/d215826d8637
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in
before you can comment on or make changes to this bug.
Description
•