@ -70,14 +70,14 @@ static void render_pass_add_texture(struct wlr_render_pass *wlr_pass,
} ) ;
} ) ;
}
}
// Rotate the final destination size into source coordinates
// Rotate the source size into destination coordinates
struct wlr_box orig_box ;
struct wlr_box src_box_transformed ;
wlr_box_transform ( & orig_box, & dst _box, options - > transform ,
wlr_box_transform ( & src_box_transformed, & src _box, options - > transform ,
buffer - > buffer - > width , buffer - > buffer - > height ) ;
buffer - > buffer - > width , buffer - > buffer - > height ) ;
if ( options - > transform ! = WL_OUTPUT_TRANSFORM_NORMAL | |
if ( options - > transform ! = WL_OUTPUT_TRANSFORM_NORMAL | |
orig_box. width ! = src _box. width | |
src_box_transformed. width ! = dst _box. width | |
orig_box. height ! = src _box. height ) {
src_box_transformed. height ! = dst _box. height ) {
// Cosinus/sinus values are extact integers for enum wl_output_transform entries
// Cosinus/sinus values are extact integers for enum wl_output_transform entries
int tr_cos = 1 , tr_sin = 0 , tr_x = 0 , tr_y = 0 ;
int tr_cos = 1 , tr_sin = 0 , tr_x = 0 , tr_y = 0 ;
switch ( options - > transform ) {
switch ( options - > transform ) {
@ -123,10 +123,10 @@ static void render_pass_add_texture(struct wlr_render_pass *wlr_pass,
// Apply scaling to get to the dst_box size. Because the scaling is applied last
// Apply scaling to get to the dst_box size. Because the scaling is applied last
// it depends on the whether the rotation swapped width and height, which is why
// it depends on the whether the rotation swapped width and height, which is why
// we use orig_box instead of dst _box.
// we use src_box_transformed instead of src _box.
pixman_transform_scale ( & transform , NULL ,
pixman_transform_scale ( & transform , NULL ,
pixman_double_to_fixed ( src_box . width / ( double ) orig _box. width ) ,
pixman_double_to_fixed ( src_box _transformed . width / ( double ) dst _box. width ) ,
pixman_double_to_fixed ( src_box . height / ( double ) orig _box. height ) ) ;
pixman_double_to_fixed ( src_box _transformed . height / ( double ) dst _box. height ) ) ;
// pixman rotates about the origin which again leaves everything outside of the
// pixman rotates about the origin which again leaves everything outside of the
// viewport. Translate the result so that its new top-left corner is back at the
// viewport. Translate the result so that its new top-left corner is back at the