-
-
Notifications
You must be signed in to change notification settings - Fork 4k
fix(canvas): clarify parameter names for lv_canvas_copy_buf #9414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Hi 👋, thank you for your PR! We've run benchmarks in an emulated environment. Here are the results: ARM Emulated 32b - lv_conf_perf32b
Detailed Results Per Scene
ARM Emulated 64b - lv_conf_perf64b
Detailed Results Per Scene
Disclaimer: These benchmarks were run in an emulated environment using QEMU with instruction counting mode. 🤖 This comment was automatically generated by a bot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 issues found across 3 files
Prompt for AI agents (all 2 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="docs/src/widgets/canvas.rst">
<violation number="1" location="docs/src/widgets/canvas.rst:76">
P2: Documentation inaccuracy: the assertion in `lv_canvas_copy_buf` requires `canvas_area` to be non-NULL. Only `src_area` can be omitted with NULL, not both areas. Consider clarifying to: "If the buffers are the same size, `src_area` can be omitted with NULL."</violation>
</file>
<file name="src/widgets/canvas/lv_canvas.h">
<violation number="1" location="src/widgets/canvas/lv_canvas.h:139">
P2: Documentation inconsistency: `src_area` description says "destination buffer" but should say "source buffer" to match the renamed parameter.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Ask questions if you need clarification on any suggestion
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
uLipe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except from the bot comments LGTM.
|
@uLipe not sure why the build failed? I dont see any messages besides a general failure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR clarifies the parameter names of lv_canvas_copy_buf to accurately reflect its behavior: copying data FROM a source buffer TO the canvas, rather than the misleading previous naming that suggested the opposite direction.
Key Changes:
- Renamed function parameters from
dest_buf/dest_areatosrc_buf/src_areato correctly indicate the copy direction - Updated function documentation to clearly describe that data is copied from the source buffer to the canvas
- Synchronized the documentation example with the updated function signature
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/widgets/canvas/lv_canvas.h |
Updated function signature and documentation comments to rename parameters from dest_buf/dest_area to src_buf/src_area, clarifying the copy direction |
src/widgets/canvas/lv_canvas.c |
Updated function implementation to use renamed parameters consistently throughout the function body including assertions and the lv_draw_buf_copy call |
docs/src/widgets/canvas.rst |
Updated documentation example to reflect the corrected function signature with proper parameter names |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| color format of the buffer and Canvas need to match. If the canvas area and source buffer | ||
| are the same size, the source area can be left NULL. |
Copilot
AI
Dec 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wording "If the canvas area and source buffer are the same size" could be clearer. Consider aligning with the header documentation which states "If canvas_area and the size of src_buf are the same, src_area can be left NULL." The current wording might be interpreted as comparing areas directly rather than comparing the canvas area with the buffer dimensions.
| color format of the buffer and Canvas need to match. If the canvas area and source buffer | |
| are the same size, the source area can be left NULL. | |
| color format of the buffer and Canvas need to match. If ``canvas_area`` and the size of ``src_buf`` | |
| are the same, ``src_area`` can be left NULL. |
Fixes #9279
Previously the parameters of
lv_canvas_copy_bufimplied it copies data from a canvas to a second buffer. In reality, it copies from the second buffer to the canvas. I have updated these parameters to align with what is happening.Also, the canvas widget main page mentioned this function, but the signature was out of date. I have updated this as well.