summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorkbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-13 07:21:05 +0000
committerkbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-13 07:21:05 +0000
commit680bd6828dce5644066f4db3a2a71186779738ac (patch)
tree7a37228e8db39b6beb75ca4746af7367ce79387f /webkit
parentbcf30daebbcc274951e7806e24b19d4a993cd22f (diff)
downloadchromium_src-680bd6828dce5644066f4db3a2a71186779738ac.zip
chromium_src-680bd6828dce5644066f4db3a2a71186779738ac.tar.gz
chromium_src-680bd6828dce5644066f4db3a2a71186779738ac.tar.bz2
Revert 244383 "Use ContextProvider subclass to provide WGC3D poi..."
Likely cause of WebGL conformance test crashes on Android GPU bot. BUG=333761,181120 > Use ContextProvider subclass to provide WGC3D pointers > > Some cc::ContextProvider instances will also need to provide WebGraphicsContext3D* > interfaces to the underlying GL context, but not all. This adds a subclass of ContextProvider > in content:: to use for these users. The compositor itself doesn't need the WGC3D > accessor so it just uses the base class. > > BUG=181120 > > Review URL: https://codereview.chromium.org/126093010 TBR=jamesr@chromium.org Review URL: https://codereview.chromium.org/136273002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244470 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/common/gpu/context_provider_in_process.cc7
-rw-r--r--webkit/common/gpu/context_provider_in_process.h5
-rw-r--r--webkit/common/gpu/context_provider_web_context.h26
-rw-r--r--webkit/common/gpu/webgraphicscontext3d_provider_impl.cc27
-rw-r--r--webkit/common/gpu/webgraphicscontext3d_provider_impl.h36
-rw-r--r--webkit/common/gpu/webkit_gpu.gyp3
6 files changed, 67 insertions, 37 deletions
diff --git a/webkit/common/gpu/context_provider_in_process.cc b/webkit/common/gpu/context_provider_in_process.cc
index 70d9d34..ba293ba 100644
--- a/webkit/common/gpu/context_provider_in_process.cc
+++ b/webkit/common/gpu/context_provider_in_process.cc
@@ -77,13 +77,6 @@ ContextProviderInProcess::~ContextProviderInProcess() {
context_thread_checker_.CalledOnValidThread());
}
-blink::WebGraphicsContext3D* ContextProviderInProcess::WebContext3D() {
- DCHECK(lost_context_callback_proxy_); // Is bound to thread.
- DCHECK(context_thread_checker_.CalledOnValidThread());
-
- return context3d_.get();
-}
-
bool ContextProviderInProcess::BindToCurrentThread() {
DCHECK(context3d_);
diff --git a/webkit/common/gpu/context_provider_in_process.h b/webkit/common/gpu/context_provider_in_process.h
index 2abc7f3..72098b2 100644
--- a/webkit/common/gpu/context_provider_in_process.h
+++ b/webkit/common/gpu/context_provider_in_process.h
@@ -9,7 +9,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread_checker.h"
-#include "webkit/common/gpu/context_provider_web_context.h"
+#include "cc/output/context_provider.h"
#include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
#include "webkit/common/gpu/webkit_gpu_export.h"
@@ -20,7 +20,7 @@ namespace gpu {
class GrContextForWebGraphicsContext3D;
class WEBKIT_GPU_EXPORT ContextProviderInProcess
- : NON_EXPORTED_BASE(public ContextProviderWebContext) {
+ : NON_EXPORTED_BASE(public cc::ContextProvider) {
public:
static scoped_refptr<ContextProviderInProcess> Create(
scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d,
@@ -30,7 +30,6 @@ class WEBKIT_GPU_EXPORT ContextProviderInProcess
// context.
static scoped_refptr<ContextProviderInProcess> CreateOffscreen();
- virtual blink::WebGraphicsContext3D* WebContext3D() OVERRIDE;
virtual bool BindToCurrentThread() OVERRIDE;
virtual Capabilities ContextCapabilities() OVERRIDE;
virtual blink::WebGraphicsContext3D* Context3d() OVERRIDE;
diff --git a/webkit/common/gpu/context_provider_web_context.h b/webkit/common/gpu/context_provider_web_context.h
deleted file mode 100644
index 9f04bf9..0000000
--- a/webkit/common/gpu/context_provider_web_context.h
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2014 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 WEBKIT_COMMON_GPU_CONTEXT_PROVIDER_WEB_CONTEXT_H_
-#define WEBKIT_COMMON_GPU_CONTEXT_PROVIDER_WEB_CONTEXT_H_
-
-#include "cc/output/context_provider.h"
-
-namespace blink { class WebGraphicsContext3D; }
-
-namespace webkit {
-namespace gpu {
-
-class ContextProviderWebContext : public cc::ContextProvider {
- public:
- virtual blink::WebGraphicsContext3D* WebContext3D() = 0;
-
- protected:
- virtual ~ContextProviderWebContext() {}
-};
-
-} // namespace gpu
-} // namespace webkit
-
-#endif // WEBKIT_COMMON_GPU_CONTEXT_PROVIDER_WEB_CONTEXT_H_
diff --git a/webkit/common/gpu/webgraphicscontext3d_provider_impl.cc b/webkit/common/gpu/webgraphicscontext3d_provider_impl.cc
new file mode 100644
index 0000000..5629131
--- /dev/null
+++ b/webkit/common/gpu/webgraphicscontext3d_provider_impl.cc
@@ -0,0 +1,27 @@
+// Copyright (c) 2013 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 "webkit/common/gpu/webgraphicscontext3d_provider_impl.h"
+
+#include "cc/output/context_provider.h"
+
+namespace webkit {
+namespace gpu {
+
+WebGraphicsContext3DProviderImpl::WebGraphicsContext3DProviderImpl(
+ scoped_refptr<cc::ContextProvider> provider)
+ : provider_(provider) {}
+
+WebGraphicsContext3DProviderImpl::~WebGraphicsContext3DProviderImpl() {}
+
+blink::WebGraphicsContext3D* WebGraphicsContext3DProviderImpl::context3d() {
+ return provider_->Context3d();
+}
+
+GrContext* WebGraphicsContext3DProviderImpl::grContext() {
+ return provider_->GrContext();
+}
+
+} // namespace gpu
+} // namespace webkit
diff --git a/webkit/common/gpu/webgraphicscontext3d_provider_impl.h b/webkit/common/gpu/webgraphicscontext3d_provider_impl.h
new file mode 100644
index 0000000..794df13
--- /dev/null
+++ b/webkit/common/gpu/webgraphicscontext3d_provider_impl.h
@@ -0,0 +1,36 @@
+// Copyright (c) 2013 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 WEBKIT_COMMON_GPU_WEBGRAPHICSCONTEXT3D_PROVIDER_IMPL_H_
+#define WEBKIT_COMMON_GPU_WEBGRAPHICSCONTEXT3D_PROVIDER_IMPL_H_
+
+#include "base/compiler_specific.h"
+#include "base/memory/ref_counted.h"
+#include "third_party/WebKit/public/platform/WebGraphicsContext3DProvider.h"
+#include "webkit/common/gpu/webkit_gpu_export.h"
+
+namespace cc { class ContextProvider; }
+
+namespace webkit {
+namespace gpu {
+
+class WEBKIT_GPU_EXPORT WebGraphicsContext3DProviderImpl
+ : public NON_EXPORTED_BASE(blink::WebGraphicsContext3DProvider) {
+ public:
+ explicit WebGraphicsContext3DProviderImpl(
+ scoped_refptr<cc::ContextProvider> provider);
+ virtual ~WebGraphicsContext3DProviderImpl();
+
+ // WebGraphicsContext3DProvider implementation.
+ virtual blink::WebGraphicsContext3D* context3d() OVERRIDE;
+ virtual GrContext* grContext() OVERRIDE;
+
+ private:
+ scoped_refptr<cc::ContextProvider> provider_;
+};
+
+} // namespace gpu
+} // namespace webkit
+
+#endif // WEBKIT_COMMON_GPU_WEBGRAPHICSCONTEXT3D_PROVIDER_IMPL_H_
diff --git a/webkit/common/gpu/webkit_gpu.gyp b/webkit/common/gpu/webkit_gpu.gyp
index bc2081c..1ef6b8c 100644
--- a/webkit/common/gpu/webkit_gpu.gyp
+++ b/webkit/common/gpu/webkit_gpu.gyp
@@ -33,13 +33,14 @@
# This list contains all .h and .cc in gpu except for test code.
'context_provider_in_process.cc',
'context_provider_in_process.h',
- 'context_provider_web_context.h',
'grcontext_for_webgraphicscontext3d.cc',
'grcontext_for_webgraphicscontext3d.h',
'test_context_provider_factory.cc',
'test_context_provider_factory.h',
'webgraphicscontext3d_in_process_command_buffer_impl.cc',
'webgraphicscontext3d_in_process_command_buffer_impl.h',
+ 'webgraphicscontext3d_provider_impl.cc',
+ 'webgraphicscontext3d_provider_impl.h',
],
'defines': [
'WEBKIT_GPU_IMPLEMENTATION',