Gecko:Image Snapping and Rendering: Difference between revisions

Jump to navigation Jump to search
Line 37: Line 37:
An algorithm that satisfied these requirements:
An algorithm that satisfied these requirements:


* Compute source image pixel rectangle by mapping the logical fill rectangle back to image pixels and rounding out to the nearest image pixel. This will be passed down to gfx to ensure requirement 4 holds --- gfx will limit sampling to this area using EXTEND_PAD or equivalent. (It does not affect the image-space to device-space transform.)
* Compute tiled-space source image pixel rectangle by mapping the logical fill rectangle back to image pixels and rounding out to the nearest image pixel. This will be passed down to gfx to ensure requirement 4 holds --- gfx will limit sampling to this area using EXTEND_PAD or equivalent. (It does not affect the image-space to device-space transform.)
* Compute device pixel fill rectangle by snapping the logical fill rectangle to device pixels, preserving device pixel centers, thus ensuring requirement 3.
* Compute device pixel fill rectangle by snapping the logical fill rectangle to device pixels, preserving device pixel centers, thus ensuring requirement 3.
* Compute device pixel draw rectangle by intersecting the device pixel fill rectangle with the dirty rectangle scaled to device pixels and rounded out. This is the area to cairo_fill.
* Compute device pixel draw rectangle by intersecting the device pixel fill rectangle with the dirty rectangle scaled to device pixels and rounded out. This is the area to cairo_fill.
1,295

edits

Navigation menu