2 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #include "Extensions3DChromium.h"
32 #include "GraphicsContext3D.h"
33 #include "GraphicsContext3DPrivate.h"
37 Extensions3DChromium::Extensions3DChromium(GraphicsContext3DPrivate* priv)
42 Extensions3DChromium::~Extensions3DChromium()
46 bool Extensions3DChromium::supports(const String& name)
48 return m_private->supportsExtension(name);
51 void Extensions3DChromium::ensureEnabled(const String& name)
56 m_private->ensureExtensionEnabled(name);
60 bool Extensions3DChromium::isEnabled(const String& name)
62 return m_private->isExtensionEnabled(name);
65 int Extensions3DChromium::getGraphicsResetStatusARB()
67 return static_cast<int>(m_private->getGraphicsResetStatusARB());
70 void Extensions3DChromium::blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter)
72 m_private->blitFramebufferCHROMIUM(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
75 void Extensions3DChromium::renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height)
77 m_private->renderbufferStorageMultisampleCHROMIUM(target, samples, internalformat, width, height);
80 void Extensions3DChromium::postSubBufferCHROMIUM(int x, int y, int width, int height)
82 m_private->postSubBufferCHROMIUM(x, y, width, height);
85 void* Extensions3DChromium::mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access)
87 return m_private->mapBufferSubDataCHROMIUM(target, offset, size, access);
90 void Extensions3DChromium::unmapBufferSubDataCHROMIUM(const void* data)
92 m_private->unmapBufferSubDataCHROMIUM(data);
95 void* Extensions3DChromium::mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access)
97 return m_private->mapTexSubImage2DCHROMIUM(target, level, xoffset, yoffset, width, height, format, type, access);
100 void Extensions3DChromium::unmapTexSubImage2DCHROMIUM(const void* data)
102 m_private->unmapTexSubImage2DCHROMIUM(data);
105 void Extensions3DChromium::setVisibilityCHROMIUM(bool visibility)
107 m_private->setVisibilityCHROMIUM(visibility);
110 Platform3DObject Extensions3DChromium::createVertexArrayOES()
115 void Extensions3DChromium::deleteVertexArrayOES(Platform3DObject)
119 GC3Dboolean Extensions3DChromium::isVertexArrayOES(Platform3DObject)
124 void Extensions3DChromium::bindVertexArrayOES(Platform3DObject)
128 String Extensions3DChromium::getTranslatedShaderSourceANGLE(Platform3DObject shader)
130 return m_private->getTranslatedShaderSourceANGLE(shader);
133 void Extensions3DChromium::setSwapBuffersCompleteCallbackCHROMIUM(PassOwnPtr<SwapBuffersCompleteCallbackCHROMIUM> callback)
135 m_private->setSwapBuffersCompleteCallbackCHROMIUM(callback);
138 void Extensions3DChromium::rateLimitOffscreenContextCHROMIUM()
140 m_private->rateLimitOffscreenContextCHROMIUM();
143 void Extensions3DChromium::paintFramebufferToCanvas(int framebuffer, int width, int height, bool premultiplyAlpha, ImageBuffer* imageBuffer)
145 m_private->paintFramebufferToCanvas(framebuffer, width, height, premultiplyAlpha, imageBuffer);
148 void Extensions3DChromium::texImageIOSurface2DCHROMIUM(unsigned target, int width, int height, uint32_t ioSurfaceId, unsigned plane)
150 m_private->texImageIOSurface2DCHROMIUM(target, width, height, ioSurfaceId, plane);
153 } // namespace WebCore
155 #endif // ENABLE(WEBGL)