summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-04-19 10:10:41 -0600
committerBrian Paul <[email protected]>2010-04-19 10:10:47 -0600
commitc060265bdb953f0c9d73e60f08c53a2e3b1a1176 (patch)
treeae8c7474823fea0f7f0b59d6a2600717c3436799 /src
parentcf7d08b4434325220488d4c9e871e230bafd7b7c (diff)
st/mesa: invert scissor rect depending on FB orientation
Fixes fd.o bug 27715
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_atom_scissor.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mesa/state_tracker/st_atom_scissor.c b/src/mesa/state_tracker/st_atom_scissor.c
index 5e0c51cff0a..56b1383ae39 100644
--- a/src/mesa/state_tracker/st_atom_scissor.c
+++ b/src/mesa/state_tracker/st_atom_scissor.c
@@ -72,12 +72,15 @@ update_scissor( struct st_context *st )
scissor.minx = scissor.miny = scissor.maxx = scissor.maxy = 0;
}
- /* Now invert Y. Pipe drivers use the convention Y=0=top for surfaces
+ /* Now invert Y if needed.
+ * Gallium drivers use the convention Y=0=top for surfaces.
*/
- miny = fb->Height - scissor.maxy;
- maxy = fb->Height - scissor.miny;
- scissor.miny = miny;
- scissor.maxy = maxy;
+ if (st_fb_orientation(fb) == Y_0_TOP) {
+ miny = fb->Height - scissor.maxy;
+ maxy = fb->Height - scissor.miny;
+ scissor.miny = miny;
+ scissor.maxy = maxy;
+ }
if (memcmp(&scissor, &st->state.scissor, sizeof(scissor)) != 0) {
/* state has changed */