| Summary: | Software renderer + viewport + cliprectangle | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Marcel Bakker <mna.bakker> |
| Component: | render | Assignee: | Sam Lantinga <slouken> |
| Status: | ASSIGNED --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | daniel.plakhotich |
| Version: | 2.0.5 | ||
| Hardware: | x86_64 | ||
| OS: | Windows 7 | ||
| Attachments: | clip test v2 | ||
|
Description
Marcel Bakker
2017-03-20 16:29:24 UTC
Created attachment 2714 [details] clip test v2 After adding a test file to bug #2700, this bug popped up. Completing the test file a little more, showed a few more rare use case problems. I could split this up into multiple reports if needed, copy-pasted from test file: (note that proposed fixes have not been tested) ----------------------- observed problems: (some of these have been reported) -software render + viewport + clip_rectangle , test 3,4,7 and 8 show this. + bug ID #3612 (SDL_render_sw.c, line 368, SW_UpdateClipRect(): viewport offset is missing) -software render + viewport + SDL_RenderReadPixels , the read offset is incorrect when a viewport is used , can test this with taking a screen shot from test 3,4,7 and 8. + (SDL_render_sw.c, line 842: viewport offset is added a second time) -Windows 7 opengl + SDL_RenderReadPixels does NOT correspond to what is shown , looks like its always a frame behind , screen shots taken will be an image from the previous test... press 'r' to force a repaint + ?Related? bug ID #3619 (different OS, debian did gave correct results for me) -SDL_SetRenderTarget(ren, target) + logical size a logical size is set by default , test 4 and 6 shows this, a logical-size is detected and used as a backup (line 212 in here) , only the first time it is drawn correctly, press 'r' to refresh + (SDL_render.c, line 1124: renderer->logical_w/h should be initialized to 0, not the texture->w/h) -opengl(es2) render + scale default render and target texture give different visual results , test 5,6 and 7,8 show this. + Draw primitives problems: note : SDL_RenderDrawRect() bugs are SDL_RenderDrawLines(multiple lines) bugs in reality. direct3d - windows { - SDL_RenderDrawRect top-left + bottom-left pixels are drawn 2 times } software - all { - SDL_RenderDrawLine 1 pixel lines are not drawn } opengl(es2) - debian 8 { - SDL_RenderDrawLine 1 pixel lines are not drawn (gles2 does draw them) - SDL_RenderDrawRect bottom-left pixel is drawn 2 times bottom-right pixel is NOT always drawn } all - renderers - tested { - SDL_RenderDrawRect 0*0 width/height draws a negative 2*2 rectangle 1*1 width/height is not drawn + SDL_RenderDrawRect() probably needs a few special checks... } I missed a few : software render + SDL_RenderFillRect A w or h with 0 will always MAX() up to 1 - SW_RenderFillRects() uses MAX(w/h,1) , tests 1 and 2 show this software render + viewport + clip-rect It seems the software renderer is using SDL_SetClipRect(), to set the viewport , this results in broken behavior if the clip-rect is used in combination with a viewport. , adding any draw call after the clip-rectangle usage in the test file, will ignore viewport settings and draw anywhere. |