Gecko:Image Snapping and Rendering: Difference between revisions

Jump to navigation Jump to search
Line 35: Line 35:


Requirement 2 is obviously satisfied since the dirty rect is only used to constrain the filled area and does not affect the mapping from image space to device space. Requirements 3 and 4 are satisfied by construction. Proof that requirement 5 is always satisfied:
Requirement 2 is obviously satisfied since the dirty rect is only used to constrain the filled area and does not affect the mapping from image space to device space. Requirements 3 and 4 are satisfied by construction. Proof that requirement 5 is always satisfied:
Assume the initial rectangle size in device pixels equals the image size in CSS pixels. Then the initial rectangle size is integral numbers of device pixels, so the device pixel initial rectangle has the same size. So the scale factors of the transform are 1. Now, the translation from image space to device context space in the ideal rendering is just the top-left of the initial rectangle
Assume the initial rectangle size in device pixels equals the image size in CSS pixels. Then the initial rectangle size is integral numbers of device pixels, so the device pixel initial rectangle has the same size. So the scale factors of the transform are 1. Now, the translation from image space to device context space in the ideal rendering is just the top-left of the initial rectangle
in device pixels. The translation in our rendering is the top-left of the device pixel initial rectangle, which is the top-left of the initial rectangle snapped to the nearest pixel edges --- a translation of at most half a pixel in each direction. QED.
in device pixels. The translation in our rendering is the top-left of the device pixel initial rectangle, which is the top-left of the initial rectangle snapped to the nearest pixel edges --- a translation of at most half a pixel in each direction. The only other thing we need to show is that every image pixel whose ideal rendering contains a device pixel center is actually rendered; this follows because the device pixel fill rectangle preserves the device pixel centres of the logical fill rectangle. QED.
1,295

edits

Navigation menu