Repository navigation
Fix documentation errors in Android.Graphics Canvas (R040b) - #1656
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the Canvas parameter documentation corrections.
No open issues 🎉
What changed in this PR
Corrects two parameter descriptions in Android.Graphics.Canvas, aligning them with the sibling RecordingCanvas fixes in #1645. This PR changes documentation only.
Changes:
- Replaces the Android 16-specific
hasAlphadescription with the official alpha-channel behavior. - Corrects
innerRyto refer to the inner rectangle rather than the outer rectangle.
| File | Description |
|---|---|
docs/xml/Android.Graphics/Canvas.xml |
Corrects parameter documentation for DrawBitmap and DrawDoubleRoundRect. |
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
@dalexsoto review |
dalexsoto
left a comment
There was a problem hiding this comment.
Reviewed 2dc1949f against main at 283f094d. This is a static, read-only review.
DrawBitmap(int[], int, int, int, int, int, int, bool, Paint)hasAlpha: the new text is the upstream@param hasAlphaof thefloatoverload. Theintoverload forwards to it throughBaseCanvas.drawBitmapandnDrawBitmap, and the text now matchesRecordingCanvas.xml.DrawDoubleRoundRectinnerRyandinnerRadii: "inner" is correct.BaseCanvas.drawDoubleRoundRectpassesinnerRx/innerRyandinnerRadiiwith theinnerbounds to the inner parameters ofnDrawDoubleRoundRect, so the upstream "outer" wording is a Javadoc typo.- Blocking,
Canvas.xml:1048(ClipRegion(Region, Region.Op)returns): with "Android 16" removed, the text now says the method always returnsfalsewithout changing the clip. Thatreturn false;body is the stub added when the API became@removedin API level 26 (android-8.0.0_r1Canvas.java:981-984; both overloads are incore/api/removed.txt). Before API level 26 it callednative_clipRegion(...)and returned whether the resulting clip is non-empty (android-7.1.2_r1Canvas.java:818-821). - This member is marked
[UnsupportedOSPlatform("android26.0")], so the new text is wrong on every API level where it is supported. It also contradicts the one-argumentClipRegion(Region)atCanvas.xml:986, which has the same history and says "true if the resulting is non-empty". - Suggested fix: restore the upstream return text, for example
<see langword="true" /> if the resulting clip is non-empty., optionally followed by a note that on API level 26 and later the method does not change the clip and returns<see langword="false" />. - The rest of the diff is clean. The four single-line replacements parse, BOM state and line endings are unchanged, and
Canvas.xmlhas not changed onmainafter the merge baseb91969a6.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Thanks. Fixed in c420847: the |
|
@dalexsoto review |
dalexsoto
left a comment
There was a problem hiding this comment.
Reviewed c4208472 against main at ab3994d8. This is a static, read-only review.
- The blocker from my earlier review is resolved.
Canvas.ClipRegion(Region, Region.Op)returns now saystrueif the resulting clip is non-empty, and that on API level 26 and later the method does not change the clip and returnsfalse. This matches android-7.1.2_r1Canvas.java(@return true if the resulting is non-empty, returnsnative_clipRegion(...)) and the@removedstub that returnsfalsein android-8.0.0_r1 and currentmain(listed incore/api/removed.txt). It also matches the member's[UnsupportedOSPlatform("android26.0")]and theClipRegion(Region)returns text. DrawBitmap(int[], int, int, int, int, int, int, bool, Paint)hasAlphanow uses the official text of the float overload. InBaseCanvas.javathe int overload forwards to the float overload, which passeshasAlphatonDrawBitmap. The text also matches the float overload andRecordingCanvas.xml.DrawDoubleRoundRectinnerRadiiandinnerRynow say "inner" instead of the upstream "outer" typo.BaseCanvas.javapasses both values with the innerRectFtonDrawDoubleRoundRect.- The diff against the merge base
b91969a6is exactly these 4 lines indocs/xml/Android.Graphics/Canvas.xml. The file still parses, the BOM and line endings are unchanged, and noAndroid.Graphicsfile changed onmainsince the merge base. - No blocking issues found.
Scope
Follow-up review item R040b:
docs/xml/Android.Graphics/Canvas.xml. It fixes the two members that had the same errors that #1645 fixed in siblingRecordingCanvas.xml, plus two related findings in the same file (scope extended by the campaign coordinator).Fixes
Source:
source-37.2_r01.zip(SHA2569D637C3AF6654A2F1B696B3D19C54BB77E38DF2B0106116934703F314B3D4E84).Canvas.DrawBitmap(int[], int, int, int, int, int, int, bool, Paint)hasAlpha: the AI text limited the behavior to "the Android 16 implementation", which is the wrong scope for these API 37 docs. Theintoverload calls thefloatoverload (Canvas.java:1688-1696,BaseCanvas.java:216-221), which sendshasAlphatonDrawBitmap(BaseCanvas.java:187-213). The new text is the official@param hasAlphatext of thefloatoverload (Canvas.java:1669-1670), the same as Fix documentation errors in Android.Graphics (R138) #1645.Canvas.DrawDoubleRoundRect(RectF, float, float, RectF, float, float, Paint)innerRy: "outer rectangle" changed to "inner rectangle". This is an upstream Javadoc typo (Canvas.java:2086).BaseCanvas.java:412-428sendsinnerRxandinnerRywith theinnerbounds to the inner parameters ofnDrawDoubleRoundRect(BaseCanvas.java:797-800). The siblinginnerRxtext says "inner".Canvas.ClipRegion(Region, Region.Op)returns: the old text said "The Android 16 base compatibility implementation returns false without changing the clip". That is wrong on the API levels where the member is supported (it has[UnsupportedOSPlatform("android26.0")]). Before API level 26 it callednative_clipRegionand returned whether the resulting clip is non-empty (AOSPandroid-7.1.2_r1Canvas.java). From API level 26 it is a@removedstub that returnsfalse(AOSPandroid-8.0.0_r1Canvas.java;source-37.2_r01.zipCanvas.java:1110-1114). New text:trueif the resulting clip is non-empty; on API level 26 and later the method does not change the clip and returnsfalse. This agrees with the one-argumentClipRegion(Region).Canvas.DrawDoubleRoundRect(RectF, float[], RectF, float[], Paint)innerRadii: "outer rounded rectangle" changed to "inner rounded rectangle". This is an upstream Javadoc typo (Canvas.java:2105-2112).BaseCanvas.java:433-452sendsinnerRadiiwith theinnerbounds to the inner parameters ofnDrawDoubleRoundRect(BaseCanvas.java:802-804).Uncertain findings
None.
Checks
git diff --checkis clean; no new placeholders; BOM and CRLF line endings kept; 4-line diff.