]> git.mdlowis.com Git - proto/labwc.git/commitdiff
scaled_{img,scene}_buffer: add architecture graph
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Sun, 5 Jan 2025 16:28:06 +0000 (17:28 +0100)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Mon, 6 Jan 2025 03:39:09 +0000 (04:39 +0100)
include/common/scaled-img-buffer.h
include/common/scaled-scene-buffer.h

index 4f7b193cb616ff10535db0526f62e06ff25fe98e..d6ae02db96f3196bec946d75b347698606829010 100644 (file)
@@ -18,6 +18,43 @@ struct scaled_img_buffer {
        int padding;
 };
 
+/*
+ *                                                 |                 |
+ *                                       .------------------.  .------------.
+ *                   scaled_img_buffer   | new_output_scale |  | set_buffer |
+ *                     architecture      ´------------------`  ´------------`
+ *                                                 |                ^
+ *                .--------------------------------|----------------|-------------.
+ *                |                                v                |             |
+ *                |  .-------------------.    .-------------------------.         |
+ *                |  | scaled_img_buffer |----| wlr_buffer LRU cache(2) |<----,   |
+ *                |  ´-------------------`    ´-------------------------`     |   |
+ *                |            |                           |                  |   |
+ *                |            |               .--------------------------.   |   |
+ *                |            |               | wlr_buffer LRU cache of  |   |   |
+ *   .-------.    |            |               | other scaled_img_buffers |   |   |
+ *   | theme |    |            |               |   with lab_img_equal()   |   |   |
+ *   ´-------`    |            |               ´--------------------------`   |   |
+ *       |        |            |                  /              |            |   |
+ *       |        |            |             not found         found          |   |
+ *  .---------.   |        .---------.     .----------.    .------------.     |   |
+ *  | lab_img |-img_copy-->| lab_img |-----| render() |--->| wlr_buffer |-----`   |
+ *  ´---------`   |        ´---------`     ´----------`    ´------------`         |
+ *           \    |           /                                                   |
+ *            \   ´----------/----------------------------------------------------`
+ *             \            /
+ *           .----------------.                       lab_img provides:
+ *           |  lab_img_data  |                       - render function
+ *           |   refcount=2   |                       - list of modification functions
+ *           |                `-----------------.       to apply on top of lib_img_data
+ *           |                                  |       when rendering
+ *           | provides (depending on backend): |     - lab_img_equal() comparing the
+ *           | - librsvg handle                 |       lab_img_data reference and
+ *           | - cairo surface                  |       modification function pointers
+ *           ´----------------------------------`       of two given lab_img instances
+ *
+ */
+
 /*
  * Create an auto scaling image buffer, providing a wlr_scene_buffer node for
  * display. It gets destroyed automatically when the backing scaled_scene_buffer
index f1c1d1249c57ce735275b32dd83405a90436cab1..66d0df47b62e276250fb71b8ca70d3bc1f877dea 100644 (file)
@@ -45,6 +45,32 @@ struct scaled_scene_buffer {
        struct wl_list link; /* struct scaled_scene_buffer.cached_buffers */
 };
 
+/*
+ *                                  |                 |
+ *                        .------------------.  .------------.
+ *       scaled_buffer    | new_output_scale |  | set_buffer |
+ *       architecture     ´------------------`  ´------------`
+ *                                  |                ^
+ *    .-----------------------------|----------------|-----------.
+ *    |                             v                |           |
+ *    |  .---------------.    .-------------------------.        |
+ *    |  | scaled_buffer |----| wlr_buffer LRU cache(2) |<---,   |
+ *    |  ´---------------`    ´-------------------------`    |   |
+ *    |           |                       |                  |   |
+ *    |        .------.       .--------------------------.   |   |
+ *    |        | impl |       | wlr_buffer LRU cache of  |   |   |
+ *    |        ´------`       |   other scaled_buffers   |   |   |
+ *    |                       |   with impl->equal()     |   |   |
+ *    |                       ´--------------------------`   |   |
+ *    |                          /              |            |   |
+ *    |                   not found           found          |   |
+ *    |     .-----------------------.     .-----------.      |   |
+ *    |     | impl->create_buffer() |--->| wlr_buffer |------`   |
+ *    |     ´-----------------------`    ´------------`          |
+ *    |                                                          |
+ *    ´----------------------------------------------------------`
+ */
+
 /**
  * Create an auto scaling buffer that creates a wlr_scene_buffer
  * and subscribes to its output_enter and output_leave signals.