summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-02 04:26:20 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-02 04:26:20 +0000
commita22e15d4c0ce887e874ca71c9e7fbcb3f44198a5 (patch)
tree26e563b7fb1626e716a61b0823555591a2762b58 /content
parent86ccf5f8d98a73299def70308580bcb4bc90b791 (diff)
downloadchromium_src-a22e15d4c0ce887e874ca71c9e7fbcb3f44198a5.zip
chromium_src-a22e15d4c0ce887e874ca71c9e7fbcb3f44198a5.tar.gz
chromium_src-a22e15d4c0ce887e874ca71c9e7fbcb3f44198a5.tar.bz2
Allow browser compositor to create an offscreen context3D.
This is needed for using compositor filters in Aura such as glass blur. BUG=99528 TEST= Review URL: http://codereview.chromium.org/9568042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124594 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/common/webkitplatformsupport_impl.cc25
-rw-r--r--content/common/webkitplatformsupport_impl.h4
-rw-r--r--content/renderer/renderer_webkitplatformsupport_impl.cc21
-rw-r--r--content/renderer/renderer_webkitplatformsupport_impl.h2
4 files changed, 27 insertions, 25 deletions
diff --git a/content/common/webkitplatformsupport_impl.cc b/content/common/webkitplatformsupport_impl.cc
index 3a32adf..0b83378 100644
--- a/content/common/webkitplatformsupport_impl.cc
+++ b/content/common/webkitplatformsupport_impl.cc
@@ -1,11 +1,15 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/command_line.h"
#include "content/common/child_thread.h"
+#include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
#include "content/common/socket_stream_dispatcher.h"
#include "content/common/webkitplatformsupport_impl.h"
#include "content/public/common/content_client.h"
+#include "content/public/common/content_switches.h"
+#include "webkit/gpu/webgraphicscontext3d_in_process_impl.h"
namespace content {
@@ -46,4 +50,23 @@ WebKitPlatformSupportImpl::CreateWebSocketBridge(
return dispatcher->CreateBridge(handle, delegate);
}
+WebKit::WebGraphicsContext3D*
+WebKitPlatformSupportImpl::createOffscreenGraphicsContext3D(
+ const WebGraphicsContext3D::Attributes& attributes) {
+ // The WebGraphicsContext3DInProcessImpl code path is used for
+ // layout tests (though not through this code) as well as for
+ // debugging and bringing up new ports.
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) {
+ return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView(
+ attributes, false);
+ } else {
+ base::WeakPtr<WebGraphicsContext3DSwapBuffersClient> null_client;
+ scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context(
+ new WebGraphicsContext3DCommandBufferImpl(0, GURL(), null_client));
+ if (!context->Initialize(attributes))
+ return NULL;
+ return context.release();
+ }
+}
+
} // namespace content
diff --git a/content/common/webkitplatformsupport_impl.h b/content/common/webkitplatformsupport_impl.h
index 1904042..6cadfde 100644
--- a/content/common/webkitplatformsupport_impl.h
+++ b/content/common/webkitplatformsupport_impl.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -30,6 +30,8 @@ class CONTENT_EXPORT WebKitPlatformSupportImpl
virtual webkit_glue::WebSocketStreamHandleBridge* CreateWebSocketBridge(
WebKit::WebSocketStreamHandle* handle,
webkit_glue::WebSocketStreamHandleDelegate* delegate) OVERRIDE;
+ virtual WebKit::WebGraphicsContext3D* createOffscreenGraphicsContext3D(
+ const WebKit::WebGraphicsContext3D::Attributes& attributes);
};
} // namespace content
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc
index 453e656..1c5fc6f 100644
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc
@@ -14,7 +14,6 @@
#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,7 +49,6 @@
#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"
@@ -581,25 +579,6 @@ RendererWebKitPlatformSupportImpl::sharedWorkerRepository() {
}
}
-WebKit::WebGraphicsContext3D*
-RendererWebKitPlatformSupportImpl::createOffscreenGraphicsContext3D(
- const WebGraphicsContext3D::Attributes& attributes) {
- // The WebGraphicsContext3DInProcessImpl code path is used for
- // layout tests (though not through this code) as well as for
- // debugging and bringing up new ports.
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) {
- return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView(
- attributes, false);
- } else {
- base::WeakPtr<WebGraphicsContext3DSwapBuffersClient> null_client;
- scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context(
- new WebGraphicsContext3DCommandBufferImpl(0, GURL(), null_client));
- if (!context->Initialize(attributes))
- return NULL;
- return context.release();
- }
-}
-
double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() {
return audio_hardware::GetOutputSampleRate();
}
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.h b/content/renderer/renderer_webkitplatformsupport_impl.h
index 9b56977..18fa046 100644
--- a/content/renderer/renderer_webkitplatformsupport_impl.h
+++ b/content/renderer/renderer_webkitplatformsupport_impl.h
@@ -82,8 +82,6 @@ class CONTENT_EXPORT RendererWebKitPlatformSupportImpl
const WebKit::WebString& keyPath) OVERRIDE;
virtual WebKit::WebFileSystem* fileSystem() OVERRIDE;
virtual WebKit::WebSharedWorkerRepository* sharedWorkerRepository() OVERRIDE;
- virtual WebKit::WebGraphicsContext3D* createOffscreenGraphicsContext3D(
- const WebKit::WebGraphicsContext3D::Attributes& attributes);
virtual double audioHardwareSampleRate() OVERRIDE;
virtual size_t audioHardwareBufferSize() OVERRIDE;
virtual WebKit::WebAudioDevice* createAudioDevice(