It is most likely formed underground.
The texture is mostly dependent on the amount of time the magma or lava had to crystallize into a solid rock. Volcanic rock is formed from quickly cooling lava (also called extrusive igneous rock),...
The granularity of igneous rock depends on of the temperature of the magma and how rapidly it solidified.
It is called a porphyry.
It is most likely extrusive.