mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
examples: fixed an incorrect buffer size.
adjusted the size according to the offsets.
This commit is contained in:
parent
1a795e2ed4
commit
ff2cacd25d
1 changed files with 5 additions and 1 deletions
|
@ -103,7 +103,11 @@ void runSw()
|
|||
|
||||
for (int counter = 0; counter < NUM_PER_LINE * NUM_PER_LINE; ++counter) {
|
||||
auto canvas = tvg::SwCanvas::gen();
|
||||
tvgexam::verify(canvas->target((uint32_t*)surface->pixels + SIZE * (counter / NUM_PER_LINE) * (surface->pitch / 4) + (counter % NUM_PER_LINE) * SIZE, surface->w, surface->pitch / 4, surface->h, tvg::SwCanvas::ARGB8888));
|
||||
auto offx = (counter % NUM_PER_LINE) * SIZE;
|
||||
auto offy = SIZE * (counter / NUM_PER_LINE);
|
||||
auto w = surface->w - offx;
|
||||
auto h = surface->h - offy;
|
||||
tvgexam::verify(canvas->target((uint32_t*)surface->pixels + offy * (surface->pitch / 4) + offx, surface->pitch / 4, w, h, tvg::SwCanvas::ARGB8888));
|
||||
content(canvas.get());
|
||||
if (tvgexam::verify(canvas->draw())) {
|
||||
tvgexam::verify(canvas->sync());
|
||||
|
|
Loading…
Add table
Reference in a new issue