summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2016-03-22 17:09:49 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-23 00:11:09 +0000
commit899c6f30cf5c2c1d3472efc2f4e4b4aab02adc9d (patch)
tree22d858840b473075d3b63e0de332afce8a15e00d
parentee5b9e5aa4f385eeb16518ae08bb4d73758006d2 (diff)
downloadchromium_src-899c6f30cf5c2c1d3472efc2f4e4b4aab02adc9d.zip
chromium_src-899c6f30cf5c2c1d3472efc2f4e4b4aab02adc9d.tar.gz
chromium_src-899c6f30cf5c2c1d3472efc2f4e4b4aab02adc9d.tar.bz2
Remove simple methods from WebGraphicsContext3D that do strings.
Remove simple methods that return or take strings from WebGraphicsContext3D and just call the methods on GLES2Interface directly, converting to/from WTF::String and char*. R=chrishtr@chromium.org, kbr@chromium.org, pfeldman@chromium.org TBR=pfeldman BUG=584497 CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel Review URL: https://codereview.chromium.org/1821903002 Cr-Commit-Position: refs/heads/master@{#382741}
-rw-r--r--components/test_runner/test_plugin.cc4
-rw-r--r--gpu/blink/webgraphicscontext3d_impl.cc23
-rw-r--r--gpu/blink/webgraphicscontext3d_impl.h8
-rw-r--r--third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.cpp6
-rw-r--r--third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp10
-rw-r--r--third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp6
-rw-r--r--third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp25
-rw-r--r--third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp2
-rw-r--r--third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp17
-rw-r--r--third_party/WebKit/Source/platform/graphics/gpu/Extensions3DUtil.cpp20
-rw-r--r--third_party/WebKit/Source/platform/graphics/gpu/Extensions3DUtil.h7
-rw-r--r--third_party/WebKit/Source/platform/graphics/gpu/SharedContextRateLimiter.cpp2
-rw-r--r--third_party/WebKit/Source/platform/graphics/test/MockWebGraphicsContext3D.h5
-rw-r--r--third_party/WebKit/public/platform/WebGraphicsContext3D.h9
14 files changed, 56 insertions, 88 deletions
diff --git a/components/test_runner/test_plugin.cc b/components/test_runner/test_plugin.cc
index efca2b6..b7ab570 100644
--- a/components/test_runner/test_plugin.cc
+++ b/components/test_runner/test_plugin.cc
@@ -502,7 +502,9 @@ void TestPlugin::DrawPrimitive() {
GLuint TestPlugin::LoadShader(GLenum type, const std::string& source) {
GLuint shader = gl_->CreateShader(type);
if (shader) {
- context_->shaderSource(shader, source.data());
+ const GLchar* shader_data = source.data();
+ GLint shader_length = strlen(shader_data); //source.length();
+ gl_->ShaderSource(shader, 1, &shader_data, &shader_length);
gl_->CompileShader(shader);
int compiled = 0;
diff --git a/gpu/blink/webgraphicscontext3d_impl.cc b/gpu/blink/webgraphicscontext3d_impl.cc
index 98fbb71..7a9a620 100644
--- a/gpu/blink/webgraphicscontext3d_impl.cc
+++ b/gpu/blink/webgraphicscontext3d_impl.cc
@@ -73,12 +73,6 @@ WebGraphicsContext3DImpl::~WebGraphicsContext3DImpl() {
}
-blink::WebString WebGraphicsContext3DImpl::
- getRequestableExtensionsCHROMIUM() {
- return blink::WebString::fromUTF8(
- gl_->GetRequestableExtensionsCHROMIUM());
-}
-
bool WebGraphicsContext3DImpl::getActiveAttrib(
WebGLId program, WGC3Duint index, ActiveInfo& info) {
GLint max_name_length = -1;
@@ -200,18 +194,6 @@ blink::WebString WebGraphicsContext3DImpl::
return res;
}
-blink::WebString WebGraphicsContext3DImpl::getString(
- WGC3Denum name) {
- return blink::WebString::fromUTF8(
- reinterpret_cast<const char*>(gl_->GetString(name)));
-}
-
-void WebGraphicsContext3DImpl::shaderSource(
- WebGLId shader, const WGC3Dchar* string) {
- GLint length = strlen(string);
- gl_->ShaderSource(shader, 1, &string, &length);
-}
-
void WebGraphicsContext3DImpl::setErrorMessageCallback(
WebGraphicsContext3D::WebGraphicsErrorMessageCallback* cb) {
error_message_callback_ = cb;
@@ -222,11 +204,6 @@ void WebGraphicsContext3DImpl::setContextLostCallback(
context_lost_callback_ = cb;
}
-void WebGraphicsContext3DImpl::pushGroupMarkerEXT(
- const WGC3Dchar* marker) {
- gl_->PushGroupMarkerEXT(0, marker);
-}
-
::gpu::gles2::GLES2Interface* WebGraphicsContext3DImpl::getGLES2Interface() {
return gl_;
}
diff --git a/gpu/blink/webgraphicscontext3d_impl.h b/gpu/blink/webgraphicscontext3d_impl.h
index 3f05ff1..db08260 100644
--- a/gpu/blink/webgraphicscontext3d_impl.h
+++ b/gpu/blink/webgraphicscontext3d_impl.h
@@ -47,12 +47,6 @@ class GPU_BLINK_EXPORT WebGraphicsContext3DImpl
blink::WebString getProgramInfoLog(blink::WebGLId program) override;
blink::WebString getShaderInfoLog(blink::WebGLId shader) override;
blink::WebString getShaderSource(blink::WebGLId shader) override;
- blink::WebString getString(blink::WGC3Denum name) override;
-
- void shaderSource(blink::WebGLId shader,
- const blink::WGC3Dchar* string) override;
-
- blink::WebString getRequestableExtensionsCHROMIUM() override;
blink::WebString getTranslatedShaderSourceANGLE(
blink::WebGLId shader) override;
@@ -63,8 +57,6 @@ class GPU_BLINK_EXPORT WebGraphicsContext3DImpl
void setErrorMessageCallback(
WebGraphicsContext3D::WebGraphicsErrorMessageCallback* callback) override;
- void pushGroupMarkerEXT(const blink::WGC3Dchar* marker) override;
-
// WebGraphicsContext3D implementation.
::gpu::gles2::GLES2Interface* getGLES2Interface() override;
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.cpp b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.cpp
index 3957cc4..c80ee7b 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.cpp
@@ -9,6 +9,7 @@
#include "core/frame/Settings.h"
#include "core/loader/FrameLoader.h"
#include "core/loader/FrameLoaderClient.h"
+#include "gpu/command_buffer/client/gles2_interface.h"
#include "modules/webgl/CHROMIUMSubscribeUniform.h"
#include "modules/webgl/EXTColorBufferFloat.h"
#include "modules/webgl/EXTDisjointTimerQuery.h"
@@ -41,12 +42,13 @@ PassOwnPtrWillBeRawPtr<CanvasRenderingContext> WebGL2RenderingContext::Factory::
OwnPtr<WebGraphicsContext3DProvider> contextProvider(createWebGraphicsContext3DProvider(canvas, attributes, 2));
if (!contextProvider)
return nullptr;
- OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(contextProvider->context3d(), contextProvider->contextGL());
+ gpu::gles2::GLES2Interface* gl = contextProvider->contextGL();
+ OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(gl);
if (!extensionsUtil)
return nullptr;
if (extensionsUtil->supportsExtension("GL_EXT_debug_marker")) {
String contextLabel(String::format("WebGL2RenderingContext-%p", contextProvider.get()));
- contextProvider->context3d()->pushGroupMarkerEXT(contextLabel.ascii().data());
+ gl->PushGroupMarkerEXT(0, contextLabel.ascii().data());
}
OwnPtrWillBeRawPtr<WebGL2RenderingContext> renderingContext = adoptPtrWillBeNoop(new WebGL2RenderingContext(canvas, contextProvider.release(), attributes));
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
index 0605fc2..d56b52a 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
@@ -30,6 +30,9 @@
#include "public/platform/WebGraphicsContext3DProvider.h"
#include "wtf/OwnPtr.h"
#include "wtf/PassOwnPtr.h"
+#include "wtf/text/WTFString.h"
+
+using WTF::String;
namespace blink {
@@ -2780,10 +2783,11 @@ ScriptValue WebGL2RenderingContextBase::getParameter(ScriptState* scriptState, G
if (isContextLost())
return ScriptValue::createNull(scriptState);
switch (pname) {
- case GL_SHADING_LANGUAGE_VERSION:
- return WebGLAny(scriptState, "WebGL GLSL ES 3.00 (" + String(webContext()->getString(GL_SHADING_LANGUAGE_VERSION)) + ")");
+ case GL_SHADING_LANGUAGE_VERSION: {
+ return WebGLAny(scriptState, "WebGL GLSL ES 3.00 (" + String(contextGL()->GetString(GL_SHADING_LANGUAGE_VERSION)) + ")");
+ }
case GL_VERSION:
- return WebGLAny(scriptState, "WebGL 2.0 (" + String(webContext()->getString(GL_VERSION)) + ")");
+ return WebGLAny(scriptState, "WebGL 2.0 (" + String(contextGL()->GetString(GL_VERSION)) + ")");
case GL_COPY_READ_BUFFER_BINDING:
return WebGLAny(scriptState, m_boundCopyReadBuffer.get());
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp
index c1f3dbf..458669e 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp
@@ -31,6 +31,7 @@
#include "core/layout/LayoutBox.h"
#include "core/loader/FrameLoader.h"
#include "core/loader/FrameLoaderClient.h"
+#include "gpu/command_buffer/client/gles2_interface.h"
#include "modules/webgl/ANGLEInstancedArrays.h"
#include "modules/webgl/CHROMIUMSubscribeUniform.h"
#include "modules/webgl/EXTBlendMinMax.h"
@@ -71,12 +72,13 @@ PassOwnPtrWillBeRawPtr<CanvasRenderingContext> WebGLRenderingContext::Factory::c
OwnPtr<WebGraphicsContext3DProvider> contextProvider(createWebGraphicsContext3DProvider(canvas, attributes, 1));
if (!contextProvider)
return nullptr;
- OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(contextProvider->context3d(), contextProvider->contextGL());
+ gpu::gles2::GLES2Interface* gl = contextProvider->contextGL();
+ OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(gl);
if (!extensionsUtil)
return nullptr;
if (extensionsUtil->supportsExtension("GL_EXT_debug_marker")) {
String contextLabel(String::format("WebGLRenderingContext-%p", contextProvider.get()));
- contextProvider->context3d()->pushGroupMarkerEXT(contextLabel.ascii().data());
+ gl->PushGroupMarkerEXT(0, contextLabel.ascii().data());
}
OwnPtrWillBeRawPtr<WebGLRenderingContext> renderingContext = adoptPtrWillBeNoop(new WebGLRenderingContext(canvas, contextProvider.release(), attributes));
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
index 0097f98..2ecf37d 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -99,6 +99,7 @@
#include "wtf/ArrayBufferContents.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/text/StringBuilder.h"
+#include "wtf/text/StringUTF8Adaptor.h"
namespace blink {
@@ -591,7 +592,8 @@ PassOwnPtr<WebGraphicsContext3DProvider> WebGLRenderingContextBase::createWebGra
canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcontextcreationerror, false, true, extractWebGLContextCreationError(glInfo)));
return nullptr;
}
- if (contextProvider->context3d()->getString(GL_EXTENSIONS).utf8().find("GL_OES_packed_depth_stencil") == std::string::npos) {
+ gpu::gles2::GLES2Interface* gl = contextProvider->contextGL();
+ if (!String(gl->GetString(GL_EXTENSIONS)).contains("GL_OES_packed_depth_stencil")) {
canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcontextcreationerror, false, true, "OES_packed_depth_stencil support is required."));
return nullptr;
}
@@ -2702,7 +2704,7 @@ ScriptValue WebGLRenderingContextBase::getParameter(ScriptState* scriptState, GL
case GL_SCISSOR_TEST:
return getBooleanParameter(scriptState, pname);
case GL_SHADING_LANGUAGE_VERSION:
- return WebGLAny(scriptState, "WebGL GLSL ES 1.0 (" + String(webContext()->getString(GL_SHADING_LANGUAGE_VERSION)) + ")");
+ return WebGLAny(scriptState, "WebGL GLSL ES 1.0 (" + String(contextGL()->GetString(GL_SHADING_LANGUAGE_VERSION)) + ")");
case GL_STENCIL_BACK_FAIL:
return getUnsignedIntParameter(scriptState, pname);
case GL_STENCIL_BACK_FUNC:
@@ -2756,7 +2758,7 @@ ScriptValue WebGLRenderingContextBase::getParameter(ScriptState* scriptState, GL
case GL_VENDOR:
return WebGLAny(scriptState, String("WebKit"));
case GL_VERSION:
- return WebGLAny(scriptState, "WebGL 1.0 (" + String(webContext()->getString(GL_VERSION)) + ")");
+ return WebGLAny(scriptState, "WebGL 1.0 (" + String(contextGL()->GetString(GL_VERSION)) + ")");
case GL_VIEWPORT:
return getWebGLIntArrayParameter(scriptState, pname);
case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: // OES_standard_derivatives
@@ -2766,12 +2768,12 @@ ScriptValue WebGLRenderingContextBase::getParameter(ScriptState* scriptState, GL
return ScriptValue::createNull(scriptState);
case WebGLDebugRendererInfo::UNMASKED_RENDERER_WEBGL:
if (extensionEnabled(WebGLDebugRendererInfoName))
- return WebGLAny(scriptState, webContext()->getString(GL_RENDERER));
+ return WebGLAny(scriptState, String(contextGL()->GetString(GL_RENDERER)));
synthesizeGLError(GL_INVALID_ENUM, "getParameter", "invalid parameter name, WEBGL_debug_renderer_info not enabled");
return ScriptValue::createNull(scriptState);
case WebGLDebugRendererInfo::UNMASKED_VENDOR_WEBGL:
if (extensionEnabled(WebGLDebugRendererInfoName))
- return WebGLAny(scriptState, webContext()->getString(GL_VENDOR));
+ return WebGLAny(scriptState, String(contextGL()->GetString(GL_VENDOR)));
synthesizeGLError(GL_INVALID_ENUM, "getParameter", "invalid parameter name, WEBGL_debug_renderer_info not enabled");
return ScriptValue::createNull(scriptState);
case GL_VERTEX_ARRAY_BINDING_OES: // OES_vertex_array_object
@@ -3718,10 +3720,16 @@ void WebGLRenderingContextBase::shaderSource(WebGLShader* shader, const String&
if (isContextLost() || !validateWebGLObject("shaderSource", shader))
return;
String stringWithoutComments = StripComments(string).result();
+ // TODO(danakj): Make validateString reject characters > 255 (or utf16 Strings)
+ // so we don't need to use StringUTF8Adaptor.
if (!validateString("shaderSource", stringWithoutComments))
return;
shader->setSource(string);
- webContext()->shaderSource(objectOrZero(shader), stringWithoutComments.utf8().data());
+ WTF::StringUTF8Adaptor adaptor(stringWithoutComments);
+ const GLchar* shaderData = adaptor.data();
+ // TODO(danakj): Use base::saturated_cast<GLint>.
+ const GLint shaderLength = adaptor.length();
+ contextGL()->ShaderSource(objectOrZero(shader), 1, &shaderData, &shaderLength);
}
void WebGLRenderingContextBase::stencilFunc(GLenum func, GLint ref, GLuint mask)
@@ -5116,10 +5124,9 @@ void WebGLRenderingContextBase::setFilterQuality(SkFilterQuality filterQuality)
Extensions3DUtil* WebGLRenderingContextBase::extensionsUtil()
{
if (!m_extensionsUtil) {
- WebGraphicsContext3D* context = webContext();
gpu::gles2::GLES2Interface* gl = contextGL();
- m_extensionsUtil = Extensions3DUtil::create(context, gl);
- // The only reason the ExtensionsUtil should be invalid is if the webContext is lost.
+ m_extensionsUtil = Extensions3DUtil::create(gl);
+ // The only reason the ExtensionsUtil should be invalid is if the gl context is lost.
ASSERT(m_extensionsUtil->isValid() || gl->GetGraphicsResetStatusKHR() != GL_NO_ERROR);
}
return m_extensionsUtil.get();
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
index e23fd13..bc5f228 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -98,7 +98,7 @@ PassRefPtr<DrawingBuffer> DrawingBuffer::create(PassOwnPtr<WebGraphicsContext3DP
return nullptr;
}
- OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(contextProvider->context3d(), contextProvider->contextGL());
+ OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(contextProvider->contextGL());
if (!extensionsUtil->isValid()) {
// This might be the first time we notice that the GL context is lost.
return nullptr;
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp
index 5826e69..9b6258f 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp
@@ -239,7 +239,7 @@ class DrawingBufferForTests : public DrawingBuffer {
public:
static PassRefPtr<DrawingBufferForTests> create(PassOwnPtr<WebGraphicsContext3DProvider> contextProvider, const IntSize& size, PreserveDrawingBuffer preserve)
{
- OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(contextProvider->context3d(), contextProvider->contextGL());
+ OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(contextProvider->contextGL());
RefPtr<DrawingBufferForTests> drawingBuffer = adoptRef(new DrawingBufferForTests(contextProvider, extensionsUtil.release(), preserve));
if (!drawingBuffer->initialize(size)) {
drawingBuffer->beginDestruction();
@@ -646,6 +646,13 @@ public:
}
}
+ const GLubyte* GetString(GLenum type) override
+ {
+ if (type == GL_EXTENSIONS)
+ return reinterpret_cast<const GLubyte*>("GL_OES_packed_depth_stencil");
+ return reinterpret_cast<const GLubyte*>("");
+ }
+
void GenRenderbuffers(GLsizei n, GLuint* renderbuffers) override
{
for (GLsizei i = 0; i < n; ++i)
@@ -677,14 +684,6 @@ public:
WebGLId depthAttachment() const { return m_contextGL->depthAttachment(); }
WebGLId depthStencilAttachment() const { return m_contextGL->depthStencilAttachment(); }
- WebString getString(WGC3Denum type) override
- {
- if (type == GL_EXTENSIONS) {
- return WebString::fromUTF8("GL_OES_packed_depth_stencil");
- }
- return WebString();
- }
-
gpu::gles2::GLES2Interface* getGLES2Interface() override { return m_contextGL; }
private:
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/Extensions3DUtil.cpp b/third_party/WebKit/Source/platform/graphics/gpu/Extensions3DUtil.cpp
index ce6494c..e68bc79 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/Extensions3DUtil.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/Extensions3DUtil.cpp
@@ -5,7 +5,8 @@
#include "platform/graphics/gpu/Extensions3DUtil.h"
#include "gpu/command_buffer/client/gles2_interface.h"
-#include "public/platform/WebGraphicsContext3D.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
#include "wtf/text/CString.h"
#include "wtf/text/StringHash.h"
@@ -23,16 +24,15 @@ void splitStringHelper(const String& str, HashSet<String>& set)
} // anonymous namespace
-PassOwnPtr<Extensions3DUtil> Extensions3DUtil::create(WebGraphicsContext3D* context, gpu::gles2::GLES2Interface* gl)
+PassOwnPtr<Extensions3DUtil> Extensions3DUtil::create(gpu::gles2::GLES2Interface* gl)
{
- OwnPtr<Extensions3DUtil> out = adoptPtr(new Extensions3DUtil(context, gl));
+ OwnPtr<Extensions3DUtil> out = adoptPtr(new Extensions3DUtil(gl));
out->initializeExtensions();
return out.release();
}
-Extensions3DUtil::Extensions3DUtil(WebGraphicsContext3D* context, gpu::gles2::GLES2Interface* gl)
- : m_context(context)
- , m_gl(gl)
+Extensions3DUtil::Extensions3DUtil(gpu::gles2::GLES2Interface* gl)
+ : m_gl(gl)
, m_isValid(true)
{
}
@@ -50,10 +50,10 @@ void Extensions3DUtil::initializeExtensions()
return;
}
- String extensionsString = m_context->getString(GL_EXTENSIONS);
+ String extensionsString(m_gl->GetString(GL_EXTENSIONS));
splitStringHelper(extensionsString, m_enabledExtensions);
- String requestableExtensionsString = m_context->getRequestableExtensionsCHROMIUM();
+ String requestableExtensionsString(m_gl->GetRequestableExtensionsCHROMIUM());
splitStringHelper(requestableExtensionsString, m_requestableExtensions);
}
@@ -84,8 +84,8 @@ bool Extensions3DUtil::isExtensionEnabled(const String& name)
bool Extensions3DUtil::canUseCopyTextureCHROMIUM(GLenum destTarget, GLenum destFormat, GLenum destType, GLint level)
{
- // FIXME: restriction of (RGB || RGBA)/UNSIGNED_BYTE/(Level 0) should be lifted when
- // WebGraphicsContext3D::copyTextureCHROMIUM(...) are fully functional.
+ // TODO(zmo): restriction of (RGB || RGBA)/UNSIGNED_BYTE/(Level 0) should be lifted when
+ // GLES2Interface::CopyTextureCHROMIUM(...) are fully functional.
if (destTarget == GL_TEXTURE_2D && (destFormat == GL_RGB || destFormat == GL_RGBA)
&& destType == GL_UNSIGNED_BYTE
&& !level)
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/Extensions3DUtil.h b/third_party/WebKit/Source/platform/graphics/gpu/Extensions3DUtil.h
index 0e36c32..b6f8eab 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/Extensions3DUtil.h
+++ b/third_party/WebKit/Source/platform/graphics/gpu/Extensions3DUtil.h
@@ -23,14 +23,12 @@ class GLES2Interface;
namespace blink {
-class WebGraphicsContext3D;
-
class PLATFORM_EXPORT Extensions3DUtil final {
USING_FAST_MALLOC(Extensions3DUtil);
WTF_MAKE_NONCOPYABLE(Extensions3DUtil);
public:
// Creates a new Extensions3DUtil. If the passed GLES2Interface has been spontaneously lost, returns null.
- static PassOwnPtr<Extensions3DUtil> create(WebGraphicsContext3D*, gpu::gles2::GLES2Interface*);
+ static PassOwnPtr<Extensions3DUtil> create(gpu::gles2::GLES2Interface*);
~Extensions3DUtil();
bool isValid() { return m_isValid; }
@@ -42,10 +40,9 @@ public:
static bool canUseCopyTextureCHROMIUM(GLenum destTarget, GLenum destFormat, GLenum destType, GLint level);
private:
- Extensions3DUtil(WebGraphicsContext3D*, gpu::gles2::GLES2Interface*);
+ Extensions3DUtil(gpu::gles2::GLES2Interface*);
void initializeExtensions();
- WebGraphicsContext3D* m_context;
gpu::gles2::GLES2Interface* m_gl;
HashSet<String> m_enabledExtensions;
HashSet<String> m_requestableExtensions;
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/SharedContextRateLimiter.cpp b/third_party/WebKit/Source/platform/graphics/gpu/SharedContextRateLimiter.cpp
index 1770d7e..fa3cf4f 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/SharedContextRateLimiter.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/SharedContextRateLimiter.cpp
@@ -31,7 +31,7 @@ SharedContextRateLimiter::SharedContextRateLimiter(unsigned maxPendingTicks)
gpu::gles2::GLES2Interface* gl = m_contextProvider->contextGL();
if (gl && gl->GetGraphicsResetStatusKHR() == GL_NO_ERROR) {
- OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(m_contextProvider->context3d(), gl);
+ OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(gl);
// TODO(junov): when the GLES 3.0 command buffer is ready, we could use fenceSync instead
m_canUseSyncQueries = extensionsUtil->supportsExtension("GL_CHROMIUM_sync_query");
}
diff --git a/third_party/WebKit/Source/platform/graphics/test/MockWebGraphicsContext3D.h b/third_party/WebKit/Source/platform/graphics/test/MockWebGraphicsContext3D.h
index 73ef50e..f7f3c1b 100644
--- a/third_party/WebKit/Source/platform/graphics/test/MockWebGraphicsContext3D.h
+++ b/third_party/WebKit/Source/platform/graphics/test/MockWebGraphicsContext3D.h
@@ -41,8 +41,6 @@ public:
{
}
- virtual WebString getRequestableExtensionsCHROMIUM() { return WebString(); }
-
virtual void blitFramebufferCHROMIUM(WGC3Dint srcX0, WGC3Dint srcY0, WGC3Dint srcX1, WGC3Dint srcY1, WGC3Dint dstX0, WGC3Dint dstY0, WGC3Dint dstX1, WGC3Dint dstY1, WGC3Dbitfield mask, WGC3Denum filter) { }
virtual bool getActiveAttrib(WebGLId program, WGC3Duint index, ActiveInfo&) { return false; }
@@ -51,9 +49,6 @@ public:
virtual WebString getProgramInfoLog(WebGLId program) { return WebString(); }
virtual WebString getShaderInfoLog(WebGLId shader) { return WebString(); }
virtual WebString getShaderSource(WebGLId shader) { return WebString(); }
- virtual WebString getString(WGC3Denum name) { return WebString(); }
-
- virtual void shaderSource(WebGLId shader, const WGC3Dchar* string) { }
virtual WebString getTranslatedShaderSourceANGLE(WebGLId) { return WebString(); }
diff --git a/third_party/WebKit/public/platform/WebGraphicsContext3D.h b/third_party/WebKit/public/platform/WebGraphicsContext3D.h
index 66ed504..2f59efb 100644
--- a/third_party/WebKit/public/platform/WebGraphicsContext3D.h
+++ b/third_party/WebKit/public/platform/WebGraphicsContext3D.h
@@ -136,9 +136,6 @@ public:
// This destructor needs to be public so that using classes can destroy instances if initialization fails.
virtual ~WebGraphicsContext3D() { }
- // GL_CHROMIUM_request_extension
- virtual WebString getRequestableExtensionsCHROMIUM() = 0;
-
// The entry points below map directly to the OpenGL ES 2.0 API.
// See: http://www.khronos.org/registry/gles/
// and: http://www.khronos.org/opengles/sdk/docs/man/
@@ -147,18 +144,12 @@ public:
virtual WebString getProgramInfoLog(WebGLId program) = 0;
virtual WebString getShaderInfoLog(WebGLId shader) = 0;
virtual WebString getShaderSource(WebGLId shader) = 0;
- virtual WebString getString(WGC3Denum name) = 0;
-
- virtual void shaderSource(WebGLId shader, const WGC3Dchar* string) = 0;
virtual void setContextLostCallback(WebGraphicsContextLostCallback* callback) { }
virtual void setErrorMessageCallback(WebGraphicsErrorMessageCallback* callback) { }
virtual WebString getTranslatedShaderSourceANGLE(WebGLId shader) = 0;
- // GL_EXT_debug_marker
- virtual void pushGroupMarkerEXT(const WGC3Dchar* marker) { }
-
// Prefer getting a GLES2Interface off WebGraphicsContext3DProvider if possible, and avoid using WebGraphicsContext3D at all.
virtual gpu::gles2::GLES2Interface* getGLES2Interface() = 0;
};