Пример #1
0
void
WindowList::Paint(Canvas &canvas)
{
    const auto &list = this->list;

    auto begin = list.rbegin(), end = list.rend();

    /* find the last full window which covers all the other windows
       behind it */
    for (auto i = begin; i != end; ++i) {
        Window &child = **i;
        if (IsFullWindow(child, canvas.GetWidth(), canvas.GetHeight()))
            begin = i;
    }

    for (auto i = begin; i != end; ++i) {
        Window &child = **i;
        if (!child.IsVisible())
            continue;

        SubCanvas sub_canvas(canvas, { child.GetLeft(), child.GetTop() },
                             child.GetSize());
#ifdef USE_MEMORY_CANVAS
        if (sub_canvas.GetWidth() == 0 || sub_canvas.GetHeight() == 0)
            /* this child window is completely outside the physical
               screen */
            continue;
#endif

        child.Setup(sub_canvas);
        child.OnPaint(sub_canvas);
    }
}
Пример #2
0
void
WindowList::Paint(Canvas &canvas)
{
    const auto &list = this->list;

    auto begin = list.rbegin(), end = list.rend();

    /* find the last full window which covers all the other windows
       behind it */
    for (auto i = begin; i != end; ++i) {
        Window &child = **i;
        if (IsFullWindow(child, canvas.GetWidth(), canvas.GetHeight()))
            begin = i;
    }

    for (auto i = begin; i != end; ++i) {
        Window &child = **i;
        if (!child.IsVisible())
            continue;

        SubCanvas sub_canvas(canvas, { child.GetLeft(), child.GetTop() },
                             child.GetSize());
        child.Setup(sub_canvas);
        child.OnPaint(sub_canvas);
    }
}