| 1448 | } |
| 1449 | |
| 1450 | void |
| 1451 | RedrawThreadWorker::draw_text_layer (bool drawing_context, db::cell_index_type ci, const db::CplxTrans &trans, const std::vector<db::Box> &vp, int level) |
| 1452 | { |
| 1453 | if (! m_text_visible) { |
| 1454 | return; |
| 1455 | } |
| 1456 | |
| 1457 | unsigned int plane_group = 2; |
| 1458 | if (drawing_context) { |
| 1459 | plane_group = 0; |
| 1460 | } else if (m_child_context_enabled && level > 0) { |
| 1461 | plane_group = 1; |
| 1462 | } |
| 1463 | |
| 1464 | lay::CanvasPlane *fill = 0, *frame = 0, *text = 0, *vertex = 0; |
| 1465 | fill = m_planes[0 + plane_group * (planes_per_layer / 3)]; |
| 1466 | frame = m_planes[1 + plane_group * (planes_per_layer / 3)]; |
| 1467 | text = m_planes[2 + plane_group * (planes_per_layer / 3)]; |
| 1468 | vertex = m_planes[3 + plane_group * (planes_per_layer / 3)]; |
| 1469 | |
| 1470 | // do not draw, if there is nothing to draw |
| 1471 | if (mp_layout->cells () <= ci || vp.empty () || mp_layout->cell (ci).bbox (m_layer).empty ()) { |
| 1472 | return; |
| 1473 | } |
| 1474 | if (cell_var_cached (ci, trans)) { |
| 1475 | return; |
| 1476 | } |
| 1477 | |
| 1478 | std::unique_ptr<lay::Bitmap> opt_bitmap; |
| 1479 | lay::Bitmap *vertex_bitmap = dynamic_cast<lay::Bitmap *> (vertex); |
| 1480 | if (m_text_lazy_rendering && vertex_bitmap) { |
| 1481 | opt_bitmap.reset (new lay::Bitmap (vertex_bitmap->width (), vertex_bitmap->height (), vertex_bitmap->resolution (), vertex_bitmap->font_resolution ())); |
| 1482 | } |
| 1483 | |
| 1484 | for (std::vector<db::Box>::const_iterator b = vp.begin (); b != vp.end (); ++b) { |
| 1485 | draw_text_layer (drawing_context, ci, trans, *b, level, fill, frame, vertex, text, opt_bitmap.get ()); |
| 1486 | } |
| 1487 | } |
| 1488 | |
| 1489 | void |
| 1490 | RedrawThreadWorker::draw_text_layer (bool drawing_context, db::cell_index_type ci, const db::CplxTrans &trans, const db::Box &vp, int level, CanvasPlane *fill, CanvasPlane *frame, CanvasPlane *vertex, CanvasPlane *text, lay::Bitmap *opt_bitmap) |
nothing calls this directly
no test coverage detected