MCPcopy Create free account
hub / github.com/KLayout/klayout / draw_text_layer

Method draw_text_layer

src/laybasic/laybasic/layRedrawThreadWorker.cc:1450–1487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1448}
1449
1450void
1451RedrawThreadWorker::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
1489void
1490RedrawThreadWorker::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)

Callers

nothing calls this directly

Calls 15

maxFunction · 0.85
safe_transformed_boxFunction · 0.85
draw_propstringMethod · 0.80
objectMethod · 0.80
yMethod · 0.80
skip_quadFunction · 0.70
emptyMethod · 0.45
bboxMethod · 0.45
cellMethod · 0.45
resetMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected