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

Method take_snapshot

src/view/view.cpp:94–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94void wf::view_interface_t::take_snapshot(wf::auxilliary_buffer_t& buffer)
95{
96 auto root_node = get_surface_root_node();
97 const wf::geometry_t bbox = root_node->get_bounding_box();
98 float scale = get_output()->handle->scale;
99 buffer.allocate(wf::dimensions(bbox), scale);
100
101 wf::render_target_t target{buffer};
102 target.geometry = bbox;
103 target.scale = scale;
104
105 std::vector<scene::render_instance_uptr> instances;
106 root_node->gen_render_instances(instances, [] (auto) {}, get_output());
107
108 render_pass_params_t params;
109 params.background_color = {0, 0, 0, 0};
110 params.damage = bbox;
111 params.target = target;
112 params.instances = &instances;
113 params.flags = RPASS_CLEAR_BACKGROUND;
114 render_pass_t::run(params);
115}
116
117wf::view_interface_t::view_interface_t()
118{

Callers 1

Calls 3

get_bounding_boxMethod · 0.45
allocateMethod · 0.45
gen_render_instancesMethod · 0.45

Tested by

no test coverage detected