Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 491ed067 authored by Leon Scroggins III's avatar Leon Scroggins III Committed by Leon Scroggins
Browse files

Make Canvas#drawPatch public

Bug: 155422223
Bug: 155661807
Test: NinePatchTest#testDraw
Test: NinePatchDrawableTest#testDraw

As part of the move to a mainline module, code outside the module cannot
access @hidden APIs on Canvas. Although no code outside the module calls
these methods, there is a Canvas subclass that overrides it - NopCanvas,
which overrides it to do nothing. This is useful, and cannot be achieved
another way. (If NopCanvas did not override drawPatch, it would crash
when attempting to draw a NinePatchDrawable.)

In addition, this method is already public on RecordingCanvas. (This is
likely an accident; it contains no documentation for the method.)

Lastly, it is somewhat arbitrary that the way to draw a NinePatch
directly was to call NinePatch#draw. This is the reverse of how Canvas
drawing generally works. The newly public method matches the typical
pattern (Canvas#draw<Something>(Something, Paint)) and is already called
by NinePatch#draw.

Change-Id: I16d7dc7391e3ad5777fdd7023472545c6104af69
parent c357f974
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment