WhatsCanvas 0.1.14
·
226 commits
to master
since this release
Symmetric frame API and a documentation clarification that prevents a common "black screen" pitfall.
Breaking (pre-1.0)
-
Removed
Canvas::flush(). Drawing is now a symmetricbeginFrame()/endFrame()pair.Migration — replace every flush with endFrame:
canvas->beginFrame(); canvas->drawRect(/* ... */, paint); canvas->endFrame(); // was: canvas->flush(); canvas->readPixelsRGBA(pixels); // or savePixelsPPM("out.ppm")
endFrame()renders the recorded commands onto a freshly-cleared framebuffer, makes them readable, and consumes them. Call it exactly once per frame, right beforereadPixelsRGBA/present.
Changed
- Documented the offscreen frame lifecycle so the "black readback" pitfall is obvious: calling the frame-ender twice (or
beginFrame()after drawing) re-clears the buffer and yields an empty image. Added a Get Started "frame lifecycle" section and a Troubleshooting entry, and clarified thebeginFrame/endFrameAPI doc comments.
No other API changes. The internal renderer-level flush() (implementation detail) is unrelated and unchanged.
See the CHANGELOG.