[chromium] Provide compositor offscreen context through the WebLayerTreeViewClient interface
https://bugs.webkit.org/show_bug.cgi?id=107776

Source/Platform:

Make "createGrGLInterface" the preferred virtual method for
WebGraphicsContext3D implementations to override. For now it
just calls the old method in its default implementation.

Reviewed by James Robinson.

* chromium/public/WebGraphicsContext3D.h:
(WebGraphicsContext3D):
(WebKit::WebGraphicsContext3D::createGrGLInterface):

Source/WebCore:

Reviewed by James Robinson.

Allow the compositor thread's context to be retrieved on either thread,
so the main thread can create and pass the context to the impl thread
via its own mechanisms.

Move the code to bind the GrGLInterface to a WebGraphicsContext3D into
chromium's GraphicsContext3DPrivate. The chromium-side code will need
to implement this code itself.

* platform/chromium/support/GraphicsContext3DPrivate.cpp:
(WebCore::GraphicsContext3DPrivate::~GraphicsContext3DPrivate):
(WebCore):
(WebCore::GraphicsContext3DPrivate::grContext):
* platform/chromium/support/GraphicsContext3DPrivate.h:
* platform/graphics/gpu/SharedGraphicsContext3D.cpp:
(WebCore::SharedGraphicsContext3D::getForImplThread):

Source/WebKit/chromium:

Reviewed by James Robinson.

* WebKit.gyp:
* src/WebGraphicsContext3D.cpp: Removed.


git-svn-id: https://svn.webkit.org/repository/webkit/trunk/Source/Platform/chromium/public@141943 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebGraphicsContext3D.h b/WebGraphicsContext3D.h
index fc967d0..ae19f4f 100644
--- a/WebGraphicsContext3D.h
+++ b/WebGraphicsContext3D.h
@@ -472,7 +472,8 @@
     virtual void asyncTexImage2DCHROMIUM(WGC3Denum target, WGC3Dint level, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height, WGC3Dint border, WGC3Denum format, WGC3Denum type, const void* pixels) { }
     virtual void asyncTexSubImage2DCHROMIUM(WGC3Denum target, WGC3Dint level, WGC3Dint xoffset, WGC3Dint yoffset, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum format, WGC3Denum type, const void* pixels) { }
 
-    GrGLInterface* createGrGLInterface();
+    // FIXME: Make implementations of this class override this method instead and then remove onCreateGrGLInterface().
+    virtual GrGLInterface* createGrGLInterface() { return onCreateGrGLInterface(); }
 
 protected:
     virtual GrGLInterface* onCreateGrGLInterface() { return 0; }