mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
[text-backface-culling] Fix width/height parameters to cogl_rectangle
During the upgrade to cogl material, test-backface-culling was switched to use cogl_rectangle instead of cogl_texture_rectangle to draw the textures. However, cogl_rectangle takes a width and height instead of the the top-left and bottom-right vertices so the rectangles were being drawn in the wrong place.
This commit is contained in:
parent
e72042648c
commit
561c441241
@ -128,14 +128,14 @@ on_paint (ClutterActor *actor, TestState *state)
|
||||
|
||||
/* Draw a front-facing texture */
|
||||
cogl_set_source_texture (state->texture);
|
||||
cogl_rectangle (x1, y1, x2, y2);
|
||||
cogl_rectangle (x1, y1, x2 - x1, y2 - y1);
|
||||
|
||||
x1 = x2;
|
||||
x2 = x1 + (float)(TEXTURE_SIZE);
|
||||
|
||||
/* Draw a back-facing texture */
|
||||
cogl_set_source_texture (state->texture);
|
||||
cogl_rectangle (x2, y1, x1, y2);
|
||||
cogl_rectangle (x2, y1, x1 - x2, y2 - y1);
|
||||
|
||||
x1 = x2;
|
||||
x2 = x1 + (float)(TEXTURE_SIZE);
|
||||
@ -172,8 +172,7 @@ on_paint (ClutterActor *actor, TestState *state)
|
||||
|
||||
/* Draw a regular rectangle (this should always show) */
|
||||
cogl_set_source_color4f (1.0, 0, 0, 1.0);
|
||||
cogl_rectangle ( (x1), (y1),
|
||||
(x2 - x1), (y2 - y1));
|
||||
cogl_rectangle (x1, y1, x2 - x1, y2 - y1);
|
||||
|
||||
/* The second time round draw beneath the first with backface
|
||||
culling disabled */
|
||||
|
Loading…
Reference in New Issue
Block a user