Skip to content

Fix Android.Graphics documentation errors (R040, pass 3) - #1924

Open
jonathanpeppers wants to merge 1 commit into
mainfrom
jonathanpeppers-review-android-graphics-docs
Open

jonathanpeppers wants to merge 1 commit into
mainfrom
jonathanpeppers-review-android-graphics-docs

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 84ff0a32c4ef07ef00e01e8d17f33d9ddfd37f88

Dimension Assessment Rationale
Change confidence 8/10 ↑ Reviewed all assigned in-scope blocks against pinned sources; Gemini, XML, preservation, and importer checks passed.
↓ Historical device behavior and documentation publishing were not run locally; three uncertainties remain unchanged.
Diagnosis confidence 8.5/10 ↑ Platform and binding sources support the corrections; an independent review found no issues.
↓ Some historical release ranges were sampled rather than tested on devices.
Evidence fit Unknown ↓ No specific user-reported symptom or reproduction was provided.

Scope

Third-pass review item R040 in Android.Graphics, after pass 2. I personally reviewed 999 of 999 in-scope changed Docs blocks, covering 2,185 of 2,185 channels in 116 assigned files. The inventory also found 157 blocks excluded by the campaign rules. This PR changes 272 channels in 56 files; 14 changed pre-AI channels correct contradictions within AI-changed blocks.

Corrections and evidence

The pinned Android SDK source archive has SHA-256 9d637c3af6654a2f1b696b3d19c54bb77e38df2b0106116934703f314b3d4e84. Paths and line numbers below refer to files within that archive unless linked separately.

  • Correct JNI ownership, writable Insets fields, Java array-field wrappers, managed array copies, and managed member names. See field-property generation, array generation, JNI ownership, and src/android/graphics/Insets.java:36-77.
  • Correct Bitmap color-space, alpha initialization, nullable-copy, recycle, equality, and exception descriptions; correct BitmapShaderFilterMode filtering behavior. See src/android/graphics/Bitmap.java, BitmapShader.java:55-82,216-223, and Android 8 Bitmap.
  • Correct BitmapFactory.Options legacy options, failure outputs, and reported dimensions. The Android 6 decoder, Android 7 decoder, and Android 17 decoder establish the checked behavior and version boundaries.
  • Correct ColorMatrix copy semantics, ColorObject component and packing behavior, ColorSpace gamut checks and named-space fallback, Adaptation, and render intents. Remove captions for absent diagrams. See ColorMatrix.java:86-118, Color.java:550-613,1040-1056, ColorSpace.java:892-923,1437-1448,2460-2485,3682-3685, and the Android 8 color-space implementation.
  • Restore the Rgb.TransferParameters equations and describe the constructor coefficients. Correct BlendMode overlap, alpha, and color-component descriptions. See ColorSpace.java:2460-2550 and the Android 16 Skia blend stages.
  • Correct Matrix inversion, identity, concatenation, and pre/post transform return descriptions. See Android 5 Matrix, Android 17 Matrix, and Android 2.3.7 Skia.
  • Correct Canvas legacy GL, clipping, save-layer flags, mesh target, and Z behavior. See Android 2.3.7 Canvas, Android 3.2 Canvas, Android 9 Canvas, and Canvas.java and RecordingCanvas.java in the archive.
  • Correct Path.Interpolate weights, compatibility, empty-path behavior, and version-specific returns; correct PathIterator end-marker documentation. See Android 14 Skia, Android 17 Skia, and Android 14 PathIterator.
  • Correct Outline.CanClip version behavior and remove the orphan OuterShadowOnly parameter. See Android 5, Android 12, and Android 13.
  • Correct mesh stride and varying limits, Ubyte4 interpretation, and indexed-triangle wording. See Mesh.java:106-125, MeshSpecification.java:143-148, Android 14 Skia mesh, and Android 17 Skia mesh.
  • Correct ImageDecoder source-array ownership, default and partial listeners, allocator restrictions, orientation-dependent size, allocation limits, and gainmap error handling. See ImageDecoder.java:224-236,653-658,814-844,1292-1327,1686-1702,1920-1946,2402-2413, the Android 17 implementation, and the installed Mono.Android 37.2.31 binding.
  • Correct frame-commit callback behavior for skipped frames and distinguish surface submission from display visibility. See Android 11 HardwareRenderer and Android 17 CanvasContext.
  • Correct RAW10/12/14 unpadded row strides and managed image-plane links; correct Format, ImageFormatType, and PixelFormat descriptions. See ImageFormat.java:413-466,580-810,987-995, PixelFormat.java:110-146, and Android 4.0.3 PixelFormat.
  • Correct Paint font-metrics overloads, locale metrics, cursor constants, and flag references. See Paint.java:173-261,451-489,2390-2414 and Android 15 Paint.
  • Correct legacy transfer-mode and rasterizer behavior, and clarify Picture, Movie, Interpolator, NinePatch, Point, and parcel descriptions. See Android 6 AvoidXfermode, Android 7 AvoidXfermode, Android 7.1 LayerRasterizer, Android 8 LayerRasterizer, and NinePatch.java:143-164, Point.java:149-155, and Parcelable.java:200-206.

