diff options
author | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-31 05:39:06 +0000 |
---|---|---|
committer | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-31 05:39:06 +0000 |
commit | 01e6903959b36f9d7195a8d48e8c38fd3cc2886a (patch) | |
tree | 0cd9e3233b00dfb96d5733adffdc1a4853eac852 /webkit | |
parent | 34694763d71c8d8306a17a7762eeb89db59adba6 (diff) | |
download | chromium_src-01e6903959b36f9d7195a8d48e8c38fd3cc2886a.zip chromium_src-01e6903959b36f9d7195a8d48e8c38fd3cc2886a.tar.gz chromium_src-01e6903959b36f9d7195a8d48e8c38fd3cc2886a.tar.bz2 |
Add WebKitPlatformSupport::createOffscreenGraphicsContext3D
This is in preparation of https://bugs.webkit.org/show_bug.cgi?id=76593
BUG=99516
TEST=manually ran Chrome w/accelerated content, DRT, test_shell_tests.
Review URL: http://codereview.chromium.org/9297046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119857 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/support/test_webkit_platform_support.cc | 21 | ||||
-rw-r--r-- | webkit/support/test_webkit_platform_support.h | 5 | ||||
-rw-r--r-- | webkit/support/webkit_support.cc | 2 | ||||
-rw-r--r-- | webkit/support/webkit_support.h | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_webkit_init.cc | 13 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_webkit_init.h | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.cc | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.h | 2 |
8 files changed, 43 insertions, 8 deletions
diff --git a/webkit/support/test_webkit_platform_support.cc b/webkit/support/test_webkit_platform_support.cc index 546fa7e..7b99f166 100644 --- a/webkit/support/test_webkit_platform_support.cc +++ b/webkit/support/test_webkit_platform_support.cc @@ -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. @@ -387,6 +387,25 @@ TestWebKitPlatformSupport::createGraphicsContext3D() { } } +WebKit::WebGraphicsContext3D* +TestWebKitPlatformSupport::createOffscreenGraphicsContext3D( + const WebKit::WebGraphicsContext3D::Attributes& attributes) { + scoped_ptr<WebKit::WebGraphicsContext3D> context; + switch (webkit_support::GetGraphicsContext3DImplementation()) { + case webkit_support::IN_PROCESS: + context.reset(new webkit::gpu::WebGraphicsContext3DInProcessImpl( + gfx::kNullPluginWindow, NULL)); + break; + case webkit_support::IN_PROCESS_COMMAND_BUFFER: + context.reset( + new webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl()); + break; + } + if (!context->initialize(attributes, NULL, false)) + return NULL; + return context.release(); +} + double TestWebKitPlatformSupport::audioHardwareSampleRate() { return 44100.0; } diff --git a/webkit/support/test_webkit_platform_support.h b/webkit/support/test_webkit_platform_support.h index c131c84..ea09d60 100644 --- a/webkit/support/test_webkit_platform_support.h +++ b/webkit/support/test_webkit_platform_support.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. @@ -7,6 +7,7 @@ #include "base/compiler_specific.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGamepads.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsContext3D.h" #include "webkit/glue/webfileutilities_impl.h" #include "webkit/glue/webkitplatformsupport_impl.h" #include "webkit/support/simple_database_system.h" @@ -90,6 +91,8 @@ class TestWebKitPlatformSupport : virtual WebKit::WebSharedWorkerRepository* sharedWorkerRepository() OVERRIDE; virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D() OVERRIDE; + virtual WebKit::WebGraphicsContext3D* createOffscreenGraphicsContext3D( + const WebKit::WebGraphicsContext3D::Attributes&); WebURLLoaderMockFactory* url_loader_factory() { return &url_loader_factory_; diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc index f8925fb..802a51e 100644 --- a/webkit/support/webkit_support.cc +++ b/webkit/support/webkit_support.cc @@ -369,7 +369,7 @@ GraphicsContext3DImplementation GetGraphicsContext3DImplementation() { } WebKit::WebGraphicsContext3D* CreateGraphicsContext3D( - WebKit::WebGraphicsContext3D::Attributes attributes, + const WebKit::WebGraphicsContext3D::Attributes& attributes, WebKit::WebView* web_view, bool direct) { scoped_ptr<WebKit::WebGraphicsContext3D> context; diff --git a/webkit/support/webkit_support.h b/webkit/support/webkit_support.h index c8ed97c..84b65a3 100644 --- a/webkit/support/webkit_support.h +++ b/webkit/support/webkit_support.h @@ -100,7 +100,7 @@ void SetGraphicsContext3DImplementation(GraphicsContext3DImplementation); GraphicsContext3DImplementation GetGraphicsContext3DImplementation(); WebKit::WebGraphicsContext3D* CreateGraphicsContext3D( - WebKit::WebGraphicsContext3D::Attributes attributes, + const WebKit::WebGraphicsContext3D::Attributes& attributes, WebKit::WebView* web_view, bool direct); diff --git a/webkit/tools/test_shell/test_shell_webkit_init.cc b/webkit/tools/test_shell/test_shell_webkit_init.cc index 297b983..647092f 100644 --- a/webkit/tools/test_shell/test_shell_webkit_init.cc +++ b/webkit/tools/test_shell/test_shell_webkit_init.cc @@ -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. @@ -305,6 +305,17 @@ WebKit::WebGraphicsContext3D* TestShellWebKitInit::createGraphicsContext3D() { gfx::kNullPluginWindow, NULL); } +WebKit::WebGraphicsContext3D* +TestShellWebKitInit::createOffscreenGraphicsContext3D( + const WebKit::WebGraphicsContext3D::Attributes& attributes) { + scoped_ptr<WebGraphicsContext3D> context( + new webkit::gpu::WebGraphicsContext3DInProcessImpl( + gfx::kNullPluginWindow, NULL)); + if (!context->initialize(attributes, NULL, false)) + return NULL; + return context.release(); +} + void TestShellWebKitInit::GetPlugins( bool refresh, std::vector<webkit::WebPluginInfo>* plugins) { if (refresh) diff --git a/webkit/tools/test_shell/test_shell_webkit_init.h b/webkit/tools/test_shell/test_shell_webkit_init.h index 04fc53b..223cdf3 100644 --- a/webkit/tools/test_shell/test_shell_webkit_init.h +++ b/webkit/tools/test_shell/test_shell_webkit_init.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. @@ -107,6 +107,8 @@ class TestShellWebKitInit : public webkit_glue::WebKitPlatformSupportImpl { virtual WebKit::WebSharedWorkerRepository* sharedWorkerRepository() OVERRIDE; virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D() OVERRIDE; + virtual WebKit::WebGraphicsContext3D* createOffscreenGraphicsContext3D( + const WebKit::WebGraphicsContext3D::Attributes& attributes); virtual string16 GetLocalizedString(int message_id) OVERRIDE; virtual base::StringPiece GetDataResource(int resource_id) OVERRIDE; diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index 29c7f97..b582a58e 100644 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -339,7 +339,7 @@ WebStorageNamespace* TestWebViewDelegate::createSessionStorageNamespace( } WebGraphicsContext3D* TestWebViewDelegate::createGraphicsContext3D( - WebGraphicsContext3D::Attributes attributes, + const WebGraphicsContext3D::Attributes& attributes, bool direct) { if (!shell_->webView()) return NULL; diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h index d168f94..a57b5ec 100644 --- a/webkit/tools/test_shell/test_webview_delegate.h +++ b/webkit/tools/test_shell/test_webview_delegate.h @@ -91,7 +91,7 @@ class TestWebViewDelegate : public WebKit::WebViewClient, virtual WebKit::WebStorageNamespace* createSessionStorageNamespace( unsigned quota); virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D( - WebKit::WebGraphicsContext3D::Attributes attributes, + const WebKit::WebGraphicsContext3D::Attributes& attributes, bool direct); virtual void didAddMessageToConsole( const WebKit::WebConsoleMessage& message, |