Need help with texture

Is there a way to repeat and offset the texture for 2d primitive shapes in WEBGL mode ?

Right now I can only think of creating texture using createGraphics and applying offset in it.