The campaign ledger records the member, channel, source lines, and checked fact for each reviewed channel.

Pass-2 recheck

Rechecked #1727 and its reviews. This PR resolves the managed Insets setter and Outline.OuterShadowOnly orphan-parameter findings. Android 17 source still checks Flags.imageDecoderDefaultListener(); the CP2A release configuration enables it read-only. The earlier PR body's statement that the flag was absent from source was incorrect.

Uncertain findings (unchanged)

  • ColorSpace.Rgb.GetMinValue(int) and GetMaxValue(int): the inherited annotation permits component indexes 0–3, while RGB has three components and the overrides ignore the argument. It is unclear whether to document the inherited annotation or valid RGB indexes. See ColorSpace.java:1117-1138,3428-3439 in the pinned archive.
  • Matrix pre/post transform returns: Android 5 and later return true after normal completion, but the earliest release where every operation does so is not established. The Android 3.2 wrapper returns native results; older Skia supports different scalar configurations. The documentation states the verified Android 5+ range.

Checks

  • Parsed all 116 scoped XML files; no placeholders, API metadata changes, or attribution changes.
  • Verified unchanged bytes outside approved Docs channels, original BOMs and line endings, and 46 new exact DocIds.
  • Compared attributed Javadoc and source reference links against the pinned archive; no missing sources or new wrong-overload links.
  • Isolated tools\importer.cs --self-test passed; git diff --check passed.
  • gemini-4-argon independently reviewed the full diff and the final follow-up; no findings. The local usage log records the requested model.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 26, 2026 08:36
@jonathanpeppers
jonathanpeppers enabled auto-merge (squash) November 26, 2026 08:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The extensive historical Android version boundaries and native graphics contracts could not be independently verified against pinned AOSP/SDK sources and require platform-maintainer validation.

No open issues 🎉

What changed in this PR

This documentation-only follow-up to #1727 refines the .NET Android.Graphics API reference to reflect managed binding semantics and Android version differences. It does not change runtime code or API declarations.

Changes:

  • Clarifies native-reference handling, managed array copies, and writable properties.
  • Corrects decoding, rendering, color-space, and geometry contracts, including version-specific behavior.
  • Repairs managed API links, restores transfer-function equations, and removes stale documentation text.
