Replaces pixelRef and origin in Bitmap. dx and dy specify the offset within the PixelRef pixels for the top-left corner of the bitmap. Asserts in debug builds if dx or dy are out of range. Pins dx and dy to legal range in release builds. The caller is responsible for ensuring that
(@Nullable PixelRef pixelRef, int dx, int dy)
| 657 | * @see <a href="https://fiddle.skia.org/c/@Bitmap_setPixelRef">https://fiddle.skia.org/c/@Bitmap_setPixelRef</a> |
| 658 | */ |
| 659 | @NotNull @Contract("_, _, _ -> this") |
| 660 | public Bitmap setPixelRef(@Nullable PixelRef pixelRef, int dx, int dy) { |
| 661 | try { |
| 662 | _imageInfo = null; |
| 663 | Stats.onNativeCall(); |
| 664 | _nSetPixelRef(_ptr, Native.getPtr(pixelRef), dx, dy); |
| 665 | return this; |
| 666 | } finally { |
| 667 | ReferenceUtil.reachabilityFence(pixelRef); |
| 668 | } |
| 669 | } |
| 670 | |
| 671 | /** |
| 672 | * Returns true if Bitmap can be drawn. |
no test coverage detected