Skip to content

test raster mark support for mixed opacity#2418

Merged
Fil merged 4 commits intomainfrom
fil/raster-opacity-cache
Apr 11, 2026
Merged

test raster mark support for mixed opacity#2418
Fil merged 4 commits intomainfrom
fil/raster-opacity-cache

Conversation

@Fil
Copy link
Copy Markdown
Contributor

@Fil Fil commented Apr 11, 2026

adopt globalCompositeOperation in the raster color converter

test the color converter cache for opacity

this does not appear to be faster, clearRect is probably super fast; but it conveys the intent better and avoids a looped operation

@Fil Fil requested a review from mbostock April 11, 2026 06:56
@Fil Fil enabled auto-merge (squash) April 11, 2026 06:57
Copy link
Copy Markdown
Member

@mbostock mbostock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think we should do this. In my experience, setting globalCompositeOperation typically makes the canvas much slower by disabling hardware acceleration. Also browsers haven’t always implemented compositing consistently. I don’t see any performance cost here, but I also don’t a benefit in terms of logical clarity, so I’d rather stick with the common path of clearRect.

Comment thread test/plots/raster-precision.ts Outdated
@mbostock mbostock changed the title globalCompositeOperation test raster mark support for mixed opacity Apr 11, 2026
Copy link
Copy Markdown
Member

@mbostock mbostock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the use of globalCompositeOperation and renamed the test (and made it slightly prettier).

@Fil Fil merged commit f262a76 into main Apr 11, 2026
1 check passed
@Fil Fil deleted the fil/raster-opacity-cache branch April 11, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants