summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-21 21:57:02 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-21 21:57:02 +0000
commitdd6cfa63b3bff8689ffbbc96fefe9375507597dc (patch)
treedf8028475e6ea51c29fe00306200b6033826fed2 /chrome
parentbd141d8f9578d87ebe7198c94186ba2ce2711312 (diff)
downloadchromium_src-dd6cfa63b3bff8689ffbbc96fefe9375507597dc.zip
chromium_src-dd6cfa63b3bff8689ffbbc96fefe9375507597dc.tar.gz
chromium_src-dd6cfa63b3bff8689ffbbc96fefe9375507597dc.tar.bz2
Deleted WebGLES2ContextImpl and references to it and WebGLES2Context.
This is a prerequisite to deletion of GLES2Context and WebGLES2Context from the WebKit repository. There is a TODO, to which the video stack team has agreed, to switch over the experimental hardware-accelerated video decoding from WebGLES2Context to WebGraphicsContext3D. The remaining vestige, removal of the implementation of WebGraphicsContext3D::initialize(Attributes, WebView*), will occur once the associated method is deleted from WebKit. Built and tested 3D CSS and WebGL content on Mac OS X and Windows. BUG=52863 TEST=none Review URL: http://codereview.chromium.org/3449017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60113 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/chrome_renderer.gypi2
-rw-r--r--chrome/renderer/render_view.cc13
-rw-r--r--chrome/renderer/renderer_webkitclient_impl.cc10
-rw-r--r--chrome/renderer/renderer_webkitclient_impl.h1
-rw-r--r--chrome/renderer/webgles2context_impl.cc115
-rw-r--r--chrome/renderer/webgles2context_impl.h52
-rw-r--r--chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc35
7 files changed, 1 insertions, 227 deletions
diff --git a/chrome/chrome_renderer.gypi b/chrome/chrome_renderer.gypi
index 38e122f..10e5732 100644
--- a/chrome/chrome_renderer.gypi
+++ b/chrome/chrome_renderer.gypi
@@ -223,8 +223,6 @@
'renderer/user_script_slave.h',
'renderer/visitedlink_slave.cc',
'renderer/visitedlink_slave.h',
- 'renderer/webgles2context_impl.cc',
- 'renderer/webgles2context_impl.h',
'renderer/webgraphicscontext3d_command_buffer_impl.cc',
'renderer/webgraphicscontext3d_command_buffer_impl.h',
'renderer/webplugin_delegate_proxy.cc',
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 17e5a34..ae155e8 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -80,7 +80,6 @@
#include "chrome/renderer/spellchecker/spellcheck.h"
#include "chrome/renderer/user_script_slave.h"
#include "chrome/renderer/visitedlink_slave.h"
-#include "chrome/renderer/webgles2context_impl.h"
#include "chrome/renderer/webplugin_delegate_pepper.h"
#include "chrome/renderer/webplugin_delegate_proxy.h"
#include "chrome/renderer/websharedworker_proxy.h"
@@ -2460,18 +2459,6 @@ WebMediaPlayer* RenderView::createMediaPlayer(
AudioRendererImpl::CreateFactory(audio_message_filter()));
}
- // TODO(hclam): Need to inject Gles2VideoDecodeContext here. Also I need
- // to create a factory for FFmpegVideoDecoder here so that it can use
- // the Gles2VideoDecodeContext.
- if (cmd_line->HasSwitch(switches::kEnableAcceleratedDecoding) &&
- !cmd_line->HasSwitch(switches::kDisableAcceleratedCompositing)) {
- // Add the hardware video decoder factory.
- factory->AddFactory(IpcVideoDecoder::CreateFactory(
- MessageLoop::current(),
- reinterpret_cast<WebGLES2ContextImpl*>(
- webview()->gles2Context())->context()));
- }
-
WebApplicationCacheHostImpl* appcache_host =
WebApplicationCacheHostImpl::FromFrame(frame);
diff --git a/chrome/renderer/renderer_webkitclient_impl.cc b/chrome/renderer/renderer_webkitclient_impl.cc
index 6830590..8909582 100644
--- a/chrome/renderer/renderer_webkitclient_impl.cc
+++ b/chrome/renderer/renderer_webkitclient_impl.cc
@@ -22,7 +22,6 @@
#include "chrome/renderer/renderer_webidbfactory_impl.h"
#include "chrome/renderer/renderer_webstoragenamespace_impl.h"
#include "chrome/renderer/visitedlink_slave.h"
-#include "chrome/renderer/webgles2context_impl.h"
#include "chrome/renderer/webgraphicscontext3d_command_buffer_impl.h"
#include "chrome/renderer/websharedworkerrepository_impl.h"
#include "googleurl/src/gurl.h"
@@ -505,15 +504,6 @@ RendererWebKitClientImpl::createGraphicsContext3D() {
}
}
-WebKit::WebGLES2Context*
-RendererWebKitClientImpl::createGLES2Context() {
-#if defined(ENABLE_GPU)
- return new WebGLES2ContextImpl();
-#else
- return NULL;
-#endif
-}
-
//------------------------------------------------------------------------------
WebKit::WebString RendererWebKitClientImpl::signedPublicKeyAndChallengeString(
diff --git a/chrome/renderer/renderer_webkitclient_impl.h b/chrome/renderer/renderer_webkitclient_impl.h
index e78ff04..9448fe9 100644
--- a/chrome/renderer/renderer_webkitclient_impl.h
+++ b/chrome/renderer/renderer_webkitclient_impl.h
@@ -70,7 +70,6 @@ class RendererWebKitClientImpl : public webkit_glue::WebKitClientImpl {
virtual WebKit::WebSharedWorkerRepository* sharedWorkerRepository();
virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D();
- virtual WebKit::WebGLES2Context* createGLES2Context();
virtual WebKit::WebBlobRegistry* blobRegistry();
diff --git a/chrome/renderer/webgles2context_impl.cc b/chrome/renderer/webgles2context_impl.cc
deleted file mode 100644
index b4241e1..0000000
--- a/chrome/renderer/webgles2context_impl.cc
+++ /dev/null
@@ -1,115 +0,0 @@
-// Copyright (c) 2010 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.
-
-#if defined(ENABLE_GPU)
-
-#include "chrome/renderer/webgles2context_impl.h"
-
-#include "chrome/renderer/gpu_channel_host.h"
-#include "chrome/renderer/render_thread.h"
-#include "chrome/renderer/render_view.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebView.h"
-
-
-WebGLES2ContextImpl::WebGLES2ContextImpl()
- : context_(NULL)
-#if defined(OS_MACOSX)
- , plugin_handle_(gfx::kNullPluginWindow)
- , web_view_(NULL)
-#endif
- {
-}
-
-WebGLES2ContextImpl::~WebGLES2ContextImpl() {
- destroy();
-}
-
-// TODO(vangelis): Remove once the method is removed from the WebGLES2Context.
-bool WebGLES2ContextImpl::initialize(WebKit::WebView* web_view) {
- return initialize(web_view, NULL);
-}
-
-bool WebGLES2ContextImpl::initialize(
- WebKit::WebView* web_view,
- WebGLES2Context* parent) {
- // Windowed contexts don't have a parent context.
- DCHECK(!(web_view && parent));
-
- RenderThread* render_thread = RenderThread::current();
- if (!render_thread)
- return false;
- GpuChannelHost* host = render_thread->EstablishGpuChannelSync();
- if (!host)
- return false;
- DCHECK(host->state() == GpuChannelHost::CONNECTED);
-
- // If a WebView is passed then create a context rendering directly
- // into the window used by the WebView, otherwise create an offscreen
- // context.
- if (web_view) {
- RenderView* renderview = RenderView::FromWebView(web_view);
- if (!renderview)
- return false;
- gfx::NativeViewId view_id;
-#if !defined(OS_MACOSX)
- view_id = renderview->host_window();
-#else
- plugin_handle_ = renderview->AllocateFakePluginWindowHandle(true, true);
- web_view_ = web_view;
- view_id = static_cast<gfx::NativeViewId>(plugin_handle_);
-#endif
- context_ = ggl::CreateViewContext(
- host, view_id,
- renderview->routing_id());
- } else {
- ggl::Context* parent_context = NULL;
-
- if (parent) {
- WebGLES2ContextImpl* parent_context_impl =
- static_cast<WebGLES2ContextImpl*>(parent);
- parent_context = parent_context_impl->context();
- DCHECK(parent_context);
- }
- context_ = ggl::CreateOffscreenContext(host, parent_context,
- gfx::Size(1, 1));
- }
-
- return (context_ != NULL);
-}
-
-bool WebGLES2ContextImpl::makeCurrent() {
- return ggl::MakeCurrent(context_);
-}
-
-bool WebGLES2ContextImpl::destroy() {
-#if defined(OS_MACOSX)
- RenderView* renderview = RenderView::FromWebView(web_view_);
- DCHECK(plugin_handle_ == gfx::kNullPluginWindow || renderview);
- if (plugin_handle_ != gfx::kNullPluginWindow && renderview)
- renderview->DestroyFakePluginWindowHandle(plugin_handle_);
- plugin_handle_ = gfx::kNullPluginWindow;
-#endif
- return ggl::DestroyContext(context_);
-}
-
-bool WebGLES2ContextImpl::swapBuffers() {
- return ggl::SwapBuffers(context_);
-}
-
-void WebGLES2ContextImpl::resizeOffscreenContent(const WebKit::WebSize& size) {
- ggl::ResizeOffscreenContext(context_, size);
-}
-
-unsigned WebGLES2ContextImpl::getOffscreenContentParentTextureId() {
- return ggl::GetParentTextureId(context_);
-}
-
-#if defined(OS_MACOSX)
-void WebGLES2ContextImpl::resizeOnscreenContent(const WebKit::WebSize& size) {
- ggl::ResizeOnscreenContext(context_, size);
-}
-#endif
-
-#endif // defined(ENABLE_GPU)
-
diff --git a/chrome/renderer/webgles2context_impl.h b/chrome/renderer/webgles2context_impl.h
deleted file mode 100644
index d77313b..0000000
--- a/chrome/renderer/webgles2context_impl.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) 2010 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.
-
-#ifndef CHROME_RENDERER_WEBGLES2CONTEXT_IMPL_H_
-#define CHROME_RENDERER_WEBGLES2CONTEXT_IMPL_H_
-#pragma once
-
-#if defined(ENABLE_GPU)
-
-#include "chrome/renderer/ggl/ggl.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebGLES2Context.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebSize.h"
-
-#if defined(OS_MACOSX)
-#include "gfx/native_widget_types.h"
-#endif
-
-class WebGLES2ContextImpl : public WebKit::WebGLES2Context {
- public:
- WebGLES2ContextImpl();
- virtual ~WebGLES2ContextImpl();
-
- // TODO(vangelis): Remove once method is removed from WebGLES2Context.
- virtual bool initialize(WebKit::WebView*);
- virtual bool initialize(WebKit::WebView*, WebGLES2Context* parent);
- virtual bool makeCurrent();
- virtual bool destroy();
- virtual bool swapBuffers();
-
- virtual void resizeOffscreenContent(const WebKit::WebSize&);
- virtual unsigned getOffscreenContentParentTextureId();
-
-#if defined(OS_MACOSX)
- virtual void resizeOnscreenContent(const WebKit::WebSize&);
-#endif
-
- ggl::Context* context() { return context_; }
-
- private:
- // The GGL context we use for OpenGL rendering.
- ggl::Context* context_;
-
-#if defined(OS_MACOSX)
- gfx::PluginWindowHandle plugin_handle_;
- WebKit::WebView* web_view_;
-#endif
-};
-
-#endif // defined(ENABLE_GPU)
-#endif // CHROME_RENDERER_WEBGLES2CONTEXT_IMPL_H_
-
diff --git a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
index da789a4..e6e3fd5 100644
--- a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
+++ b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
@@ -21,7 +21,6 @@
#include "chrome/renderer/gpu_channel_host.h"
#include "chrome/renderer/render_thread.h"
#include "chrome/renderer/render_view.h"
-#include "chrome/renderer/webgles2context_impl.h"
#include "third_party/WebKit/WebKit/chromium/public/WebView.h"
WebGraphicsContext3DCommandBufferImpl::WebGraphicsContext3DCommandBufferImpl()
@@ -113,39 +112,7 @@ bool WebGraphicsContext3DCommandBufferImpl::initialize(
bool WebGraphicsContext3DCommandBufferImpl::initialize(
WebGraphicsContext3D::Attributes attributes,
WebKit::WebView* web_view) {
- bool compositing_enabled = !CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableAcceleratedCompositing);
- ggl::Context* parent_context = NULL;
- // If GPU compositing is enabled we need to create a GL context that shares
- // resources with the compositor's context.
- if (compositing_enabled) {
- // Asking for the GLES2Context on the WebView will force one to be created
- // if it doesn't already exist. When the compositor is created for the view
- // it will use the same context.
- WebKit::WebGLES2Context* view_gles2_context = web_view->gles2Context();
- if (!view_gles2_context)
- return false;
- WebGLES2ContextImpl* context_impl =
- static_cast<WebGLES2ContextImpl*>(view_gles2_context);
- parent_context = context_impl->context();
- }
-
- RenderThread* render_thread = RenderThread::current();
- if (!render_thread)
- return false;
- GpuChannelHost* host = render_thread->EstablishGpuChannelSync();
- if (!host)
- return false;
- DCHECK(host->state() == GpuChannelHost::CONNECTED);
- context_ = ggl::CreateOffscreenContext(host, parent_context, gfx::Size(1, 1));
- if (!context_)
- return false;
- // TODO(gman): Remove this.
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- if (command_line.HasSwitch(switches::kDisableGLSLTranslator)) {
- DisableShaderTranslation(context_);
- }
- return true;
+ return false;
}
bool WebGraphicsContext3DCommandBufferImpl::makeContextCurrent() {