Commit 0cf4de9c authored by bajones@chromium.org's avatar bajones@chromium.org

Adding Blink-side support for EXT_shader_texture_lod

BUG=344583

Review URL: https://codereview.chromium.org/171263004

git-svn-id: svn://svn.chromium.org/blink/trunk@171465 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 8c5aea02
......@@ -33,6 +33,7 @@
#include "V8ANGLEInstancedArrays.h"
#include "V8EXTFragDepth.h"
#include "V8EXTShaderTextureLOD.h"
#include "V8EXTTextureFilterAnisotropic.h"
#include "V8HTMLCanvasElement.h"
#include "V8HTMLImageElement.h"
......@@ -191,6 +192,10 @@ static v8::Handle<v8::Value> toV8Object(WebGLExtension* extension, v8::Handle<v8
extensionObject = toV8(static_cast<EXTFragDepth*>(extension), contextObject, isolate);
referenceName = "extFragDepthName";
break;
case EXTShaderTextureLODName:
extensionObject = toV8(static_cast<EXTShaderTextureLOD*>(extension), contextObject, isolate);
referenceName = "extShaderTextureLODName";
break;
case EXTTextureFilterAnisotropicName:
extensionObject = toV8(static_cast<EXTTextureFilterAnisotropic*>(extension), contextObject, isolate);
referenceName = "extTextureFilterAnisotropicName";
......
......@@ -221,6 +221,7 @@
'html/canvas/CanvasPattern.idl',
'html/canvas/CanvasRenderingContext2D.idl',
'html/canvas/EXTFragDepth.idl',
'html/canvas/EXTShaderTextureLOD.idl',
'html/canvas/EXTTextureFilterAnisotropic.idl',
'html/canvas/OESElementIndexUint.idl',
'html/canvas/OESStandardDerivatives.idl',
......@@ -2496,6 +2497,8 @@
'html/canvas/DataView.h',
'html/canvas/EXTFragDepth.cpp',
'html/canvas/EXTFragDepth.h',
'html/canvas/EXTShaderTextureLOD.cpp',
'html/canvas/EXTShaderTextureLOD.h',
'html/canvas/EXTTextureFilterAnisotropic.cpp',
'html/canvas/EXTTextureFilterAnisotropic.h',
'html/canvas/OESElementIndexUint.cpp',
......
// 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.
#include "config.h"
#include "core/html/canvas/EXTShaderTextureLOD.h"
namespace WebCore {
EXTShaderTextureLOD::EXTShaderTextureLOD(WebGLRenderingContextBase* context)
: WebGLExtension(context)
{
ScriptWrappable::init(this);
context->extensionsUtil()->ensureExtensionEnabled("GL_EXT_shader_texture_lod");
}
EXTShaderTextureLOD::~EXTShaderTextureLOD()
{
}
WebGLExtensionName EXTShaderTextureLOD::name() const
{
return EXTShaderTextureLODName;
}
PassRefPtr<EXTShaderTextureLOD> EXTShaderTextureLOD::create(WebGLRenderingContextBase* context)
{
return adoptRef(new EXTShaderTextureLOD(context));
}
bool EXTShaderTextureLOD::supported(WebGLRenderingContextBase* context)
{
return context->extensionsUtil()->supportsExtension("GL_EXT_shader_texture_lod");
}
const char* EXTShaderTextureLOD::extensionName()
{
return "EXT_shader_texture_lod";
}
} // namespace WebCore
// 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 EXTShaderTextureLOD_h
#define EXTShaderTextureLOD_h
#include "bindings/v8/ScriptWrappable.h"
#include "core/html/canvas/WebGLExtension.h"
#include "wtf/PassRefPtr.h"
namespace WebCore {
class EXTShaderTextureLOD FINAL : public WebGLExtension, public ScriptWrappable {
public:
static PassRefPtr<EXTShaderTextureLOD> create(WebGLRenderingContextBase*);
static bool supported(WebGLRenderingContextBase*);
static const char* extensionName();
virtual ~EXTShaderTextureLOD();
virtual WebGLExtensionName name() const OVERRIDE;
private:
EXTShaderTextureLOD(WebGLRenderingContextBase*);
};
} // namespace WebCore
#endif // EXTShaderTextureLOD_h
// 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.
[
NoInterfaceObject
] interface EXTShaderTextureLOD {
};
......@@ -11,6 +11,7 @@ namespace WebCore {
enum WebGLExtensionName {
ANGLEInstancedArraysName,
EXTFragDepthName,
EXTShaderTextureLODName,
EXTTextureFilterAnisotropicName,
OESElementIndexUintName,
OESStandardDerivativesName,
......
......@@ -29,6 +29,7 @@
#include "core/frame/LocalFrame.h"
#include "core/html/canvas/ANGLEInstancedArrays.h"
#include "core/html/canvas/EXTFragDepth.h"
#include "core/html/canvas/EXTShaderTextureLOD.h"
#include "core/html/canvas/EXTTextureFilterAnisotropic.h"
#include "core/html/canvas/OESElementIndexUint.h"
#include "core/html/canvas/OESStandardDerivatives.h"
......@@ -139,6 +140,7 @@ void WebGLRenderingContext::registerContextExtensions()
// Register draft extensions.
registerExtension<EXTFragDepth>(m_extFragDepth, DraftExtension);
registerExtension<EXTShaderTextureLOD>(m_extShaderTextureLOD, DraftExtension);
// Register privileged extensions.
registerExtension<WebGLDebugRendererInfo>(m_webglDebugRendererInfo, WebGLDebugRendererInfoExtension);
......
......@@ -46,6 +46,7 @@ private:
// Enabled extension objects.
RefPtr<ANGLEInstancedArrays> m_angleInstancedArrays;
RefPtr<EXTFragDepth> m_extFragDepth;
RefPtr<EXTShaderTextureLOD> m_extShaderTextureLOD;
RefPtr<EXTTextureFilterAnisotropic> m_extTextureFilterAnisotropic;
RefPtr<OESTextureFloat> m_oesTextureFloat;
RefPtr<OESTextureFloatLinear> m_oesTextureFloatLinear;
......
......@@ -39,6 +39,7 @@
#include "core/html/ImageData.h"
#include "core/html/canvas/ANGLEInstancedArrays.h"
#include "core/html/canvas/EXTFragDepth.h"
#include "core/html/canvas/EXTShaderTextureLOD.h"
#include "core/html/canvas/EXTTextureFilterAnisotropic.h"
#include "core/html/canvas/OESElementIndexUint.h"
#include "core/html/canvas/OESStandardDerivatives.h"
......
......@@ -52,6 +52,7 @@ namespace WebCore {
class ANGLEInstancedArrays;
class EXTFragDepth;
class EXTShaderTextureLOD;
class EXTTextureFilterAnisotropic;
class ExceptionState;
class HTMLImageElement;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment