diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fb.c | 4 | ||||
-rw-r--r-- | src/fb.h | 2 | ||||
-rw-r--r-- | src/modules/julia/julia.c | 2 |
3 files changed, 7 insertions, 1 deletions
@@ -172,7 +172,9 @@ static void fb_page_new(fb_t *fb, drmModeModeInfoPtr mode) page->public_page.fragment.buf = map; page->public_page.fragment.width = mode->hdisplay; + page->public_page.fragment.frame_width = mode->hdisplay; page->public_page.fragment.height = mode->vdisplay; + page->public_page.fragment.frame_height = mode->vdisplay; page->public_page.fragment.stride = create_dumb.pitch - (mode->hdisplay * 4); page->next = fb->inactive_pages; @@ -338,6 +340,8 @@ void fb_fragment_divide(fb_fragment_t *fragment, unsigned n_fragments, fb_fragme fragments[i].y = y; fragments[i].width = fragment->width; fragments[i].height = slice; + fragments[i].frame_width = fragment->frame_width; + fragments[i].frame_height = fragment->frame_height; fragments[i].stride = fragment->stride; buf += pitch * slice; @@ -14,6 +14,8 @@ typedef struct fb_fragment_t { uint32_t *buf; /* pointer to the first pixel in the fragment */ unsigned x, y; /* absolute coordinates of the upper left corner of this fragment */ unsigned width, height; /* width and height of this fragment */ + unsigned frame_width; /* width of the frame this fragment is part of */ + unsigned frame_height; /* height of the frame this fragment is part of */ unsigned stride; /* number of bytes from the end of one row to the start of the next */ } fb_fragment_t; diff --git a/src/modules/julia/julia.c b/src/modules/julia/julia.c index 9e3dba2..ed8e30c 100644 --- a/src/modules/julia/julia.c +++ b/src/modules/julia/julia.c @@ -86,7 +86,7 @@ static void julia_render_fragment(fb_fragment_t *fragment) unsigned stride = fragment->stride / 4, width = fragment->width, height = fragment->height; uint32_t *buf = fragment->buf; float real, imag; - float realstep = 3.6f / (float)width, imagstep = 3.6f / (float)height; + float realstep = 3.6f / (float)fragment->frame_width, imagstep = 3.6f / (float)fragment->frame_height; /* Rather than just sweeping creal,cimag from -2.0-+2.0, I try to keep things confined * to an interesting (visually) range. TODO: could certainly use refinement. |