Unable to upload <img src="foo.svg"> as WebGL texture

https://bugs.webkit.org/show_bug.cgi?id=123035

Reviewed by Tim Horton.

Source/WebCore:

If the HTMLImageElement passed to texture2D is an SVG
image, paint it first into a bitmap buffer and upload that.
Note that the SVG image still needs to have an intrinsic
or explicit size - see how the test case must set width and
height.

I also renamed the cache of ImageBuffers since it is
no longer only being used for video frames.

* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::WebGLRenderingContext): Rename m_videoCache to m_generatedImageCache.
(WebCore::WebGLRenderingContext::drawImageIntoBuffer): New method that creates an ImageBuffer
of the appropriate size and renders into that.
(WebCore::WebGLRenderingContext::texImage2D): If we see an SVG image, render it first.
(WebCore::WebGLRenderingContext::videoFrameToImage): Renamed m_generatedImageCache.
(WebCore::WebGLRenderingContext::texSubImage2D): If we see an SVG image, render it first.
* html/canvas/WebGLRenderingContext.h: Renaming.

Change-Id: I601eff1f3a8c11fe2a62f8b5a8a914d6eadfead4
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>