Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Unified Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 12212100: Provide shared context to Platform API in renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: no ifdefs Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/renderer_webkitplatformsupport_impl.cc
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc
index 99c336a76929a5a581fbf6865ebda523fd0713e9..f9ad8f7146865e885db5893cd80de9740927beb2 100644
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc
@@ -16,6 +16,7 @@
#include "content/common/fileapi/webblobregistry_impl.h"
#include "content/common/fileapi/webfilesystem_impl.h"
#include "content/common/file_utilities_messages.h"
+#include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
#include "content/common/indexed_db/proxy_webidbfactory_impl.h"
#include "content/common/mime_registry_messages.h"
#include "content/common/npobject_util.h"
@@ -50,6 +51,7 @@
#include "webkit/glue/webclipboard_impl.h"
#include "webkit/glue/webfileutilities_impl.h"
#include "webkit/glue/webkit_glue.h"
+#include "webkit/gpu/webgraphicscontext3d_in_process_impl.h"
#if defined(OS_WIN)
#include "content/common/child_process_messages.h"
@@ -733,11 +735,6 @@ void RendererWebKitPlatformSupportImpl::SetMockGamepadsForTesting(
g_test_gamepads.Get() = pads;
}
-GpuChannelHostFactory*
-RendererWebKitPlatformSupportImpl::GetGpuChannelHostFactory() {
- return RenderThreadImpl::current();
-}
-
//------------------------------------------------------------------------------
bool RendererWebKitPlatformSupportImpl::canHyphenate(
@@ -779,4 +776,29 @@ bool RendererWebKitPlatformSupportImpl::processMemorySizesInBytes(
return true;
}
+//------------------------------------------------------------------------------
+
+WebKit::WebGraphicsContext3D* RendererWebKitPlatformSupportImpl::
+ createOffscreenGraphicsContext3D(
+ const WebKit::WebGraphicsContext3D::Attributes& attributes) {
+ if (OffscreenContextFactoryForTest())
+ return OffscreenContextFactoryForTest()();
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) {
+ return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView(
+ attributes, false);
+ } else {
+ return WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext(
+ RenderThreadImpl::current(), attributes,
+ GURL(attributes.topDocumentURL));
+ }
+}
+
+//------------------------------------------------------------------------------
+
+WebKit::WebGraphicsContext3D* RendererWebKitPlatformSupportImpl::
+ sharedOffscreenGraphicsContext3D() {
+ return RenderThreadImpl::current()->OffscreenContext3dForMainThread();
+}
+
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698