MCPcopy Create free account
hub / github.com/WayfireWM/wayfire / framebuffer_box_from_geometry_box

Method framebuffer_box_from_geometry_box

src/render.cpp:286–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284}
285
286wlr_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
317wlr_box wf::render_target_t::framebuffer_box_from_geometry_box(wlr_box box) const
318{

Callers 9

add_textureMethod · 0.80
add_rectMethod · 0.80
damageMethod · 0.80
wayfire_zoom_screenClass · 0.80
wayfire_fisheyeClass · 0.80
copy_regionMethod · 0.80
prepare_blurMethod · 0.80
renderMethod · 0.80

Calls 2

swapFunction · 0.85

Tested by

no test coverage detected