Conversation
|
Please rebase on |
Calls CoreGraphicsContext::draw_image() from CoreGraphicsContext::draw_image_area() after cropping the image.
9e26976 to
e2174dd
Compare
…p and y-down contexts
|
Added one last (hopefully) commit to this branch: 5df4eec fixes capture_image_area for y-up contexts by tracking the y-direction in CoreGraphicsContext and translating the context's origin if necessary. |
|
Dang, this actually broke a lot of stuff that wasn't in my test case. Getting à la cart piet snapshot testing set up locally and then harmonizing y-direction handling across druid with and without bitmap caching (linebender/druid#2246) may take me a day or two. If you want I can just shelve the commit, it's not likely to help anyone who isn't also using bitmap render caching of some form in druid. |
|
No rush, we can see what else comes up. |
3edab42 to
6bbf3a1
Compare
|
Not thrilled about adding overhead in 6bbf3a1 but this is just about ready to go. Piet tests, standard druid windows, and bitmap-cached druid windows all draw properly. Still fighting a couple of coregraphics functions (mostly I made a handful of changes to test pattern 16 in be1da57 to troubleshoot y-flip issues. A bunch of the test images fail out of the box on my system (macOS 12.5, perhaps coregraphics itself has changed) so I hesitate to make a PR to the snapshot repo. That image now looks like this: |
|
Oops, I was using For the snapshots, I don't know if the standard here is to have more comprehensive tests or faster/simpler ones. If simpler is better I can just drop be1da57. |
21984e9 to
d1f85ea
Compare
d1f85ea to
f5abbb1
Compare
|
Pulled the changes to test image 16, I'll throw that in a separate PR. Took care of the last issue I had with coregraphics in f5abbb1, as long as I didn't break anything else in the process this branch is ready for review / merge. |
…as to not conflict with as_ref trait Edit: Fix typo in commit message
542b7c9 to
73a44fb
Compare
|
@longmathemagician can I go ahead and merge this? Or is it waiting on the updated test image 16? |
|
@jneem you're good to merge it, thank you. There are still a lot of issues with piet-coregraphics I never got around to tackling but this is at least an improvement over the current state. |


CoreGraphicsContext::draw_image_area() doesn't account for coregraphics' reversed y-axis, 086e8e6 fixes that by passing the cropped image to CoreGraphicsContext::draw_image() which does draw correctly.