| 284 | } |
| 285 | |
| 286 | wlr_fbox wf::render_target_t::framebuffer_box_from_geometry_box(wlr_fbox box) const |
| 287 | { |
| 288 | /* Step 1: Make relative to the framebuffer */ |
| 289 | box.x -= this->geometry.x; |
| 290 | box.y -= this->geometry.y; |
| 291 | |
| 292 | /* Step 2: Apply scale to box */ |
| 293 | box = box * scale; |
| 294 | |
| 295 | /* Step 3: rotate */ |
| 296 | wf::dimensions_t size = get_size(); |
| 297 | if (wl_transform & 1) |
| 298 | { |
| 299 | std::swap(size.width, size.height); |
| 300 | } |
| 301 | |
| 302 | wlr_fbox result; |
| 303 | wl_output_transform transform = |
| 304 | wlr_output_transform_invert((wl_output_transform)wl_transform); |
| 305 | |
| 306 | wlr_fbox_transform(&result, &box, transform, size.width, size.height); |
| 307 | |
| 308 | if (subbuffer) |
| 309 | { |
| 310 | result = scale_fbox({0.0, 0.0, (double)get_size().width, (double)get_size().height}, |
| 311 | geometry_to_fbox(subbuffer.value()), result); |
| 312 | } |
| 313 | |
| 314 | return result; |
| 315 | } |
| 316 | |
| 317 | wlr_box wf::render_target_t::framebuffer_box_from_geometry_box(wlr_box box) const |
| 318 | { |
no test coverage detected