Regarding the -moz-image-rect() function, I am wondering where is the best 
place to extract a sub image from an original image.

The existing CSS properties such as border-image extract sub images at the last 
moment right before calling nsLayoutUtils::DrawImage() and thus each time a 
frame is trigger to be painted, temporary surfaces are created and disposed to 
paint the sub image (bug 444658). This is also the approach I used for the 
work-in-progress patch that I attached to bug 113577.

An alternative is to extract a sub image as soon as the original image is 
loaded and store it somewhere (imgSubImageRequest?) as long as it is being 
referenced. This way, extraction is performed only once for a single sub image, 
and also the extracted sub image can be cached by imgLoader. A drawback is that 
both the original image and the sub images coexist in the memory for a while.

Thank you very much for any feedback.

Ryo
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to