Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: cc/test/fake_web_graphics_context_3d.h

Issue 11150025: Patch from https://codereview.chromium.org/11111005/ without actual file deletes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/software_renderer_unittest.cc ('k') | cc/test/tiled_layer_test_common.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef FakeWebGraphicsContext3D_h 5 #ifndef FakeWebGraphicsContext3D_h
6 #define FakeWebGraphicsContext3D_h 6 #define FakeWebGraphicsContext3D_h
7 7
8 #include "GraphicsContext3D.h" 8 #include "third_party/khronos/GLES2/gl2.h"
9 #include <public/WebGraphicsContext3D.h> 9 #include <public/WebGraphicsContext3D.h>
10 10
11 namespace WebKit { 11 namespace WebKit {
12 12
13 // WebGraphicsContext3D base class for use in WebKit unit tests. 13 // WebGraphicsContext3D base class for use in WebKit unit tests.
14 // All operations are no-ops (returning 0 if necessary). 14 // All operations are no-ops (returning 0 if necessary).
15 class FakeWebGraphicsContext3D : public WebGraphicsContext3D { 15 class FakeWebGraphicsContext3D : public WebGraphicsContext3D {
16 public: 16 public:
17 FakeWebGraphicsContext3D() 17 FakeWebGraphicsContext3D()
18 : m_nextTextureId(1) 18 : m_nextTextureId(1)
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 virtual void blendEquation(WGC3Denum mode) { } 69 virtual void blendEquation(WGC3Denum mode) { }
70 virtual void blendEquationSeparate(WGC3Denum modeRGB, WGC3Denum modeAlpha) { } 70 virtual void blendEquationSeparate(WGC3Denum modeRGB, WGC3Denum modeAlpha) { }
71 virtual void blendFunc(WGC3Denum sfactor, WGC3Denum dfactor) { } 71 virtual void blendFunc(WGC3Denum sfactor, WGC3Denum dfactor) { }
72 virtual void blendFuncSeparate(WGC3Denum srcRGB, WGC3Denum dstRGB, WGC3Denum srcAlpha, WGC3Denum dstAlpha) { } 72 virtual void blendFuncSeparate(WGC3Denum srcRGB, WGC3Denum dstRGB, WGC3Denum srcAlpha, WGC3Denum dstAlpha) { }
73 73
74 virtual void bufferData(WGC3Denum target, WGC3Dsizeiptr size, const void* da ta, WGC3Denum usage) { } 74 virtual void bufferData(WGC3Denum target, WGC3Dsizeiptr size, const void* da ta, WGC3Denum usage) { }
75 virtual void bufferSubData(WGC3Denum target, WGC3Dintptr offset, WGC3Dsizeip tr size, const void* data) { } 75 virtual void bufferSubData(WGC3Denum target, WGC3Dintptr offset, WGC3Dsizeip tr size, const void* data) { }
76 76
77 virtual WGC3Denum checkFramebufferStatus(WGC3Denum target) 77 virtual WGC3Denum checkFramebufferStatus(WGC3Denum target)
78 { 78 {
79 return cc::GraphicsContext3D::FRAMEBUFFER_COMPLETE; 79 return GL_FRAMEBUFFER_COMPLETE;
80 } 80 }
81 81
82 virtual void clear(WGC3Dbitfield mask) { } 82 virtual void clear(WGC3Dbitfield mask) { }
83 virtual void clearColor(WGC3Dclampf red, WGC3Dclampf green, WGC3Dclampf blue , WGC3Dclampf alpha) { } 83 virtual void clearColor(WGC3Dclampf red, WGC3Dclampf green, WGC3Dclampf blue , WGC3Dclampf alpha) { }
84 virtual void clearDepth(WGC3Dclampf depth) { } 84 virtual void clearDepth(WGC3Dclampf depth) { }
85 virtual void clearStencil(WGC3Dint s) { } 85 virtual void clearStencil(WGC3Dint s) { }
86 virtual void colorMask(WGC3Dboolean red, WGC3Dboolean green, WGC3Dboolean bl ue, WGC3Dboolean alpha) { } 86 virtual void colorMask(WGC3Dboolean red, WGC3Dboolean green, WGC3Dboolean bl ue, WGC3Dboolean alpha) { }
87 virtual void compileShader(WebGLId shader) { } 87 virtual void compileShader(WebGLId shader) { }
88 88
89 virtual void compressedTexImage2D(WGC3Denum target, WGC3Dint level, WGC3Denu m internalformat, WGC3Dsizei width, WGC3Dsizei height, WGC3Dint border, WGC3Dsiz ei imageSize, const void* data) { } 89 virtual void compressedTexImage2D(WGC3Denum target, WGC3Dint level, WGC3Denu m internalformat, WGC3Dsizei width, WGC3Dsizei height, WGC3Dint border, WGC3Dsiz ei imageSize, const void* data) { }
(...skipping 25 matching lines...) Expand all
115 virtual WGC3Dint getAttribLocation(WebGLId program, const WGC3Dchar* name) { return 0; } 115 virtual WGC3Dint getAttribLocation(WebGLId program, const WGC3Dchar* name) { return 0; }
116 virtual void getBooleanv(WGC3Denum pname, WGC3Dboolean* value) { } 116 virtual void getBooleanv(WGC3Denum pname, WGC3Dboolean* value) { }
117 virtual void getBufferParameteriv(WGC3Denum target, WGC3Denum pname, WGC3Din t* value) { } 117 virtual void getBufferParameteriv(WGC3Denum target, WGC3Denum pname, WGC3Din t* value) { }
118 virtual Attributes getContextAttributes() { return m_attrs; } 118 virtual Attributes getContextAttributes() { return m_attrs; }
119 virtual WGC3Denum getError() { return 0; } 119 virtual WGC3Denum getError() { return 0; }
120 virtual void getFloatv(WGC3Denum pname, WGC3Dfloat* value) { } 120 virtual void getFloatv(WGC3Denum pname, WGC3Dfloat* value) { }
121 virtual void getFramebufferAttachmentParameteriv(WGC3Denum target, WGC3Denum attachment, WGC3Denum pname, WGC3Dint* value) { } 121 virtual void getFramebufferAttachmentParameteriv(WGC3Denum target, WGC3Denum attachment, WGC3Denum pname, WGC3Dint* value) { }
122 122
123 virtual void getIntegerv(WGC3Denum pname, WGC3Dint* value) 123 virtual void getIntegerv(WGC3Denum pname, WGC3Dint* value)
124 { 124 {
125 if (pname == cc::GraphicsContext3D::MAX_TEXTURE_SIZE) 125 if (pname == GL_MAX_TEXTURE_SIZE)
126 *value = 1024; 126 *value = 1024;
127 } 127 }
128 128
129 virtual void getProgramiv(WebGLId program, WGC3Denum pname, WGC3Dint* value) 129 virtual void getProgramiv(WebGLId program, WGC3Denum pname, WGC3Dint* value)
130 { 130 {
131 if (pname == cc::GraphicsContext3D::LINK_STATUS) 131 if (pname == GL_LINK_STATUS)
132 *value = 1; 132 *value = 1;
133 } 133 }
134 134
135 virtual WebString getProgramInfoLog(WebGLId program) { return WebString(); } 135 virtual WebString getProgramInfoLog(WebGLId program) { return WebString(); }
136 virtual void getRenderbufferParameteriv(WGC3Denum target, WGC3Denum pname, W GC3Dint* value) { } 136 virtual void getRenderbufferParameteriv(WGC3Denum target, WGC3Denum pname, W GC3Dint* value) { }
137 137
138 virtual void getShaderiv(WebGLId shader, WGC3Denum pname, WGC3Dint* value) 138 virtual void getShaderiv(WebGLId shader, WGC3Denum pname, WGC3Dint* value)
139 { 139 {
140 if (pname == cc::GraphicsContext3D::COMPILE_STATUS) 140 if (pname == GL_COMPILE_STATUS)
141 *value = 1; 141 *value = 1;
142 } 142 }
143 143
144 virtual WebString getShaderInfoLog(WebGLId shader) { return WebString(); } 144 virtual WebString getShaderInfoLog(WebGLId shader) { return WebString(); }
145 virtual void getShaderPrecisionFormat(WGC3Denum shadertype, WGC3Denum precis iontype, WGC3Dint* range, WGC3Dint* precision) { } 145 virtual void getShaderPrecisionFormat(WGC3Denum shadertype, WGC3Denum precis iontype, WGC3Dint* range, WGC3Dint* precision) { }
146 virtual WebString getShaderSource(WebGLId shader) { return WebString(); } 146 virtual WebString getShaderSource(WebGLId shader) { return WebString(); }
147 virtual WebString getString(WGC3Denum name) { return WebString(); } 147 virtual WebString getString(WGC3Denum name) { return WebString(); }
148 virtual void getTexParameterfv(WGC3Denum target, WGC3Denum pname, WGC3Dfloat * value) { } 148 virtual void getTexParameterfv(WGC3Denum target, WGC3Denum pname, WGC3Dfloat * value) { }
149 virtual void getTexParameteriv(WGC3Denum target, WGC3Denum pname, WGC3Dint* value) { } 149 virtual void getTexParameteriv(WGC3Denum target, WGC3Denum pname, WGC3Dint* value) { }
150 virtual void getUniformfv(WebGLId program, WGC3Dint location, WGC3Dfloat* va lue) { } 150 virtual void getUniformfv(WebGLId program, WGC3Dint location, WGC3Dfloat* va lue) { }
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 virtual void deleteProgram(WebGLId) { } 237 virtual void deleteProgram(WebGLId) { }
238 virtual void deleteRenderbuffer(WebGLId) { } 238 virtual void deleteRenderbuffer(WebGLId) { }
239 virtual void deleteShader(WebGLId) { } 239 virtual void deleteShader(WebGLId) { }
240 virtual void deleteTexture(WebGLId) { } 240 virtual void deleteTexture(WebGLId) { }
241 241
242 virtual void texStorage2DEXT(WGC3Denum target, WGC3Dint levels, WGC3Duint in ternalformat, 242 virtual void texStorage2DEXT(WGC3Denum target, WGC3Dint levels, WGC3Duint in ternalformat,
243 WGC3Dint width, WGC3Dint height) { } 243 WGC3Dint width, WGC3Dint height) { }
244 244
245 virtual WebGLId createQueryEXT() { return 1; } 245 virtual WebGLId createQueryEXT() { return 1; }
246 virtual void deleteQueryEXT(WebGLId) { } 246 virtual void deleteQueryEXT(WebGLId) { }
247 virtual GC3Dboolean isQueryEXT(WebGLId) { return true; } 247 virtual WGC3Dboolean isQueryEXT(WebGLId) { return true; }
248 virtual void beginQueryEXT(GC3Denum, WebGLId) { } 248 virtual void beginQueryEXT(WGC3Denum, WebGLId) { }
249 virtual void endQueryEXT(GC3Denum) { } 249 virtual void endQueryEXT(WGC3Denum) { }
250 virtual void getQueryivEXT(GC3Denum, GC3Denum, GC3Dint*) { } 250 virtual void getQueryivEXT(WGC3Denum, WGC3Denum, WGC3Dint*) { }
251 virtual void getQueryObjectuivEXT(WebGLId, GC3Denum, GC3Duint*) { } 251 virtual void getQueryObjectuivEXT(WebGLId, WGC3Denum, WGC3Duint*) { }
252 252
253 protected: 253 protected:
254 unsigned m_nextTextureId; 254 unsigned m_nextTextureId;
255 Attributes m_attrs; 255 Attributes m_attrs;
256 }; 256 };
257 257
258 } // namespace WebKit 258 } // namespace WebKit
259 259
260 #endif // FakeWebGraphicsContext3D_h 260 #endif // FakeWebGraphicsContext3D_h
OLDNEW
« no previous file with comments | « cc/software_renderer_unittest.cc ('k') | cc/test/tiled_layer_test_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698