MCPcopy Create free account
hub / github.com/OSSystems/EasySplash / draw_image

Method draw_image

src/g2d/g2d_display.cpp:187–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185
186
187void g2d_display::draw_image(image_handle const p_image_handle, long const p_x1, long const p_y1, long const p_x2, long const p_y2)
188{
189 m_g2d_fb_surface.left = p_x1;
190 m_g2d_fb_surface.top = p_y1;
191 m_g2d_fb_surface.right = p_x2 + 1;
192 m_g2d_fb_surface.bottom = p_y2 + 1;
193
194 g2d_image g2dimg;
195 g2dimg.m_g2d_buffer = reinterpret_cast < struct g2d_buf * > (p_image_handle);
196 auto iter = m_g2d_images.find(g2dimg);
197 g2dimg.m_g2d_buffer = nullptr;
198
199 if (iter == m_g2d_images.end())
200 {
201 LOG_MSG(error, "could not find image for given handle");
202 return;
203 }
204
205 if (g2d_blit(m_g2d_handle, const_cast < g2d_surface * > (&(iter->m_g2d_surface)), &m_g2d_fb_surface) != 0)
206 LOG_MSG(error, "blitting failed");
207
208 if (g2d_finish(m_g2d_handle) != 0)
209 LOG_MSG(error, "finishing g2d device operations failed");
210}
211
212
213void g2d_display::swap_buffers()

Callers 1

runMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected