ConstantvaluesusedasparameterstoquickReject()calls.
Restoreeverythingwhenrestore()iscalled(standardsaveflags).
Constructanemptyrastercanvas.
Constructacanvaswiththespecifiedbitmaptodrawinto.
Setthecliptothedifferenceofthecurrentclipandthespecifiedpath.
Setthecliptothedifferenceofthecurrentclipandthespecifiedrectangle,whichisexpressedinlocalcoordinates.
Setthecliptothedifferenceofthecurrentclipandtheshader.
Intersectthecurrentclipwiththespecifiedpath.
Modifythecurrentclipwiththespecifiedpath.
Intersectthecurrentclipwiththespecifiedrectangle,whichisexpressedinlocalcoordinates.
Modifythecurrentclipwiththespecifiedrectangle,whichisexpressedinlocalcoordinates.
Modifythecurrentclipwiththespecifiedrectangle.
Intersectthecurrentclipwiththespecifiedshader.
Preconcatthecurrentmatrixwiththespecifiedmatrix.
DisablesZsupport,preventinganyRenderNodesdrawnafterthispointfrombeingvisuallyreorderedorhavingshadowsrendered.
Filltheentirecanvas'bitmap(restrictedtothecurrentclip)withthespecifiedARGBcolor,usingsrcoverporterduffmode.
Drawthespecifiedarc,whichwillbescaledtofitinsidethespecifiedoval.
Drawthebitmapusingthespecifiedmatrix.
Drawthespecifiedbitmap,scaling/translatingautomaticallytofillthedestinationrectangle.
Drawthespecifiedbitmap,withitstop/leftcornerat(x,y),usingthespecifiedpaint,transformedbythecurrentmatrix.
Treatthespecifiedarrayofcolorsasabitmap,anddrawit.
LegacyversionofdrawBitmap(int[]colors,...)thattookintsforx,y
Drawthebitmapthroughthemesh,wheremeshverticesareevenlydistributedacrossthebitmap.
Drawthespecifiedcircleusingthespecifiedpaint.
Filltheentirecanvas'bitmap(restrictedtothecurrentclip)withthespecifiedcolor,usingsrcoverporterduffmode.
Filltheentirecanvas'bitmap(restrictedtothecurrentclip)withthespecifiedcolorandblendmode.
Filltheentirecanvas'bitmap(restrictedtothecurrentclip)withthespecifiedcolorandporter-duffxfermode.
Drawsadoubleroundedrectangleusingthespecifiedpaint.
Drawarrayofglyphswithspecifiedfont.
Drawalinesegmentwiththespecifiedstartandstopx,ycoordinates,usingthespecifiedpaint.
Drawaseriesoflines.
Drawsameshobjecttothescreen.
Drawthespecifiedovalusingthespecifiedpaint.
Filltheentirecanvas'bitmap(restrictedtothecurrentclip)withthespecifiedpaint.
DrawsthespecifiedbitmapasanN-patch(mostoften,a9-patch.)
Drawthespecifiedpathusingthespecifiedpaint.
Savethecanvasstate,drawthepicture,andrestorethecanvasstate.
Drawthepicture,stretchedtofitintothedstrectangle.
HelperfordrawPoints()fordrawingasinglepoint.
HelperfordrawPoints()thatassumesyouwanttodrawtheentirearray
Drawaseriesofpoints.
Drawthetextinthearray,witheachcharacter'soriginspecifiedbytheposarray.
Filltheentirecanvas'bitmap(restrictedtothecurrentclip)withthespecifiedRGBcolor,usingsrcoverporterduffmode.
DrawthespecifiedRectusingthespecifiedPaint.
DrawthespecifiedRectusingthespecifiedpaint.
Drawsthegivenregionusingthegivenpaint.
DrawsthegivenRenderNode.
Drawthespecifiedround-rectusingthespecifiedpaint.
Drawthetext,withoriginat(x,y),usingthespecifiedpaint.
Drawthespecifiedrangeoftext,specifiedbystart/end,withitsoriginat(x,y),inthespecifiedPaint.
Drawthetext,withoriginat(x,y),usingthespecifiedpaint,alongthespecifiedpath.
Drawarunoftext,allinasingledirection,withoptionalcontextforcomplextextshaping.
Drawthearrayofvertices,interpretedastriangles(basedonmode).
EnablesZsupportwhichdefaultstodisabled.
Retrievetheboundsofthecurrentclip(inlocalcoordinates).
Returntheboundsofthecurrentclip(inlocalcoordinates)intheboundsparameter,andreturntrueifitisnon-empty.
Returnsthetargetdensityofthecanvas.
Returnstheheightofthecurrentdrawinglayer
Returnanewmatrixwithacopyofthecanvas'currenttransformationmatrix.
Return,inctm,thecurrenttransformationmatrix.
Returnsthemaximumallowedheightforbitmapsdrawnwiththiscanvas.
Returnsthemaximumallowedwidthforbitmapsdrawnwiththiscanvas.
Returnsthenumberofmatrix/clipstatesontheCanvas'privatestack.
Returnsthewidthofthecurrentdrawinglayer
IndicateswhetherthisCanvasuseshardwareacceleration.
Returntrueifthedevicethatthecurrentlayerdrawsintoisopaque(thatis,itdoesnotsupportper-pixelalpha).
Returntrueifthespecifiedpath,afterbeingtransformedbythecurrentmatrix,wouldliecompletelyoutsideofthecurrentclip.
Returntrueifthespecifiedrectangle,afterbeingtransformedbythecurrentmatrix,wouldliecompletelyoutsideofthecurrentclip.
Thiscallbalancesapreviouscalltosave(),andisusedtoremoveallmodificationstothematrix/clipstatesincethelastsavecall.
Efficientwaytopopanycallstosave()thathappenedafterthesavecountreachedsaveCount.
Preconcatthecurrentmatrixwiththespecifiedrotation.
Savesthecurrentmatrixandclipontoaprivatestack.
Thisbehavesthesameassave(),butinadditionitallocatesandredirectsdrawingtoanoffscreenrenderingtarget.
Thisbehavesthesameassave(),butinadditionitallocatesandredirectsdrawingtoanoffscreenbitmap.
HelperversionofsaveLayer()thattakes4valuesratherthanaRectF.
HelperforsaveLayerAlpha()thattakes4valuesinsteadofaRectF.
Preconcatthecurrentmatrixwiththespecifiedscale.
Specifyabitmapforthecanvastodrawinto.
SpecifiesthedensityforthisCanvas'backingbitmap.
Completelyreplacethecurrentmatrixwiththespecifiedmatrix.
Preconcatthecurrentmatrixwiththespecifiedskew.
Preconcatthecurrentmatrixwiththespecifiedtranslation
Note:forperformancereasons,itisstronglyrecommendedtopassthis-thecompletesetofflags-toanycalltosaveLayer()andsaveLayerAlpha()variants.
Note:allmethodsthatacceptthisflaghaveflaglessversionsthatareequivalenttopassingthisflag.
Theinitialtargetdensityofthecanvasisthesameasthegivenbitmap'sdensity.
Ifthestartangleisnegativeor>=360,thestartangleistreatedasstartanglemodulo360.
Ifthesweepangleis>=360,thentheovalisdrawncompletely.NotethatthisdiffersslightlyfromSkPath::arcTo,whichtreatsthesweepanglemodulo360.Ifthesweepangleisnegative,thesweepangleistreatedassweepanglemodulo360
Thearcisdrawnclockwise.Anangleof0degreescorrespondtothegeometricangleof0degrees(3o'clockonawatch.)
Note:ifthepaintcontainsamaskfilterthatgeneratesamaskwhichextendsbeyondthebitmap'soriginalwidth/height(e.g.BlurMaskFilter),thenthebitmapwillbedrawnasifitwereinaShaderwithCLAMPmode.Thusthecoloroutsideoftheoriginalwidth/heightwillbetheedgecolorreplicated.
Thisfunctionignoresthedensityassociatedwiththebitmap.Thisisbecausethesourceanddestinationrectanglecoordinatespacesareintheirrespectivedensities,somustalreadyhavetheappropriatescalingfactorapplied.
Ifthebitmapandcanvashavedifferentdensities,thisfunctionwilltakecareofautomaticallyscalingthebitmaptodrawatthesamedensityasthecanvas.
Treatthespecifiedarrayofcolorsasabitmap,anddrawit.Thisgivesthesameresultasfirstcreatingabitmapfromthearray,andthendrawingit,butthismethodavoidsexplicitlycreatingabitmapobjectwhichcanbemoreefficientifthecolorsarechangingoften.
SeeAlso
Notethatsincealineisalways"framed",theStyleisignoredinthepaint.
Degeneratelines(lengthis0)willnotbedrawn.
Therunoftextincludesthecharactersfromstarttoendinthetext.Inaddition,therangecontextStarttocontextEndisusedascontextforthepurposeofcomplextextshaping,suchasArabictextpotentiallyshapeddifferentlybasedonthetextnexttoit.
AlltextoutsidetherangecontextStart..contextEndisignored.Thetextbetweenstartandendwillbelaidoutanddrawn.Thecontextrangeisusefulforcontextualshaping,e.g.Kerning,Arabiccontexturalform.
ThedirectionoftherunisexplicitlyspecifiedbyisRtl.Thus,thismethodissuitableonlyforrunsofasingledirection.AlignmentofthetextisasdeterminedbythePaint'sTextAlignvalue.Further,0<=contextStart<=start<=end<=contextEnd<=text.lengthmustholdonentry.
Alsoseeandroid.graphics.Paint#getRunAdvanceforacorrespondingmethodtomeasurethetext;theadvancewidthofthetextdrawnmatchesthevalueobtainedfromthatmethod.
Anydrawreorderingwillnotbemovedbeforethiscall.Atypicalusageofthismightlooksomethinglike:
voiddraw(Canvascanvas){//Drawanybackgroundcontentcanvas.drawColor(backgroundColor);//BegindrawingthatmaybereorderedbasedoffofZcanvas.enableZ();for(RenderNodechild:children){canvas.drawRenderNode(child);}//EnddrawingthatmaybereorderedbasedoffofZcanvas.disableZ();//Drawanyoverlayscanvas.drawText("I'montopofeverything!",0,0,paint);}
Return,inctm,thecurrenttransformationmatrix.Thisdoesnotalterthematrixinthecanvas,butjustreturnsacopyofit.
Returntrueifthespecifiedpath,afterbeingtransformedbythecurrentmatrix,wouldliecompletelyoutsideofthecurrentclip.Callthistocheckifanareayouintendtodrawintoisclippedout(andthereforeyoucanskipmakingthedrawcalls).Note:forspeeditmayreturnfalseevenifthepathitselfmightnotintersecttheclip(i.e.theboundsofthepathintersects,butthepathdoesnot).
Returntrueifthespecifiedrectangle,afterbeingtransformedbythecurrentmatrix,wouldliecompletelyoutsideofthecurrentclip.Callthistocheckifanareayouintendtodrawintoisclippedout(andthereforeyoucanskipmakingthedrawcalls).
Subsequentcallstotranslate,scale,rotate,skew,concatorclipRect,clipPathwillalloperateasusual,butwhenthebalancingcalltorestore()ismade,thosecallswillbeforgotten,andthesettingsthatexistedbeforethesave()willbereinstated.
Alldrawingcallsaredirectedtoanewlyallocatedoffscreenrenderingtarget.Onlywhenthebalancingcalltorestore()ismade,isthatoffscreenbufferdrawnbacktothecurrenttargetoftheCanvas(whichcanpotentiallybeapreviouslayerifthesecallsarenested).
Alldrawingcallsaredirectedtoanewlyallocatedoffscreenbitmap.Onlywhenthebalancingcalltorestore()ismade,isthatoffscreenbufferdrawnbacktothecurrenttargetoftheCanvas(eitherthescreen,it'stargetBitmap,orthepreviouslayer).