Create polygonal texture from square image

Hello, everyone!
I want to flood fill rectangular trapezoid with texture from image. But I not found there is way to create not square texture, except using OpenGL.
For example, we have a polygon {{0,0},{0,10},{12,12},{12,0}} and image {width = 5, height = 5}. How to flood fill polygon with image?
I need it to create road like this

void HelloWorld::generateHill()
{
	auto origin = Director::getInstance()->getVisibleOrigin();
	Point vertex[4];
	for (ssize_t i = 1; i < _hills.size(); ++i)
	{
		auto a_vertex = _hills.at(i - 1);
		auto b_vertex = _hills.at(i);
		int count_vertex = floorf((b_vertex.x - a_vertex.x) / MAX_SEGMENT_WIDTH);
		auto dx = (b_vertex.x - a_vertex.x) / count_vertex;
		auto amplitude = (a_vertex.y - b_vertex.y) / 2;
		auto period = M_PI / count_vertex;
		auto y_middle = (a_vertex.y + b_vertex.y) / 2;
		vertex[1] = a_vertex;
		for (int j = 0; j < count_vertex; ++j)
		{
			vertex[0] = Point(a_vertex.x + dx * j, origin.y);	
			vertex[2] = Point(a_vertex.x + dx * (j + 1), y_middle + amplitude * cosf(period*(j + 1)));
			vertex[3] = Point(a_vertex.x + dx * (j + 1), origin.y);
			auto node = Node::create();
			auto body = PhysicsBody::createEdgePolygon(vertex, 4);
			body->setDynamic(false);
			node->setPhysicsBody(body);
			this->addChild(node);
			vertex[1] = vertex[2];
		}
	}
}

and I want to flood fill node with some texture.

To avoid texture stretching you’ll want to correctly tessellate the area of your trapezium and/or assign UVs according to perspective.

This should help with projected texturing

But I assume by flood fill you mean to have no texture distortion, in which case you want to assign UVs according to the vertex position and set the texture to wrap.

http://www.pix2d.com/2014/02/texture-polygons-cocos2d-x/
http://discuss.cocos2d-x.org/t/repeat-sprites-texture-to-fill-whole-rect/
http://www.glprogramming.com/red/chapter09.html
http://www.iforce2d.net/forums/viewtopic.php?f=4&t=165

Hope this helps

Thank you, almax27
Yes, I mean flood fill without stretching/distortion.
And I found solution with OpenGL, but I hope that there is more simply way, without OpenGL…)