Auto merge of #6985 - dzbarsky:drawimage_refactor, r=jdm
Auto merge of #6985 - dzbarsky:drawimage_refactor, r=jdm

Refactor DrawImage implementations to avoid code duplication



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6985)
<!-- Reviewable:end -->

youprofit/servo,splav/servo,bjwbell/servo,KiChjang/servo,zentner-kyle/servo,mbrubeck/servo,rnestler/servo,emilio/servo,dhananjay92/servo,steveklabnik/servo,ConnorGBrewster/servo,caldwell/servo,dagnir/servo,wartman4404/servo,zentner-kyle/servo,j3parker/servo,sadmansk/servo,dsandeephegde/servo,WriterOfAlicrow/servo,brendandahl/servo,GyrosOfWar/servo,dagnir/servo,bjwbell/servo,emilio/servo,dsandeephegde/servo,jdramani/servo,nnethercote/servo,thiagopnts/servo,jdramani/servo,brendandahl/servo,CJ8664/servo,saneyuki/servo,aidanhs/servo,KiChjang/servo,CJ8664/servo,SimonSapin/servo,SimonSapin/servo,A-deLuna/servo,jdramani/servo,szeged/servo,eddyb/servo,avadacatavra/servo,kindersung/servo,wartman4404/servo,sadmansk/servo,szeged/servo,g-k/servo,kindersung/servo,anthgur/servo,notriddle/servo,larsbergstrom/servo,g-k/servo,nnethercote/servo,kindersung/servo,AnthonyBroadCrawford/servo,AnthonyBroadCrawford/servo,sadmansk/servo,AnthonyBroadCrawford/servo,paulrouget/servo,paulrouget/servo,peterjoel/servo,ConnorGBrewster/servo,j3parker/servo,anthgur/servo,DominoTree/servo,tafia/servo,huonw/servo,jimberlage/servo,mbrubeck/servo,jdramani/servo,eddyb/servo,wartman4404/servo,rnestler/servo,rentongzhang/servo,huonw/servo,SimonSapin/servo,splav/servo,zentner-kyle/servo,aidanhs/servo,avadacatavra/servo,SimonSapin/servo,eddyb/servo,CJ8664/servo,cbrewster/servo,runarberg/servo,KiChjang/servo,canaltinova/servo,pyfisch/servo,ConnorGBrewster/servo,A-deLuna/servo,tafia/servo,anthgur/servo,peterjoel/servo,codemac/servo,jimberlage/servo,larsbergstrom/servo,dsandeephegde/servo,SimonSapin/servo,boghison/servo,codemac/servo,mattnenterprise/servo,upsuper/servo,codemac/servo,upsuper/servo,akosel/servo,nnethercote/servo,notriddle/servo,meh/servo,upsuper/servo,larsbergstrom/servo,splav/servo,youprofit/servo,runarberg/servo,dvberkel/servo,eddyb/servo,saneyuki/servo,GyrosOfWar/servo,boghison/servo,anthgur/servo,jimberlage/servo,fiji-flo/servo,avadacatavra/servo,nrc/servo,DominoTree/servo,vks/servo,nick-thompson/servo,DominoTree/servo,RenaudParis/servo,g-k/servo,splav/servo,sadmansk/servo,rnestler/servo,codemac/servo,brendandahl/servo,eddyb/servo,mdibaiee/servo,upsuper/servo,dsandeephegde/servo,saneyuki/servo,paulrouget/servo,pyfisch/servo,paulrouget/servo,boghison/servo,splav/servo,avadacatavra/servo,GyrosOfWar/servo,huonw/servo,dvberkel/servo,jlegendary/servo,notriddle/servo,rnestler/servo,peterjoel/servo,nick-thompson/servo,nnethercote/servo,upsuper/servo,peterjoel/servo,rentongzhang/servo,dhananjay92/servo,dsandeephegde/servo,larsbergstrom/servo,brendandahl/servo,nnethercote/servo,szeged/servo,pyfisch/servo,SimonSapin/servo,vks/servo,aidanhs/servo,dvberkel/servo,anthgur/servo,saratang/servo,thiagopnts/servo,caldwell/servo,tempbottle/servo,notriddle/servo,WriterOfAlicrow/servo,larsbergstrom/servo,nrc/servo,nrc/servo,fiji-flo/servo,walac/servo,GyrosOfWar/servo,tafia/servo,upsuper/servo,RenaudParis/servo,caldwell/servo,sadmansk/servo,rnestler/servo,walac/servo,dvberkel/servo,szeged/servo,saneyuki/servo,vks/servo,cbrewster/servo,cbrewster/servo,mdibaiee/servo,mbrubeck/servo,emilio/servo,g-k/servo,rentongzhang/servo,emilio/servo,j3parker/servo,youprofit/servo,kindersung/servo,nrc/servo,sadmansk/servo,vks/servo,splav/servo,peterjoel/servo,dati91/servo,RenaudParis/servo,walac/servo,zentner-kyle/servo,szeged/servo,pyfisch/servo,AnthonyBroadCrawford/servo,peterjoel/servo,j3parker/servo,eddyb/servo,rnestler/servo,dhananjay92/servo,avadacatavra/servo,larsbergstrom/servo,runarberg/servo,dhananjay92/servo,KiChjang/servo,akosel/servo,dvberkel/servo,mbrubeck/servo,DominoTree/servo,anthgur/servo,canaltinova/servo,vks/servo,bjwbell/servo,eddyb/servo,nick-thompson/servo,paulrouget/servo,splav/servo,anthgur/servo,avadacatavra/servo,notriddle/servo,saneyuki/servo,RenaudParis/servo,saneyuki/servo,youprofit/servo,vks/servo,splav/servo,nnethercote/servo,thiagopnts/servo,anthgur/servo,boghison/servo,rentongzhang/servo,saratang/servo,wartman4404/servo,mattnenterprise/servo,tafia/servo,dati91/servo,dhananjay92/servo,saratang/servo,caldwell/servo,mdibaiee/servo,aidanhs/servo,cbrewster/servo,canaltinova/servo,fiji-flo/servo,tempbottle/servo,jlegendary/servo,caldwell/servo,saratang/servo,caldwell/servo,runarberg/servo,peterjoel/servo,paulrouget/servo,youprofit/servo,meh/servo,saneyuki/servo,CJ8664/servo,rentongzhang/servo,paulrouget/servo,avadacatavra/servo,dvberkel/servo,AnthonyBroadCrawford/servo,KiChjang/servo,DominoTree/servo,AnthonyBroadCrawford/servo,jlegendary/servo,mdibaiee/servo,nick-thompson/servo,meh/servo,steveklabnik/servo,fiji-flo/servo,meh/servo,WriterOfAlicrow/servo,SimonSapin/servo,tafia/servo,GyrosOfWar/servo,pyfisch/servo,dati91/servo,WriterOfAlicrow/servo,dati91/servo,upsuper/servo,emilio/servo,ConnorGBrewster/servo,emilio/servo,runarberg/servo,dhananjay92/servo,cbrewster/servo,rentongzhang/servo,codemac/servo,emilio/servo,saratang/servo,steveklabnik/servo,KiChjang/servo,rnestler/servo,A-deLuna/servo,pyfisch/servo,splav/servo,DominoTree/servo,canaltinova/servo,thiagopnts/servo,saratang/servo,ConnorGBrewster/servo,fiji-flo/servo,mdibaiee/servo,notriddle/servo,jimberlage/servo,dhananjay92/servo,KiChjang/servo,DominoTree/servo,szeged/servo,nrc/servo,nnethercote/servo,brendandahl/servo,upsuper/servo,huonw/servo,akosel/servo,WriterOfAlicrow/servo,KiChjang/servo,akosel/servo,meh/servo,nick-thompson/servo,dati91/servo,nnethercote/servo,bjwbell/servo,j3parker/servo,steveklabnik/servo,dagnir/servo,codemac/servo,dagnir/servo,CJ8664/servo,kindersung/servo,bjwbell/servo,mdibaiee/servo,pyfisch/servo,fiji-flo/servo,g-k/servo,steveklabnik/servo,mbrubeck/servo,A-deLuna/servo,cbrewster/servo,akosel/servo,canaltinova/servo,walac/servo,nrc/servo,codemac/servo,mattnenterprise/servo,dsandeephegde/servo,dati91/servo,paulrouget/servo,boghison/servo,pyfisch/servo,cbrewster/servo,larsbergstrom/servo,KiChjang/servo,bjwbell/servo,meh/servo,RenaudParis/servo,jimberlage/servo,rentongzhang/servo,zentner-kyle/servo,tempbottle/servo,emilio/servo,sadmansk/servo,runarberg/servo,mattnenterprise/servo,notriddle/servo,ConnorGBrewster/servo,jlegendary/servo,jlegendary/servo,CJ8664/servo,mbrubeck/servo,thiagopnts/servo,RenaudParis/servo,A-deLuna/servo,szeged/servo,avadacatavra/servo,dsandeephegde/servo,kindersung/servo,dati91/servo,canaltinova/servo,runarberg/servo,tafia/servo,RenaudParis/servo,canaltinova/servo,mbrubeck/servo,dagnir/servo,notriddle/servo,jlegendary/servo,saneyuki/servo,huonw/servo,dsandeephegde/servo,nnethercote/servo,saneyuki/servo,larsbergstrom/servo,g-k/servo,zentner-kyle/servo,mattnenterprise/servo,fiji-flo/servo,eddyb/servo,CJ8664/servo,thiagopnts/servo,emilio/servo,walac/servo,wartman4404/servo,DominoTree/servo,bjwbell/servo,GyrosOfWar/servo,tempbottle/servo,nick-thompson/servo,huonw/servo,DominoTree/servo,rnestler/servo,jlegendary/servo,splav/servo,dati91/servo,saratang/servo,mattnenterprise/servo,youprofit/servo,akosel/servo,KiChjang/servo,SimonSapin/servo,aidanhs/servo,dagnir/servo,emilio/servo,peterjoel/servo,canaltinova/servo,mattnenterprise/servo,steveklabnik/servo,youprofit/servo,jdramani/servo,brendandahl/servo,paulrouget/servo,nnethercote/servo,jimberlage/servo,boghison/servo,ConnorGBrewster/servo,vks/servo,AnthonyBroadCrawford/servo,wartman4404/servo,jimberlage/servo,szeged/servo,pyfisch/servo,szeged/servo,ConnorGBrewster/servo,nick-thompson/servo,walac/servo,sadmansk/servo,jdramani/servo,peterjoel/servo,notriddle/servo,nrc/servo,WriterOfAlicrow/servo,tempbottle/servo,brendandahl/servo,aidanhs/servo,boghison/servo,DominoTree/servo,mattnenterprise/servo,kindersung/servo,caldwell/servo,tafia/servo,meh/servo,larsbergstrom/servo,akosel/servo,saneyuki/servo,g-k/servo,jimberlage/servo,A-deLuna/servo,A-deLuna/servo,mdibaiee/servo,GyrosOfWar/servo,szeged/servo,thiagopnts/servo,tempbottle/servo,dagnir/servo,huonw/servo,larsbergstrom/servo,WriterOfAlicrow/servo,zentner-kyle/servo,CJ8664/servo,cbrewster/servo,jimberlage/servo,tempbottle/servo,aidanhs/servo,j3parker/servo,jdramani/servo,wartman4404/servo,mbrubeck/servo,j3parker/servo,notriddle/servo,peterjoel/servo,pyfisch/servo,dvberkel/servo,thiagopnts/servo,walac/servo,fiji-flo/servo,paulrouget/servo,steveklabnik/servo