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

Unified Diff: content/renderer/render_view_impl.cc

Issue 9254035: Implement WebViewClient::createGraphicsContext3D (and support for DRT) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove web_view parameter Created 8 years, 11 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
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | webkit/glue/webkitplatformsupport_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index f7e5af513c6b91884f2798c96ba4771f1f1ee940..1a7fd5c69525200c0c88babe67c35d807d297b02 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -156,6 +156,7 @@
#include "webkit/glue/webkit_constants.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/weburlloader_impl.h"
+#include "webkit/gpu/webgraphicscontext3d_in_process_impl.h"
#include "webkit/media/webmediaplayer_impl.h"
#include "webkit/plugins/npapi/plugin_list.h"
#include "webkit/plugins/npapi/webplugin_delegate.h"
@@ -201,6 +202,7 @@ using WebKit::WebFindOptions;
using WebKit::WebFormControlElement;
using WebKit::WebFormElement;
using WebKit::WebFrame;
+using WebKit::WebGraphicsContext3D;
using WebKit::WebHistoryItem;
using WebKit::WebIconURL;
using WebKit::WebImage;
@@ -1431,6 +1433,30 @@ WebStorageNamespace* RenderViewImpl::createSessionStorageNamespace(
session_storage_namespace_id_);
}
+WebGraphicsContext3D* RenderViewImpl::createGraphicsContext3D(
+ WebGraphicsContext3D::Attributes attributes,
+ bool direct) {
+ if (!webview())
+ return NULL;
+ // The WebGraphicsContext3DInProcessImpl code path is used for
+ // layout tests (though not through this code) as well as for
+ // debugging and bringing up new ports.
+ scoped_ptr<WebGraphicsContext3D> context;
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) {
+ context.reset(new webkit::gpu::WebGraphicsContext3DInProcessImpl(
+ gfx::kNullPluginWindow, NULL));
+ } else {
+#if defined(ENABLE_GPU)
+ context.reset(new WebGraphicsContext3DCommandBufferImpl());
+#else
+ return NULL;
+#endif
+ }
+ if (!context->initialize(attributes, webview(), direct))
+ return NULL;
+ return context.release();
+}
+
void RenderViewImpl::didAddMessageToConsole(
const WebConsoleMessage& message, const WebString& source_name,
unsigned source_line) {
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | webkit/glue/webkitplatformsupport_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698