Closed
Bug 464811
Opened 16 years ago
Closed 16 years ago
Fix anchor point snapping to guarantee that the source rect intersects the subimage region
Categories
(Core :: Layout, defect, P1)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla1.9.1b2
People
(Reporter: roc, Assigned: roc)
References
Details
(Keywords: fixed1.9.1, regression)
Attachments
(2 files, 5 obsolete files)
245 bytes,
text/html
|
Details | |
8.36 KB,
patch
|
roc
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
The current approach to anchor point snapping, which I did in bug 463204, isn't quite right. Sometimes the transform from the logical fill rect to the device pixel fill rect can be weird; for example [0.4, 0.6] snaps to [0,1], which is a scale-up by 5, but we don't want to scale an anchor offset of 10 by a factor of 5. Also, I've been investigating how to guarantee that nsLayoutUtils::DrawImage will generate parameters to nsThebesImage::Draw so that the fill rectangle, transformed to image space, intersects the subimage rectangle. It turns out a new approach to anchor point snapping solves both of these problems. The approach is: 1) start with the anchor point in user space 2) map it back to image space via the "ideal" transformation defined by the initial rectangle, and snap it to some image pixel corner. Any one will do, the nearest one makes most sense. 3) map that corner forward through the "ideal" transformation back to device space, and snap to the nearest device pixel corner. 4) the device-space-to-image-space transformation's translation is chosen to map the device pixel corner from step 3 to the image pixel corner from step 2. I've updated https://wiki.mozilla.org/Gecko:Image_Snapping_and_Rendering with the adjusted requirements and algorithm. I've also added a proof there that the resulting algorithm ensures the source and subimage rectangles intersect. The proof is not trivial and it's fairly "tight" --- alternative choices in the algorithm would likely break the proof and fail to satisfy the requirement.
Assignee | ||
Comment 1•16 years ago
|
||
This testcase shows the actual bug. We try to display a sliver of the image and display completely the wrong slice. The column of pixels in the second DIV should match the column of pixels above it in the first DIV.
Assignee | ||
Comment 2•16 years ago
|
||
This fixes it, as described here and in the wiki page.
Attachment #348127 -
Flags: superreview?(dbaron)
Attachment #348127 -
Flags: review?(dbaron)
Assignee | ||
Comment 3•16 years ago
|
||
With the tests included.
Attachment #348127 -
Attachment is obsolete: true
Attachment #348128 -
Flags: superreview?(dbaron)
Attachment #348128 -
Flags: review?(dbaron)
Attachment #348127 -
Flags: superreview?(dbaron)
Attachment #348127 -
Flags: review?(dbaron)
Assignee | ||
Comment 4•16 years ago
|
||
433640-1-ref.html needs to be reverted back to its pre-bug-463204 state.
Attachment #348132 -
Flags: superreview?(dbaron)
Attachment #348132 -
Flags: review?(dbaron)
Attachment #348128 -
Attachment is obsolete: true
Attachment #348128 -
Flags: superreview?(dbaron)
Attachment #348128 -
Flags: review?(dbaron)
Assignee | ||
Comment 6•16 years ago
|
||
dbaron thought this should block beta in light of bug 464606.
Flags: blocking1.9.1?
Comment on attachment 348132 [details] [diff] [review] fix v1.2 I don't quite follow the whole thing, but what I understand makes sense. r+sr=dbaron But could you add some comments before MapToFloatImagePixels / MapToFloatUserPixels saying what they do?
Attachment #348132 -
Flags: superreview?(dbaron)
Attachment #348132 -
Flags: superreview+
Attachment #348132 -
Flags: review?(dbaron)
Attachment #348132 -
Flags: review+
Assignee | ||
Comment 8•16 years ago
|
||
Sure.
Assignee | ||
Comment 9•16 years ago
|
||
Updated for comments
Attachment #348132 -
Attachment is obsolete: true
Attachment #348482 -
Flags: superreview+
Attachment #348482 -
Flags: review+
Assignee | ||
Comment 10•16 years ago
|
||
Comment on attachment 348482 [details] [diff] [review] fix v1.3 Another image rendering regression fix
Attachment #348482 -
Flags: approval1.9.1b2?
Assignee | ||
Updated•16 years ago
|
Whiteboard: [needs approval/landing]
Updated•16 years ago
|
Flags: in-testsuite?
Keywords: regression
Target Milestone: --- → mozilla1.9.1b2
Hmmm, we agreed this was blocking in our triage spreadsheet yesterday; I'm not sure why roc didn't mark this one. Beltzner says we (as the layout triage team) have the authority to mark things as beta2 blockers if we think they're really blockers (although the non-blocker approval queue is still triaged by the release drivers). So I'm marking this as such; although I'm not sure whether roc's comment 6 counts as agreement with my assertion that it should block. If not, he can change the target milestone back.
Flags: blocking1.9.1? → blocking1.9.1+
Assignee | ||
Comment 13•16 years ago
|
||
That's cool. I'll land
Assignee | ||
Comment 14•16 years ago
|
||
Pushed 0ced86fbf8ed
Status: NEW → RESOLVED
Closed: 16 years ago
Flags: in-testsuite? → in-testsuite+
Resolution: --- → FIXED
Assignee | ||
Updated•16 years ago
|
Whiteboard: [needs approval/landing]
Assignee | ||
Updated•16 years ago
|
Attachment #348482 -
Flags: approval1.9.1b2?
Assignee | ||
Comment 15•16 years ago
|
||
Backed out. Reftests failed, which is weird. Maybe some interaction between this patch and other changes that landed in the past few days.
Status: RESOLVED → REOPENED
Flags: in-testsuite+
Resolution: FIXED → ---
Comment 16•16 years ago
|
||
Comment on attachment 348482 [details] [diff] [review] fix v1.3 >diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list [snip] >+== 464811-1.html 464811-1-ref.thml That needs a s/thml/html (though that doesn't fix the other reftest failures)
Assignee | ||
Comment 17•16 years ago
|
||
Because I am stupid, I lost a "anchorPoint.Round()" while rebasing the patch to trunk. This patch passes reftests.
Attachment #348686 -
Flags: superreview+
Attachment #348686 -
Flags: review+
Assignee | ||
Updated•16 years ago
|
Priority: -- → P1
Whiteboard: [needs landing]
Assignee | ||
Comment 18•16 years ago
|
||
Comment on attachment 348686 [details] [diff] [review] fix v1.4 And because I am doubly stupid, I attached the wrong patch.
Attachment #348686 -
Attachment is obsolete: true
Assignee | ||
Comment 19•16 years ago
|
||
Attachment #348482 -
Attachment is obsolete: true
Attachment #348722 -
Flags: superreview+
Attachment #348722 -
Flags: review+
Assignee | ||
Comment 20•16 years ago
|
||
Re-pushed d328fec034c5
Status: REOPENED → RESOLVED
Closed: 16 years ago → 16 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Assignee | ||
Updated•16 years ago
|
Whiteboard: [needs landing]
Both of my duplicate bugs, bug 464606 and bug 464603, are verified FIXED in the nightlies.
Updated•16 years ago
|
Keywords: fixed1.9.1
You need to log in
before you can comment on or make changes to this bug.
Description
•