File Description
docs/​xml/​Android.Graphics/​Point.xml Links the parcel creator to the managed point type.
docs/​xml/​Android.Graphics/​PixelXorXfermode.xml Clarifies when XOR behavior became inactive.
docs/​xml/​Android.Graphics/​PixelFormat.xml Clarifies stored bit and byte counts.
docs/​xml/​Android.Graphics/​Picture.xml Documents decoding failures and task faults.
docs/​xml/​Android.Graphics/​PathIterator+Segment.xml Clarifies native-reference handling.
docs/​xml/​Android.Graphics/​PathIterator.xml Documents end markers and allocation behavior.
docs/​xml/​Android.Graphics/​Path.xml Corrects interpolation weights and version-specific results.
docs/​xml/​Android.Graphics/​ParcelableColorSpace.xml Corrects parcel documentation wording.
docs/​xml/​Android.Graphics/​PaintFlags.xml Improves flag references and vertical-text guidance.
docs/​xml/​Android.Graphics/​Paint.xml Corrects font-metrics overload descriptions and links.
docs/​xml/​Android.Graphics/​Outline.xml Clarifies clipping support and removes an orphan parameter.
docs/​xml/​Android.Graphics/​NinePatch.xml Clarifies when the stored paint is null.
docs/​xml/​Android.Graphics/​Movie.xml Clarifies the GIF decoder’s opacity report.
docs/​xml/​Android.Graphics/​MeshType.xml Clarifies indexed triangle vertex reuse.
docs/​xml/​Android.Graphics/​MeshSpecificationType.xml Distinguishes attribute and varying type interpretations.
docs/​xml/​Android.Graphics/​MeshSpecification+Varying.xml Clarifies native-reference handling.
docs/​xml/​Android.Graphics/​MeshSpecification+Attribute.xml Clarifies native-reference handling.
docs/​xml/​Android.Graphics/​MeshSpecification.xml Corrects stride requirements and varying limits.
docs/​xml/​Android.Graphics/​Mesh.xml Clarifies native-reference handling.
docs/​xml/​Android.Graphics/​Matrix44.xml Clarifies native-reference handling.
docs/​xml/​Android.Graphics/​Matrix.xml Corrects inversion, shared identity, and return contracts.
docs/​xml/​Android.Graphics/​LayerRasterizer.xml Documents legacy behavior and later no-op implementations.
docs/​xml/​Android.Graphics/​Interpolator+Result.xml Qualifies results at exact key-frame times.
docs/​xml/​Android.Graphics/​Insets.xml Documents writable offsets and shared-instance mutability.
docs/​xml/​Android.Graphics/​ImageFormatType.xml Corrects packed row strides and image-plane references.
docs/​xml/​Android.Graphics/​ImageFormat.xml Corrects RAW14 row stride and plane references.
docs/​xml/​Android.Graphics/​ImageDecoderMemoryPolicy.xml Clarifies memory policies and configuration links.
docs/​xml/​Android.Graphics/​ImageDecoderErrorType.xml Documents conditions for gainmap error delivery.
docs/​xml/​Android.Graphics/​ImageDecoderAllocator.xml Clarifies hardware restrictions and animated drawable behavior.
docs/​xml/​Android.Graphics/​ImageDecoder+Source.xml Clarifies native-reference handling.
docs/​xml/​Android.Graphics/​ImageDecoder+IOnPartialImageListener.xml Clarifies partial-image acceptance and exception behavior.
docs/​xml/​Android.Graphics/​ImageDecoder+ImageInfo.xml Notes orientation-dependent dimensions and reference handling.
docs/​xml/​Android.Graphics/​ImageDecoder+DecodeException.xml Clarifies gainmap failure handling.
docs/​xml/​Android.Graphics/​ImageDecoder.xml Documents array copies, default listeners, and allocation limits.
docs/​xml/​Android.Graphics/​HardwareRenderer+FrameRenderRequest.xml Distinguishes frame submission, callbacks, and display visibility.
docs/​xml/​Android.Graphics/​HardwareRenderer.xml Clarifies native-reference handling.
docs/​xml/​Android.Graphics/​HardwareBufferRenderer.xml Clarifies native-reference handling.
docs/​xml/​Android.Graphics/​Format.xml Links deprecated constants to managed image-format equivalents.
docs/​xml/​Android.Graphics/​Cursor.xml Uses the managed paint method name.
docs/​xml/​Android.Graphics/​ColorSpace+Rgb+TransferParameters.xml Restores equations and explains their coefficients.
docs/​xml/​Android.Graphics/​ColorSpace+Rgb.xml Corrects wide-gamut criteria and wording.
docs/​xml/​Android.Graphics/​ColorSpace+RenderIntent.xml Distinguishes intended rendering intents from implemented behavior.
docs/​xml/​Android.Graphics/​ColorSpace+Named.xml Removes orphan captions and documents Oklab fallback.
docs/​xml/​Android.Graphics/​ColorSpace+Connector.xml Clarifies native-reference handling.
docs/​xml/​Android.Graphics/​ColorSpace+Adaptation.xml Corrects “adaptation” spelling.
docs/​xml/​Android.Graphics/​ColorSpace.xml Clarifies adaptation, named-space fallback, and gamut criteria.
docs/​xml/​Android.Graphics/​ColorObject.xml Corrects component indexing and packing descriptions.
docs/​xml/​Android.Graphics/​ColorMatrix.xml Documents managed copies and the 20-value assignment limit.
docs/​xml/​Android.Graphics/​Canvas+EdgeType.xml Identifies when edge choices became ignored.
docs/​xml/​Android.Graphics/​Canvas.xml Corrects legacy APIs, layer flags, drawing targets, and Z support.
docs/​xml/​Android.Graphics/​BlendMode.xml Corrects overlap, alpha, and color-result descriptions.
docs/​xml/​Android.Graphics/​BitmapShaderFilterMode.xml Uses managed filtering property and enum links.
docs/​xml/​Android.Graphics/​BitmapFactory+Options.xml Clarifies legacy options, output configuration, and dimensions.
docs/​xml/​Android.Graphics/​Bitmap.xml Corrects creation, color-space, recycling, and equality contracts.
docs/​xml/​Android.Graphics/​AvoidXfermode+Mode.xml Documents when historical blending modes became inactive.
docs/​xml/​Android.Graphics/​AvoidXfermode.xml Clarifies legacy constructor behavior and retained validation.

Review effort: Balanced

@jonathanpeppers

Copy link
Copy Markdown
Member Author

@dalexsoto review

@dalexsoto

Copy link
Copy Markdown
Member

In response to @jonathanpeppers's request: At 84ff0a3, the Insets property wording matches the managed signatures and pinned field-property generator. I still need to verify the remaining Bitmap.xml changes (including CreateBitmap(Picture, ...) null returns and platform-specific color-space behavior), the rest of ColorSpace+Rgb+TransferParameters.xml, and the other 53 changed files against their relevant sources. These are gaps in my review coverage, not defects established in the PR. The exact revision and completed reads are retained for the next scheduled pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants