1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
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.
13 *
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.
24 */
25
26 #include "config.h"
27
28 #if ENABLE(WEBGL)
29
30 #include "Extensions3DChromium.h"
31
32 #include "GraphicsContext3D.h"
33 #include "GraphicsContext3DInternal.h"
34
35 namespace WebCore {
36
Extensions3DChromium(GraphicsContext3DInternal * internal)37 Extensions3DChromium::Extensions3DChromium(GraphicsContext3DInternal* internal)
38 : m_internal(internal)
39 {
40 }
41
~Extensions3DChromium()42 Extensions3DChromium::~Extensions3DChromium()
43 {
44 }
45
supports(const String & name)46 bool Extensions3DChromium::supports(const String& name)
47 {
48 return m_internal->supportsExtension(name);
49 }
50
ensureEnabled(const String & name)51 void Extensions3DChromium::ensureEnabled(const String& name)
52 {
53 #ifndef NDEBUG
54 bool result =
55 #endif
56 m_internal->ensureExtensionEnabled(name);
57 ASSERT(result);
58 }
59
isEnabled(const String & name)60 bool Extensions3DChromium::isEnabled(const String& name)
61 {
62 return m_internal->isExtensionEnabled(name);
63 }
64
getGraphicsResetStatusARB()65 int Extensions3DChromium::getGraphicsResetStatusARB()
66 {
67 return m_internal->isContextLost() ? static_cast<int>(Extensions3D::UNKNOWN_CONTEXT_RESET_ARB) : static_cast<int>(GraphicsContext3D::NO_ERROR);
68 }
69
blitFramebuffer(long srcX0,long srcY0,long srcX1,long srcY1,long dstX0,long dstY0,long dstX1,long dstY1,unsigned long mask,unsigned long filter)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)
71 {
72 m_internal->blitFramebufferCHROMIUM(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
73 }
74
renderbufferStorageMultisample(unsigned long target,unsigned long samples,unsigned long internalformat,unsigned long width,unsigned long height)75 void Extensions3DChromium::renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height)
76 {
77 m_internal->renderbufferStorageMultisampleCHROMIUM(target, samples, internalformat, width, height);
78 }
79
mapBufferSubDataCHROMIUM(unsigned target,int offset,int size,unsigned access)80 void* Extensions3DChromium::mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access)
81 {
82 return m_internal->mapBufferSubDataCHROMIUM(target, offset, size, access);
83 }
84
unmapBufferSubDataCHROMIUM(const void * data)85 void Extensions3DChromium::unmapBufferSubDataCHROMIUM(const void* data)
86 {
87 m_internal->unmapBufferSubDataCHROMIUM(data);
88 }
89
mapTexSubImage2DCHROMIUM(unsigned target,int level,int xoffset,int yoffset,int width,int height,unsigned format,unsigned type,unsigned access)90 void* Extensions3DChromium::mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access)
91 {
92 return m_internal->mapTexSubImage2DCHROMIUM(target, level, xoffset, yoffset, width, height, format, type, access);
93 }
94
unmapTexSubImage2DCHROMIUM(const void * data)95 void Extensions3DChromium::unmapTexSubImage2DCHROMIUM(const void* data)
96 {
97 m_internal->unmapTexSubImage2DCHROMIUM(data);
98 }
99
copyTextureToParentTextureCHROMIUM(unsigned texture,unsigned parentTexture)100 void Extensions3DChromium::copyTextureToParentTextureCHROMIUM(unsigned texture, unsigned parentTexture)
101 {
102 m_internal->copyTextureToParentTextureCHROMIUM(texture, parentTexture);
103 }
104
getParentToChildLatchCHROMIUM(GC3Duint * latchId)105 void Extensions3DChromium::getParentToChildLatchCHROMIUM(GC3Duint* latchId)
106 {
107 m_internal->getParentToChildLatchCHROMIUM(latchId);
108 }
109
getChildToParentLatchCHROMIUM(GC3Duint * latchId)110 void Extensions3DChromium::getChildToParentLatchCHROMIUM(GC3Duint* latchId)
111 {
112 m_internal->getChildToParentLatchCHROMIUM(latchId);
113 }
114
waitLatchCHROMIUM(GC3Duint latchId)115 void Extensions3DChromium::waitLatchCHROMIUM(GC3Duint latchId)
116 {
117 m_internal->waitLatchCHROMIUM(latchId);
118 }
119
setLatchCHROMIUM(GC3Duint latchId)120 void Extensions3DChromium::setLatchCHROMIUM(GC3Duint latchId)
121 {
122 m_internal->setLatchCHROMIUM(latchId);
123 }
124
createVertexArrayOES()125 Platform3DObject Extensions3DChromium::createVertexArrayOES()
126 {
127 return 0;
128 }
129
deleteVertexArrayOES(Platform3DObject)130 void Extensions3DChromium::deleteVertexArrayOES(Platform3DObject)
131 {
132 }
133
isVertexArrayOES(Platform3DObject)134 GC3Dboolean Extensions3DChromium::isVertexArrayOES(Platform3DObject)
135 {
136 return 0;
137 }
138
bindVertexArrayOES(Platform3DObject)139 void Extensions3DChromium::bindVertexArrayOES(Platform3DObject)
140 {
141 }
142
143 } // namespace WebCore
144
145 #endif // ENABLE(WEBGL)
146