summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-11 02:26:37 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-11 02:26:37 +0000
commit0f9969980cd06a0cc87ec30e00d17d6e331324ad (patch)
tree7a68afcd82b625f3d01530b6ac8e1197b0d2753e /cc
parentd7c9dc2d8a1b1b1ada826785f8693b3b55c17e4d (diff)
downloadchromium_src-0f9969980cd06a0cc87ec30e00d17d6e331324ad.zip
chromium_src-0f9969980cd06a0cc87ec30e00d17d6e331324ad.tar.gz
chromium_src-0f9969980cd06a0cc87ec30e00d17d6e331324ad.tar.bz2
Remove unnecessary use of blink typedefs
This replaces uses of blink's WebGraphicsContext3D.h typedefs for GL numeric types with the types from the khronos headers. BUG=181120 Review URL: https://codereview.chromium.org/133023002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244312 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/output/gl_renderer_unittest.cc200
-rw-r--r--cc/test/fake_web_graphics_context_3d.cc204
-rw-r--r--cc/test/fake_web_graphics_context_3d.h845
-rw-r--r--cc/test/ordered_texture_map.cc12
-rw-r--r--cc/test/ordered_texture_map.h18
-rw-r--r--cc/test/test_texture.cc3
-rw-r--r--cc/test/test_texture.h6
-rw-r--r--cc/test/test_web_graphics_context_3d.cc226
-rw-r--r--cc/test/test_web_graphics_context_3d.h242
-rw-r--r--cc/test/test_web_graphics_context_3d_unittest.cc14
-rw-r--r--cc/trees/layer_tree_host_impl_unittest.cc50
-rw-r--r--cc/trees/layer_tree_host_unittest.cc34
12 files changed, 905 insertions, 949 deletions
diff --git a/cc/output/gl_renderer_unittest.cc b/cc/output/gl_renderer_unittest.cc
index 7c5741f..272ddbc 100644
--- a/cc/output/gl_renderer_unittest.cc
+++ b/cc/output/gl_renderer_unittest.cc
@@ -40,18 +40,7 @@ using testing::InSequence;
using testing::Mock;
using testing::Return;
using testing::StrictMock;
-using blink::WebGLId;
using blink::WebString;
-using blink::WGC3Dbitfield;
-using blink::WGC3Dboolean;
-using blink::WGC3Dchar;
-using blink::WGC3Denum;
-using blink::WGC3Dfloat;
-using blink::WGC3Dint;
-using blink::WGC3Dintptr;
-using blink::WGC3Dsizei;
-using blink::WGC3Dsizeiptr;
-using blink::WGC3Duint;
namespace cc {
@@ -408,53 +397,52 @@ class ForbidSynchronousCallContext : public TestWebGraphicsContext3D {
public:
ForbidSynchronousCallContext() {}
- virtual bool getActiveAttrib(WebGLId program,
- WGC3Duint index,
+ virtual bool getActiveAttrib(GLuint program,
+ GLuint index,
blink::WebGraphicsContext3D::ActiveInfo& info)
OVERRIDE {
ADD_FAILURE();
return false;
}
- virtual bool getActiveUniform(WebGLId program,
- WGC3Duint index,
+ virtual bool getActiveUniform(GLuint program,
+ GLuint index,
blink::WebGraphicsContext3D::ActiveInfo& info)
OVERRIDE {
ADD_FAILURE();
return false;
}
- virtual void getAttachedShaders(WebGLId program,
- WGC3Dsizei max_count,
- WGC3Dsizei* count,
- WebGLId* shaders) OVERRIDE {
+ virtual void getAttachedShaders(GLuint program,
+ GLsizei max_count,
+ GLsizei* count,
+ GLuint* shaders) OVERRIDE {
ADD_FAILURE();
}
- virtual WGC3Dint getAttribLocation(WebGLId program,
- const WGC3Dchar* name) OVERRIDE {
+ virtual GLint getAttribLocation(GLuint program, const GLchar* name) OVERRIDE {
ADD_FAILURE();
return 0;
}
- virtual void getBooleanv(WGC3Denum pname, WGC3Dboolean* value) OVERRIDE {
+ virtual void getBooleanv(GLenum pname, GLboolean* value) OVERRIDE {
ADD_FAILURE();
}
- virtual void getBufferParameteriv(WGC3Denum target,
- WGC3Denum pname,
- WGC3Dint* value) OVERRIDE {
+ virtual void getBufferParameteriv(GLenum target,
+ GLenum pname,
+ GLint* value) OVERRIDE {
ADD_FAILURE();
}
- virtual WGC3Denum getError() OVERRIDE {
+ virtual GLenum getError() OVERRIDE {
ADD_FAILURE();
- return 0;
+ return GL_NO_ERROR;
}
- virtual void getFloatv(WGC3Denum pname, WGC3Dfloat* value) OVERRIDE {
+ virtual void getFloatv(GLenum pname, GLfloat* value) OVERRIDE {
ADD_FAILURE();
}
- virtual void getFramebufferAttachmentParameteriv(WGC3Denum target,
- WGC3Denum attachment,
- WGC3Denum pname,
- WGC3Dint* value) OVERRIDE {
+ virtual void getFramebufferAttachmentParameteriv(GLenum target,
+ GLenum attachment,
+ GLenum pname,
+ GLint* value) OVERRIDE {
ADD_FAILURE();
}
- virtual void getIntegerv(WGC3Denum pname, WGC3Dint* value) OVERRIDE {
+ virtual void getIntegerv(GLenum pname, GLint* value) OVERRIDE {
if (pname == GL_MAX_TEXTURE_SIZE) {
// MAX_TEXTURE_SIZE is cached client side, so it's OK to query.
*value = 1024;
@@ -465,9 +453,9 @@ class ForbidSynchronousCallContext : public TestWebGraphicsContext3D {
// We allow querying the shader compilation and program link status in debug
// mode, but not release.
- virtual void getProgramiv(WebGLId program,
- WGC3Denum pname,
- WGC3Dint* value) OVERRIDE {
+ virtual void getProgramiv(GLuint program,
+ GLenum pname,
+ GLint* value) OVERRIDE {
#ifndef NDEBUG
*value = 1;
#else
@@ -475,9 +463,7 @@ class ForbidSynchronousCallContext : public TestWebGraphicsContext3D {
#endif
}
- virtual void getShaderiv(WebGLId shader,
- WGC3Denum pname,
- WGC3Dint* value) OVERRIDE {
+ virtual void getShaderiv(GLuint shader, GLenum pname, GLint* value) OVERRIDE {
#ifndef NDEBUG
*value = 1;
#else
@@ -485,72 +471,72 @@ class ForbidSynchronousCallContext : public TestWebGraphicsContext3D {
#endif
}
- virtual WebString getString(WGC3Denum name) OVERRIDE {
+ virtual WebString getString(GLenum name) OVERRIDE {
ADD_FAILURE() << name;
return WebString();
}
- virtual WebString getProgramInfoLog(WebGLId program) OVERRIDE {
+ virtual WebString getProgramInfoLog(GLuint program) OVERRIDE {
ADD_FAILURE();
return WebString();
}
- virtual void getRenderbufferParameteriv(WGC3Denum target,
- WGC3Denum pname,
- WGC3Dint* value) OVERRIDE {
+ virtual void getRenderbufferParameteriv(GLenum target,
+ GLenum pname,
+ GLint* value) OVERRIDE {
ADD_FAILURE();
}
- virtual WebString getShaderInfoLog(WebGLId shader) OVERRIDE {
+ virtual WebString getShaderInfoLog(GLuint shader) OVERRIDE {
ADD_FAILURE();
return WebString();
}
- virtual void getShaderPrecisionFormat(WGC3Denum shadertype,
- WGC3Denum precisiontype,
- WGC3Dint* range,
- WGC3Dint* precision) OVERRIDE {
+ virtual void getShaderPrecisionFormat(GLenum shadertype,
+ GLenum precisiontype,
+ GLint* range,
+ GLint* precision) OVERRIDE {
ADD_FAILURE();
}
- virtual WebString getShaderSource(WebGLId shader) OVERRIDE {
+ virtual WebString getShaderSource(GLuint shader) OVERRIDE {
ADD_FAILURE();
return WebString();
}
- virtual void getTexParameterfv(WGC3Denum target,
- WGC3Denum pname,
- WGC3Dfloat* value) OVERRIDE {
+ virtual void getTexParameterfv(GLenum target,
+ GLenum pname,
+ GLfloat* value) OVERRIDE {
ADD_FAILURE();
}
- virtual void getTexParameteriv(WGC3Denum target,
- WGC3Denum pname,
- WGC3Dint* value) OVERRIDE {
+ virtual void getTexParameteriv(GLenum target,
+ GLenum pname,
+ GLint* value) OVERRIDE {
ADD_FAILURE();
}
- virtual void getUniformfv(WebGLId program,
- WGC3Dint location,
- WGC3Dfloat* value) OVERRIDE {
+ virtual void getUniformfv(GLuint program,
+ GLint location,
+ GLfloat* value) OVERRIDE {
ADD_FAILURE();
}
- virtual void getUniformiv(WebGLId program,
- WGC3Dint location,
- WGC3Dint* value) OVERRIDE {
+ virtual void getUniformiv(GLuint program,
+ GLint location,
+ GLint* value) OVERRIDE {
ADD_FAILURE();
}
- virtual WGC3Dint getUniformLocation(WebGLId program,
- const WGC3Dchar* name) OVERRIDE {
+ virtual GLint getUniformLocation(GLuint program,
+ const GLchar* name) OVERRIDE {
ADD_FAILURE();
return 0;
}
- virtual void getVertexAttribfv(WGC3Duint index,
- WGC3Denum pname,
- WGC3Dfloat* value) OVERRIDE {
+ virtual void getVertexAttribfv(GLuint index,
+ GLenum pname,
+ GLfloat* value) OVERRIDE {
ADD_FAILURE();
}
- virtual void getVertexAttribiv(WGC3Duint index,
- WGC3Denum pname,
- WGC3Dint* value) OVERRIDE {
+ virtual void getVertexAttribiv(GLuint index,
+ GLenum pname,
+ GLint* value) OVERRIDE {
ADD_FAILURE();
}
- virtual WGC3Dsizeiptr getVertexAttribOffset(WGC3Duint index,
- WGC3Denum pname) OVERRIDE {
+ virtual GLsizeiptr getVertexAttribOffset(GLuint index,
+ GLenum pname) OVERRIDE {
ADD_FAILURE();
return 0;
}
@@ -576,16 +562,14 @@ class LoseContextOnFirstGetContext : public TestWebGraphicsContext3D {
public:
LoseContextOnFirstGetContext() {}
- virtual void getProgramiv(WebGLId program,
- WGC3Denum pname,
- WGC3Dint* value) OVERRIDE {
+ virtual void getProgramiv(GLuint program,
+ GLenum pname,
+ GLint* value) OVERRIDE {
context_lost_ = true;
*value = 0;
}
- virtual void getShaderiv(WebGLId shader,
- WGC3Denum pname,
- WGC3Dint* value) OVERRIDE {
+ virtual void getShaderiv(GLuint shader, GLenum pname, GLint* value) OVERRIDE {
context_lost_ = true;
*value = 0;
}
@@ -613,10 +597,10 @@ class ClearCountingContext : public TestWebGraphicsContext3D {
ClearCountingContext() { test_capabilities_.discard_framebuffer = true; }
MOCK_METHOD3(discardFramebufferEXT,
- void(WGC3Denum target,
- WGC3Dsizei numAttachments,
- const WGC3Denum* attachments));
- MOCK_METHOD1(clear, void(WGC3Dbitfield mask));
+ void(GLenum target,
+ GLsizei numAttachments,
+ const GLenum* attachments));
+ MOCK_METHOD1(clear, void(GLbitfield mask));
};
TEST_F(GLRendererTest, OpaqueBackground) {
@@ -749,18 +733,18 @@ class VisibilityChangeIsLastCallTrackingContext
VisibilityChangeIsLastCallTrackingContext()
: last_call_was_set_visibility_(false) {}
- // WebGraphicsContext3D methods.
+ // TestWebGraphicsContext3D methods.
virtual void flush() OVERRIDE { last_call_was_set_visibility_ = false; }
- virtual void deleteTexture(WebGLId) OVERRIDE {
+ virtual void deleteTexture(GLuint) OVERRIDE {
last_call_was_set_visibility_ = false;
}
- virtual void deleteFramebuffer(WebGLId) OVERRIDE {
+ virtual void deleteFramebuffer(GLuint) OVERRIDE {
last_call_was_set_visibility_ = false;
}
- virtual void deleteQueryEXT(WebGLId) OVERRIDE {
+ virtual void deleteQueryEXT(GLuint) OVERRIDE {
last_call_was_set_visibility_ = false;
}
- virtual void deleteRenderbuffer(WebGLId) OVERRIDE {
+ virtual void deleteRenderbuffer(GLuint) OVERRIDE {
last_call_was_set_visibility_ = false;
}
@@ -833,23 +817,19 @@ class TextureStateTrackingContext : public TestWebGraphicsContext3D {
test_capabilities_.egl_image_external = true;
}
- MOCK_METHOD3(texParameteri,
- void(WGC3Denum target, WGC3Denum pname, WGC3Dint param));
+ MOCK_METHOD3(texParameteri, void(GLenum target, GLenum pname, GLint param));
MOCK_METHOD4(drawElements,
- void(WGC3Denum mode,
- WGC3Dsizei count,
- WGC3Denum type,
- WGC3Dintptr offset));
+ void(GLenum mode, GLsizei count, GLenum type, GLintptr offset));
- virtual void activeTexture(WGC3Denum texture) {
+ virtual void activeTexture(GLenum texture) {
EXPECT_NE(texture, active_texture_);
active_texture_ = texture;
}
- WGC3Denum active_texture() const { return active_texture_; }
+ GLenum active_texture() const { return active_texture_; }
private:
- WGC3Denum active_texture_;
+ GLenum active_texture_;
};
TEST_F(GLRendererTest, ActiveTextureState) {
@@ -926,12 +906,9 @@ TEST_F(GLRendererTest, ActiveTextureState) {
class NoClearRootRenderPassMockContext : public TestWebGraphicsContext3D {
public:
- MOCK_METHOD1(clear, void(WGC3Dbitfield mask));
+ MOCK_METHOD1(clear, void(GLbitfield mask));
MOCK_METHOD4(drawElements,
- void(WGC3Denum mode,
- WGC3Dsizei count,
- WGC3Denum type,
- WGC3Dintptr offset));
+ void(GLenum mode, GLsizei count, GLenum type, GLintptr offset));
};
TEST_F(GLRendererTest, ShouldClearRootRenderPass) {
@@ -1011,14 +988,14 @@ class ScissorTestOnClearCheckingContext : public TestWebGraphicsContext3D {
public:
ScissorTestOnClearCheckingContext() : scissor_enabled_(false) {}
- virtual void clear(WGC3Dbitfield) OVERRIDE { EXPECT_FALSE(scissor_enabled_); }
+ virtual void clear(GLbitfield) OVERRIDE { EXPECT_FALSE(scissor_enabled_); }
- virtual void enable(WGC3Denum cap) OVERRIDE {
+ virtual void enable(GLenum cap) OVERRIDE {
if (cap == GL_SCISSOR_TEST)
scissor_enabled_ = true;
}
- virtual void disable(WGC3Denum cap) OVERRIDE {
+ virtual void disable(GLenum cap) OVERRIDE {
if (cap == GL_SCISSOR_TEST)
scissor_enabled_ = false;
}
@@ -1093,9 +1070,9 @@ class DiscardCheckingContext : public TestWebGraphicsContext3D {
set_have_discard_framebuffer(true);
}
- virtual void discardFramebufferEXT(WGC3Denum target,
- WGC3Dsizei numAttachments,
- const WGC3Denum* attachments) OVERRIDE {
+ virtual void discardFramebufferEXT(GLenum target,
+ GLsizei numAttachments,
+ const GLenum* attachments) OVERRIDE {
++discarded_;
}
@@ -1708,16 +1685,13 @@ class OutputSurfaceMockContext : public TestWebGraphicsContext3D {
// Specifically override methods even if they are unused (used in conjunction
// with StrictMock). We need to make sure that GLRenderer does not issue
- // framebuffer-related GL calls directly. Instead these are supposed to go
+ // framebuffer-related GLuint calls directly. Instead these are supposed to go
// through the OutputSurface abstraction.
- MOCK_METHOD2(bindFramebuffer, void(WGC3Denum target, WebGLId framebuffer));
+ MOCK_METHOD2(bindFramebuffer, void(GLenum target, GLuint framebuffer));
MOCK_METHOD3(reshapeWithScaleFactor,
void(int width, int height, float scale_factor));
MOCK_METHOD4(drawElements,
- void(WGC3Denum mode,
- WGC3Dsizei count,
- WGC3Denum type,
- WGC3Dintptr offset));
+ void(GLenum mode, GLsizei count, GLenum type, GLintptr offset));
};
class MockOutputSurface : public OutputSurface {
diff --git a/cc/test/fake_web_graphics_context_3d.cc b/cc/test/fake_web_graphics_context_3d.cc
index 34e5b9e..02baf46 100644
--- a/cc/test/fake_web_graphics_context_3d.cc
+++ b/cc/test/fake_web_graphics_context_3d.cc
@@ -7,10 +7,6 @@
#include "base/logging.h"
#include "third_party/khronos/GLES2/gl2.h"
-using blink::WGC3Dboolean;
-using blink::WGC3Denum;
-using blink::WGC3Dsizei;
-using blink::WebGLId;
using blink::WebGraphicsContext3D;
namespace cc {
@@ -27,7 +23,7 @@ bool FakeWebGraphicsContext3D::isGLES2Compliant() {
return false;
}
-WebGLId FakeWebGraphicsContext3D::getPlatformTextureId() {
+GLuint FakeWebGraphicsContext3D::getPlatformTextureId() {
return 0;
}
@@ -36,23 +32,23 @@ bool FakeWebGraphicsContext3D::isContextLost() {
}
void* FakeWebGraphicsContext3D::mapBufferSubDataCHROMIUM(
- WGC3Denum target,
- blink::WGC3Dintptr offset,
- blink::WGC3Dsizeiptr size,
- WGC3Denum access) {
+ GLenum target,
+ GLintptr offset,
+ GLsizeiptr size,
+ GLenum access) {
return 0;
}
void* FakeWebGraphicsContext3D::mapTexSubImage2DCHROMIUM(
- WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Dint xoffset,
- blink::WGC3Dint yoffset,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- WGC3Denum format,
- WGC3Denum type,
- WGC3Denum access) {
+ GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ GLenum access) {
return 0;
}
@@ -60,38 +56,38 @@ blink::WebString FakeWebGraphicsContext3D::getRequestableExtensionsCHROMIUM() {
return blink::WebString();
}
-WGC3Denum FakeWebGraphicsContext3D::checkFramebufferStatus(
- WGC3Denum target) {
+GLenum FakeWebGraphicsContext3D::checkFramebufferStatus(
+ GLenum target) {
return GL_FRAMEBUFFER_COMPLETE;
}
bool FakeWebGraphicsContext3D::getActiveAttrib(
- WebGLId program,
- blink::WGC3Duint index,
+ GLuint program,
+ GLuint index,
WebGraphicsContext3D::ActiveInfo&) {
return false;
}
bool FakeWebGraphicsContext3D::getActiveUniform(
- WebGLId program,
- blink::WGC3Duint index,
+ GLuint program,
+ GLuint index,
WebGraphicsContext3D::ActiveInfo&) {
return false;
}
-blink::WGC3Dint FakeWebGraphicsContext3D::getAttribLocation(
- WebGLId program,
- const blink::WGC3Dchar* name) {
+GLint FakeWebGraphicsContext3D::getAttribLocation(
+ GLuint program,
+ const GLchar* name) {
return 0;
}
-WGC3Denum FakeWebGraphicsContext3D::getError() {
- return 0;
+GLenum FakeWebGraphicsContext3D::getError() {
+ return GL_NO_ERROR;
}
void FakeWebGraphicsContext3D::getIntegerv(
- WGC3Denum pname,
- blink::WGC3Dint* value) {
+ GLenum pname,
+ GLint* value) {
if (pname == GL_MAX_TEXTURE_SIZE)
*value = 1024;
else if (pname == GL_ACTIVE_TEXTURE)
@@ -99,36 +95,36 @@ void FakeWebGraphicsContext3D::getIntegerv(
}
void FakeWebGraphicsContext3D::getProgramiv(
- WebGLId program,
- WGC3Denum pname,
- blink::WGC3Dint* value) {
+ GLuint program,
+ GLenum pname,
+ GLint* value) {
if (pname == GL_LINK_STATUS)
*value = 1;
}
blink::WebString FakeWebGraphicsContext3D::getProgramInfoLog(
- WebGLId program) {
+ GLuint program) {
return blink::WebString();
}
void FakeWebGraphicsContext3D::getShaderiv(
- WebGLId shader,
- WGC3Denum pname,
- blink::WGC3Dint* value) {
+ GLuint shader,
+ GLenum pname,
+ GLint* value) {
if (pname == GL_COMPILE_STATUS)
*value = 1;
}
blink::WebString FakeWebGraphicsContext3D::getShaderInfoLog(
- WebGLId shader) {
+ GLuint shader) {
return blink::WebString();
}
void FakeWebGraphicsContext3D::getShaderPrecisionFormat(
- blink::WGC3Denum shadertype,
- blink::WGC3Denum precisiontype,
- blink::WGC3Dint* range,
- blink::WGC3Dint* precision) {
+ GLenum shadertype,
+ GLenum precisiontype,
+ GLint* range,
+ GLint* precision) {
// Return the minimum precision requirements of the GLES specificatin.
switch (precisiontype) {
case GL_LOW_INT:
@@ -168,193 +164,193 @@ void FakeWebGraphicsContext3D::getShaderPrecisionFormat(
}
blink::WebString FakeWebGraphicsContext3D::getShaderSource(
- WebGLId shader) {
+ GLuint shader) {
return blink::WebString();
}
-blink::WebString FakeWebGraphicsContext3D::getString(WGC3Denum name) {
+blink::WebString FakeWebGraphicsContext3D::getString(GLenum name) {
return blink::WebString();
}
-blink::WGC3Dint FakeWebGraphicsContext3D::getUniformLocation(
- WebGLId program,
- const blink::WGC3Dchar* name) {
+GLint FakeWebGraphicsContext3D::getUniformLocation(
+ GLuint program,
+ const GLchar* name) {
return 0;
}
-blink::WGC3Dsizeiptr FakeWebGraphicsContext3D::getVertexAttribOffset(
- blink::WGC3Duint index,
- WGC3Denum pname) {
+GLsizeiptr FakeWebGraphicsContext3D::getVertexAttribOffset(
+ GLuint index,
+ GLenum pname) {
return 0;
}
-WGC3Dboolean FakeWebGraphicsContext3D::isBuffer(
- WebGLId buffer) {
+GLboolean FakeWebGraphicsContext3D::isBuffer(
+ GLuint buffer) {
return false;
}
-WGC3Dboolean FakeWebGraphicsContext3D::isEnabled(
- WGC3Denum cap) {
+GLboolean FakeWebGraphicsContext3D::isEnabled(
+ GLenum cap) {
return false;
}
-WGC3Dboolean FakeWebGraphicsContext3D::isFramebuffer(
- WebGLId framebuffer) {
+GLboolean FakeWebGraphicsContext3D::isFramebuffer(
+ GLuint framebuffer) {
return false;
}
-WGC3Dboolean FakeWebGraphicsContext3D::isProgram(
- WebGLId program) {
+GLboolean FakeWebGraphicsContext3D::isProgram(
+ GLuint program) {
return false;
}
-WGC3Dboolean FakeWebGraphicsContext3D::isRenderbuffer(
- WebGLId renderbuffer) {
+GLboolean FakeWebGraphicsContext3D::isRenderbuffer(
+ GLuint renderbuffer) {
return false;
}
-WGC3Dboolean FakeWebGraphicsContext3D::isShader(
- WebGLId shader) {
+GLboolean FakeWebGraphicsContext3D::isShader(
+ GLuint shader) {
return false;
}
-WGC3Dboolean FakeWebGraphicsContext3D::isTexture(
- WebGLId texture) {
+GLboolean FakeWebGraphicsContext3D::isTexture(
+ GLuint texture) {
return false;
}
-void FakeWebGraphicsContext3D::genBuffers(WGC3Dsizei count, WebGLId* ids) {
+void FakeWebGraphicsContext3D::genBuffers(GLsizei count, GLuint* ids) {
for (int i = 0; i < count; ++i)
ids[i] = 1;
}
void FakeWebGraphicsContext3D::genFramebuffers(
- WGC3Dsizei count, WebGLId* ids) {
+ GLsizei count, GLuint* ids) {
for (int i = 0; i < count; ++i)
ids[i] = 1;
}
void FakeWebGraphicsContext3D::genRenderbuffers(
- WGC3Dsizei count, WebGLId* ids) {
+ GLsizei count, GLuint* ids) {
for (int i = 0; i < count; ++i)
ids[i] = 1;
}
-void FakeWebGraphicsContext3D::genTextures(WGC3Dsizei count, WebGLId* ids) {
+void FakeWebGraphicsContext3D::genTextures(GLsizei count, GLuint* ids) {
for (int i = 0; i < count; ++i)
ids[i] = 1;
}
-void FakeWebGraphicsContext3D::deleteBuffers(WGC3Dsizei count, WebGLId* ids) {
+void FakeWebGraphicsContext3D::deleteBuffers(GLsizei count, GLuint* ids) {
}
void FakeWebGraphicsContext3D::deleteFramebuffers(
- WGC3Dsizei count, WebGLId* ids) {
+ GLsizei count, GLuint* ids) {
}
void FakeWebGraphicsContext3D::deleteRenderbuffers(
- WGC3Dsizei count, WebGLId* ids) {
+ GLsizei count, GLuint* ids) {
}
-void FakeWebGraphicsContext3D::deleteTextures(WGC3Dsizei count, WebGLId* ids) {
+void FakeWebGraphicsContext3D::deleteTextures(GLsizei count, GLuint* ids) {
}
-WebGLId FakeWebGraphicsContext3D::createBuffer() {
+GLuint FakeWebGraphicsContext3D::createBuffer() {
return 1;
}
-WebGLId FakeWebGraphicsContext3D::createFramebuffer() {
+GLuint FakeWebGraphicsContext3D::createFramebuffer() {
return 1;
}
-WebGLId FakeWebGraphicsContext3D::createRenderbuffer() {
+GLuint FakeWebGraphicsContext3D::createRenderbuffer() {
return 1;
}
-WebGLId FakeWebGraphicsContext3D::createTexture() {
+GLuint FakeWebGraphicsContext3D::createTexture() {
return 1;
}
-void FakeWebGraphicsContext3D::deleteBuffer(blink::WebGLId id) {
+void FakeWebGraphicsContext3D::deleteBuffer(GLuint id) {
}
-void FakeWebGraphicsContext3D::deleteFramebuffer(blink::WebGLId id) {
+void FakeWebGraphicsContext3D::deleteFramebuffer(GLuint id) {
}
-void FakeWebGraphicsContext3D::deleteRenderbuffer(blink::WebGLId id) {
+void FakeWebGraphicsContext3D::deleteRenderbuffer(GLuint id) {
}
-void FakeWebGraphicsContext3D::deleteTexture(WebGLId texture_id) {
+void FakeWebGraphicsContext3D::deleteTexture(GLuint texture_id) {
}
-WebGLId FakeWebGraphicsContext3D::createProgram() {
+GLuint FakeWebGraphicsContext3D::createProgram() {
return 1;
}
-WebGLId FakeWebGraphicsContext3D::createShader(WGC3Denum) {
+GLuint FakeWebGraphicsContext3D::createShader(GLenum) {
return 1;
}
-void FakeWebGraphicsContext3D::deleteProgram(blink::WebGLId id) {
+void FakeWebGraphicsContext3D::deleteProgram(GLuint id) {
}
-void FakeWebGraphicsContext3D::deleteShader(blink::WebGLId id) {
+void FakeWebGraphicsContext3D::deleteShader(GLuint id) {
}
-void FakeWebGraphicsContext3D::attachShader(WebGLId program, WebGLId shader) {
+void FakeWebGraphicsContext3D::attachShader(GLuint program, GLuint shader) {
}
-void FakeWebGraphicsContext3D::useProgram(WebGLId program) {
+void FakeWebGraphicsContext3D::useProgram(GLuint program) {
}
-void FakeWebGraphicsContext3D::bindBuffer(WGC3Denum target, WebGLId buffer) {
+void FakeWebGraphicsContext3D::bindBuffer(GLenum target, GLuint buffer) {
}
void FakeWebGraphicsContext3D::bindFramebuffer(
- WGC3Denum target, WebGLId framebuffer) {
+ GLenum target, GLuint framebuffer) {
}
void FakeWebGraphicsContext3D::bindRenderbuffer(
- WGC3Denum target, WebGLId renderbuffer) {
+ GLenum target, GLuint renderbuffer) {
}
void FakeWebGraphicsContext3D::bindTexture(
- WGC3Denum target, WebGLId texture_id) {
+ GLenum target, GLuint texture_id) {
}
-WebGLId FakeWebGraphicsContext3D::createQueryEXT() {
+GLuint FakeWebGraphicsContext3D::createQueryEXT() {
return 1;
}
-WGC3Dboolean FakeWebGraphicsContext3D::isQueryEXT(WebGLId query) {
+GLboolean FakeWebGraphicsContext3D::isQueryEXT(GLuint query) {
return true;
}
-void FakeWebGraphicsContext3D::endQueryEXT(blink::WGC3Denum target) {
+void FakeWebGraphicsContext3D::endQueryEXT(GLenum target) {
}
void FakeWebGraphicsContext3D::getQueryObjectuivEXT(
- blink::WebGLId query,
- blink::WGC3Denum pname,
- blink::WGC3Duint* params) {
+ GLuint query,
+ GLenum pname,
+ GLuint* params) {
}
void FakeWebGraphicsContext3D::setContextLostCallback(
WebGraphicsContext3D::WebGraphicsContextLostCallback* callback) {
}
-void FakeWebGraphicsContext3D::loseContextCHROMIUM(WGC3Denum current,
- WGC3Denum other) {
+void FakeWebGraphicsContext3D::loseContextCHROMIUM(GLenum current,
+ GLenum other) {
}
-blink::WGC3Duint FakeWebGraphicsContext3D::createImageCHROMIUM(
- blink::WGC3Dsizei width, blink::WGC3Dsizei height,
- blink::WGC3Denum internalformat) {
+GLuint FakeWebGraphicsContext3D::createImageCHROMIUM(
+ GLsizei width, GLsizei height,
+ GLenum internalformat) {
return 0;
}
-void* FakeWebGraphicsContext3D::mapImageCHROMIUM(blink::WGC3Duint image_id,
- blink::WGC3Denum access) {
+void* FakeWebGraphicsContext3D::mapImageCHROMIUM(GLuint image_id,
+ GLenum access) {
return 0;
}
diff --git a/cc/test/fake_web_graphics_context_3d.h b/cc/test/fake_web_graphics_context_3d.h
index 583ba2d..286476c 100644
--- a/cc/test/fake_web_graphics_context_3d.h
+++ b/cc/test/fake_web_graphics_context_3d.h
@@ -8,6 +8,7 @@
#include <string>
#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
+#include "third_party/khronos/GLES2/gl2.h"
namespace cc {
@@ -22,587 +23,587 @@ class FakeWebGraphicsContext3D {
virtual bool isGLES2Compliant();
- virtual blink::WebGLId getPlatformTextureId();
+ virtual GLuint getPlatformTextureId();
virtual void prepareTexture() {}
virtual void postSubBufferCHROMIUM(int x, int y, int width, int height) {}
- virtual void synthesizeGLError(blink::WGC3Denum) {}
+ virtual void synthesizeGLError(GLenum) {}
virtual bool isContextLost();
virtual void* mapBufferSubDataCHROMIUM(
- blink::WGC3Denum target,
- blink::WGC3Dintptr offset,
- blink::WGC3Dsizeiptr size,
- blink::WGC3Denum access);
+ GLenum target,
+ GLintptr offset,
+ GLsizeiptr size,
+ GLenum access);
virtual void unmapBufferSubDataCHROMIUM(const void*) {}
virtual void* mapTexSubImage2DCHROMIUM(
- blink::WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Dint xoffset,
- blink::WGC3Dint yoffset,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Denum format,
- blink::WGC3Denum type,
- blink::WGC3Denum access);
+ GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ GLenum access);
virtual void unmapTexSubImage2DCHROMIUM(const void*) {}
virtual void setVisibilityCHROMIUM(bool visible) {}
virtual void discardFramebufferEXT(
- blink::WGC3Denum target,
- blink::WGC3Dsizei num_attachments,
- const blink::WGC3Denum* attachments) {}
+ GLenum target,
+ GLsizei num_attachments,
+ const GLenum* attachments) {}
virtual blink::WebString getRequestableExtensionsCHROMIUM();
virtual void requestExtensionCHROMIUM(const char*) {}
virtual void blitFramebufferCHROMIUM(
- blink::WGC3Dint src_x0,
- blink::WGC3Dint src_y0,
- blink::WGC3Dint src_x1,
- blink::WGC3Dint src_y1,
- blink::WGC3Dint dst_x0,
- blink::WGC3Dint dst_y0,
- blink::WGC3Dint dst_x1,
- blink::WGC3Dint dst_y1,
- blink::WGC3Dbitfield mask,
- blink::WGC3Denum filter) {}
+ GLint src_x0,
+ GLint src_y0,
+ GLint src_x1,
+ GLint src_y1,
+ GLint dst_x0,
+ GLint dst_y0,
+ GLint dst_x1,
+ GLint dst_y1,
+ GLbitfield mask,
+ GLenum filter) {}
virtual void renderbufferStorageMultisampleCHROMIUM(
- blink::WGC3Denum target,
- blink::WGC3Dsizei samples,
- blink::WGC3Denum internalformat,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height) {}
-
- virtual void activeTexture(blink::WGC3Denum texture) {}
- virtual void attachShader(blink::WebGLId program, blink::WebGLId shader);
+ GLenum target,
+ GLsizei samples,
+ GLenum internalformat,
+ GLsizei width,
+ GLsizei height) {}
+
+ virtual void activeTexture(GLenum texture) {}
+ virtual void attachShader(GLuint program, GLuint shader);
virtual void bindAttribLocation(
- blink::WebGLId program,
- blink::WGC3Duint index,
- const blink::WGC3Dchar* name) {}
- virtual void bindBuffer(blink::WGC3Denum target, blink::WebGLId buffer);
+ GLuint program,
+ GLuint index,
+ const GLchar* name) {}
+ virtual void bindBuffer(GLenum target, GLuint buffer);
virtual void bindFramebuffer(
- blink::WGC3Denum target, blink::WebGLId framebuffer);
+ GLenum target, GLuint framebuffer);
virtual void bindRenderbuffer(
- blink::WGC3Denum target, blink::WebGLId renderbuffer);
+ GLenum target, GLuint renderbuffer);
virtual void bindTexture(
- blink::WGC3Denum target,
- blink::WebGLId texture_id);
+ GLenum target,
+ GLuint texture_id);
virtual void blendColor(
- blink::WGC3Dclampf red,
- blink::WGC3Dclampf green,
- blink::WGC3Dclampf blue,
- blink::WGC3Dclampf alpha) {}
- virtual void blendEquation(blink::WGC3Denum mode) {}
+ GLclampf red,
+ GLclampf green,
+ GLclampf blue,
+ GLclampf alpha) {}
+ virtual void blendEquation(GLenum mode) {}
virtual void blendEquationSeparate(
- blink::WGC3Denum mode_rgb,
- blink::WGC3Denum mode_alpha) {}
+ GLenum mode_rgb,
+ GLenum mode_alpha) {}
virtual void blendFunc(
- blink::WGC3Denum sfactor,
- blink::WGC3Denum dfactor) {}
+ GLenum sfactor,
+ GLenum dfactor) {}
virtual void blendFuncSeparate(
- blink::WGC3Denum src_rgb,
- blink::WGC3Denum dst_rgb,
- blink::WGC3Denum src_alpha,
- blink::WGC3Denum dst_alpha) {}
+ GLenum src_rgb,
+ GLenum dst_rgb,
+ GLenum src_alpha,
+ GLenum dst_alpha) {}
virtual void bufferData(
- blink::WGC3Denum target,
- blink::WGC3Dsizeiptr size,
+ GLenum target,
+ GLsizeiptr size,
const void* data,
- blink::WGC3Denum usage) {}
+ GLenum usage) {}
virtual void bufferSubData(
- blink::WGC3Denum target,
- blink::WGC3Dintptr offset,
- blink::WGC3Dsizeiptr size,
+ GLenum target,
+ GLintptr offset,
+ GLsizeiptr size,
const void* data) {}
- virtual blink::WGC3Denum checkFramebufferStatus(blink::WGC3Denum target);
+ virtual GLenum checkFramebufferStatus(GLenum target);
- virtual void clear(blink::WGC3Dbitfield mask) {}
+ virtual void clear(GLbitfield mask) {}
virtual void clearColor(
- blink::WGC3Dclampf red,
- blink::WGC3Dclampf green,
- blink::WGC3Dclampf blue,
- blink::WGC3Dclampf alpha) {}
- virtual void clearDepth(blink::WGC3Dclampf depth) {}
- virtual void clearStencil(blink::WGC3Dint s) {}
+ GLclampf red,
+ GLclampf green,
+ GLclampf blue,
+ GLclampf alpha) {}
+ virtual void clearDepth(GLclampf depth) {}
+ virtual void clearStencil(GLint s) {}
virtual void colorMask(
- blink::WGC3Dboolean red,
- blink::WGC3Dboolean green,
- blink::WGC3Dboolean blue,
- blink::WGC3Dboolean alpha) {}
- virtual void compileShader(blink::WebGLId shader) {}
+ GLboolean red,
+ GLboolean green,
+ GLboolean blue,
+ GLboolean alpha) {}
+ virtual void compileShader(GLuint shader) {}
virtual void compressedTexImage2D(
- blink::WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Denum internal_format,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Dint border,
- blink::WGC3Dsizei image_size,
+ GLenum target,
+ GLint level,
+ GLenum internal_format,
+ GLsizei width,
+ GLsizei height,
+ GLint border,
+ GLsizei image_size,
const void* data) {}
virtual void compressedTexSubImage2D(
- blink::WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Dint xoffset,
- blink::WGC3Dint yoffset,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Denum format,
- blink::WGC3Dsizei image_size,
+ GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLsizei image_size,
const void* data) {}
virtual void copyTexImage2D(
- blink::WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Denum internalformat,
- blink::WGC3Dint x,
- blink::WGC3Dint y,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Dint border) {}
+ GLenum target,
+ GLint level,
+ GLenum internalformat,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height,
+ GLint border) {}
virtual void copyTexSubImage2D(
- blink::WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Dint xoffset,
- blink::WGC3Dint yoffset,
- blink::WGC3Dint x,
- blink::WGC3Dint y,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height) {}
- virtual void cullFace(blink::WGC3Denum mode) {}
- virtual void depthFunc(blink::WGC3Denum func) {}
- virtual void depthMask(blink::WGC3Dboolean flag) {}
+ GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) {}
+ virtual void cullFace(GLenum mode) {}
+ virtual void depthFunc(GLenum func) {}
+ virtual void depthMask(GLboolean flag) {}
virtual void depthRange(
- blink::WGC3Dclampf z_near,
- blink::WGC3Dclampf z_far) {}
- virtual void detachShader(blink::WebGLId program, blink::WebGLId shader) {}
- virtual void disable(blink::WGC3Denum cap) {}
- virtual void disableVertexAttribArray(blink::WGC3Duint index) {}
+ GLclampf z_near,
+ GLclampf z_far) {}
+ virtual void detachShader(GLuint program, GLuint shader) {}
+ virtual void disable(GLenum cap) {}
+ virtual void disableVertexAttribArray(GLuint index) {}
virtual void drawArrays(
- blink::WGC3Denum mode,
- blink::WGC3Dint first,
- blink::WGC3Dsizei count) {}
+ GLenum mode,
+ GLint first,
+ GLsizei count) {}
virtual void drawElements(
- blink::WGC3Denum mode,
- blink::WGC3Dsizei count,
- blink::WGC3Denum type,
- blink::WGC3Dintptr offset) {}
+ GLenum mode,
+ GLsizei count,
+ GLenum type,
+ GLintptr offset) {}
- virtual void enable(blink::WGC3Denum cap) {}
- virtual void enableVertexAttribArray(blink::WGC3Duint index) {}
+ virtual void enable(GLenum cap) {}
+ virtual void enableVertexAttribArray(GLuint index) {}
virtual void finish() {}
virtual void flush() {}
virtual void shallowFlushCHROMIUM() {}
virtual void framebufferRenderbuffer(
- blink::WGC3Denum target,
- blink::WGC3Denum attachment,
- blink::WGC3Denum renderbuffertarget,
- blink::WebGLId renderbuffer) {}
+ GLenum target,
+ GLenum attachment,
+ GLenum renderbuffertarget,
+ GLuint renderbuffer) {}
virtual void framebufferTexture2D(
- blink::WGC3Denum target,
- blink::WGC3Denum attachment,
- blink::WGC3Denum textarget,
- blink::WebGLId texture,
- blink::WGC3Dint level) {}
- virtual void frontFace(blink::WGC3Denum mode) {}
- virtual void generateMipmap(blink::WGC3Denum target) {}
+ GLenum target,
+ GLenum attachment,
+ GLenum textarget,
+ GLuint texture,
+ GLint level) {}
+ virtual void frontFace(GLenum mode) {}
+ virtual void generateMipmap(GLenum target) {}
virtual bool getActiveAttrib(
- blink::WebGLId program,
- blink::WGC3Duint index, blink::WebGraphicsContext3D::ActiveInfo&);
+ GLuint program,
+ GLuint index, blink::WebGraphicsContext3D::ActiveInfo&);
virtual bool getActiveUniform(
- blink::WebGLId program,
- blink::WGC3Duint index,
+ GLuint program,
+ GLuint index,
blink::WebGraphicsContext3D::ActiveInfo&);
virtual void getAttachedShaders(
- blink::WebGLId program,
- blink::WGC3Dsizei max_count,
- blink::WGC3Dsizei* count,
- blink::WebGLId* shaders) {}
- virtual blink::WGC3Dint getAttribLocation(
- blink::WebGLId program,
- const blink::WGC3Dchar* name);
+ GLuint program,
+ GLsizei max_count,
+ GLsizei* count,
+ GLuint* shaders) {}
+ virtual GLint getAttribLocation(
+ GLuint program,
+ const GLchar* name);
virtual void getBooleanv(
- blink::WGC3Denum pname,
- blink::WGC3Dboolean* value) {}
+ GLenum pname,
+ GLboolean* value) {}
virtual void getBufferParameteriv(
- blink::WGC3Denum target,
- blink::WGC3Denum pname,
- blink::WGC3Dint* value) {}
- virtual blink::WGC3Denum getError();
+ GLenum target,
+ GLenum pname,
+ GLint* value) {}
+ virtual GLenum getError();
virtual void getFloatv(
- blink::WGC3Denum pname,
- blink::WGC3Dfloat* value) {}
+ GLenum pname,
+ GLfloat* value) {}
virtual void getFramebufferAttachmentParameteriv(
- blink::WGC3Denum target,
- blink::WGC3Denum attachment,
- blink::WGC3Denum pname,
- blink::WGC3Dint* value) {}
+ GLenum target,
+ GLenum attachment,
+ GLenum pname,
+ GLint* value) {}
virtual void getIntegerv(
- blink::WGC3Denum pname,
- blink::WGC3Dint* value);
+ GLenum pname,
+ GLint* value);
virtual void getProgramiv(
- blink::WebGLId program,
- blink::WGC3Denum pname,
- blink::WGC3Dint* value);
+ GLuint program,
+ GLenum pname,
+ GLint* value);
- virtual blink::WebString getProgramInfoLog(blink::WebGLId program);
+ virtual blink::WebString getProgramInfoLog(GLuint program);
virtual void getRenderbufferParameteriv(
- blink::WGC3Denum target,
- blink::WGC3Denum pname,
- blink::WGC3Dint* value) {}
+ GLenum target,
+ GLenum pname,
+ GLint* value) {}
virtual void getShaderiv(
- blink::WebGLId shader,
- blink::WGC3Denum pname,
- blink::WGC3Dint* value);
+ GLuint shader,
+ GLenum pname,
+ GLint* value);
- virtual blink::WebString getShaderInfoLog(blink::WebGLId shader);
+ virtual blink::WebString getShaderInfoLog(GLuint shader);
virtual void getShaderPrecisionFormat(
- blink::WGC3Denum shadertype,
- blink::WGC3Denum precisiontype,
- blink::WGC3Dint* range,
- blink::WGC3Dint* precision);
- virtual blink::WebString getShaderSource(blink::WebGLId shader);
- virtual blink::WebString getString(blink::WGC3Denum name);
+ GLenum shadertype,
+ GLenum precisiontype,
+ GLint* range,
+ GLint* precision);
+ virtual blink::WebString getShaderSource(GLuint shader);
+ virtual blink::WebString getString(GLenum name);
virtual void getTexParameterfv(
- blink::WGC3Denum target,
- blink::WGC3Denum pname,
- blink::WGC3Dfloat* value) {}
+ GLenum target,
+ GLenum pname,
+ GLfloat* value) {}
virtual void getTexParameteriv(
- blink::WGC3Denum target,
- blink::WGC3Denum pname,
- blink::WGC3Dint* value) {}
+ GLenum target,
+ GLenum pname,
+ GLint* value) {}
virtual void getUniformfv(
- blink::WebGLId program,
- blink::WGC3Dint location,
- blink::WGC3Dfloat* value) {}
+ GLuint program,
+ GLint location,
+ GLfloat* value) {}
virtual void getUniformiv(
- blink::WebGLId program,
- blink::WGC3Dint location,
- blink::WGC3Dint* value) {}
- virtual blink::WGC3Dint getUniformLocation(
- blink::WebGLId program,
- const blink::WGC3Dchar* name);
+ GLuint program,
+ GLint location,
+ GLint* value) {}
+ virtual GLint getUniformLocation(
+ GLuint program,
+ const GLchar* name);
virtual void getVertexAttribfv(
- blink::WGC3Duint index,
- blink::WGC3Denum pname,
- blink::WGC3Dfloat* value) {}
+ GLuint index,
+ GLenum pname,
+ GLfloat* value) {}
virtual void getVertexAttribiv(
- blink::WGC3Duint index,
- blink::WGC3Denum pname,
- blink::WGC3Dint* value) {}
- virtual blink::WGC3Dsizeiptr getVertexAttribOffset(
- blink::WGC3Duint index,
- blink::WGC3Denum pname);
-
- virtual void hint(blink::WGC3Denum target, blink::WGC3Denum mode) {}
- virtual blink::WGC3Dboolean isBuffer(blink::WebGLId buffer);
- virtual blink::WGC3Dboolean isEnabled(blink::WGC3Denum cap);
- virtual blink::WGC3Dboolean isFramebuffer(blink::WebGLId framebuffer);
- virtual blink::WGC3Dboolean isProgram(blink::WebGLId program);
- virtual blink::WGC3Dboolean isRenderbuffer(blink::WebGLId renderbuffer);
- virtual blink::WGC3Dboolean isShader(blink::WebGLId shader);
- virtual blink::WGC3Dboolean isTexture(blink::WebGLId texture);
- virtual void lineWidth(blink::WGC3Dfloat) {}
- virtual void linkProgram(blink::WebGLId program) {}
- virtual void pixelStorei(blink::WGC3Denum pname, blink::WGC3Dint param) {}
+ GLuint index,
+ GLenum pname,
+ GLint* value) {}
+ virtual GLsizeiptr getVertexAttribOffset(
+ GLuint index,
+ GLenum pname);
+
+ virtual void hint(GLenum target, GLenum mode) {}
+ virtual GLboolean isBuffer(GLuint buffer);
+ virtual GLboolean isEnabled(GLenum cap);
+ virtual GLboolean isFramebuffer(GLuint framebuffer);
+ virtual GLboolean isProgram(GLuint program);
+ virtual GLboolean isRenderbuffer(GLuint renderbuffer);
+ virtual GLboolean isShader(GLuint shader);
+ virtual GLboolean isTexture(GLuint texture);
+ virtual void lineWidth(GLfloat) {}
+ virtual void linkProgram(GLuint program) {}
+ virtual void pixelStorei(GLenum pname, GLint param) {}
virtual void polygonOffset(
- blink::WGC3Dfloat factor,
- blink::WGC3Dfloat units) {}
+ GLfloat factor,
+ GLfloat units) {}
virtual void readPixels(
- blink::WGC3Dint x,
- blink::WGC3Dint y,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Denum format,
- blink::WGC3Denum type,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
void* pixels) {}
virtual void releaseShaderCompiler() {}
virtual void renderbufferStorage(
- blink::WGC3Denum target,
- blink::WGC3Denum internalformat,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height) {}
+ GLenum target,
+ GLenum internalformat,
+ GLsizei width,
+ GLsizei height) {}
virtual void sampleCoverage(
- blink::WGC3Dclampf value,
- blink::WGC3Dboolean invert) {}
+ GLclampf value,
+ GLboolean invert) {}
virtual void scissor(
- blink::WGC3Dint x,
- blink::WGC3Dint y,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height) {}
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) {}
virtual void shaderSource(
- blink::WebGLId shader,
- const blink::WGC3Dchar* string) {}
+ GLuint shader,
+ const GLchar* string) {}
virtual void stencilFunc(
- blink::WGC3Denum func,
- blink::WGC3Dint ref,
- blink::WGC3Duint mask) {}
+ GLenum func,
+ GLint ref,
+ GLuint mask) {}
virtual void stencilFuncSeparate(
- blink::WGC3Denum face,
- blink::WGC3Denum func,
- blink::WGC3Dint ref,
- blink::WGC3Duint mask) {}
- virtual void stencilMask(blink::WGC3Duint mask) {}
+ GLenum face,
+ GLenum func,
+ GLint ref,
+ GLuint mask) {}
+ virtual void stencilMask(GLuint mask) {}
virtual void stencilMaskSeparate(
- blink::WGC3Denum face,
- blink::WGC3Duint mask) {}
+ GLenum face,
+ GLuint mask) {}
virtual void stencilOp(
- blink::WGC3Denum fail,
- blink::WGC3Denum zfail,
- blink::WGC3Denum zpass) {}
+ GLenum fail,
+ GLenum zfail,
+ GLenum zpass) {}
virtual void stencilOpSeparate(
- blink::WGC3Denum face,
- blink::WGC3Denum fail,
- blink::WGC3Denum zfail,
- blink::WGC3Denum zpass) {}
+ GLenum face,
+ GLenum fail,
+ GLenum zfail,
+ GLenum zpass) {}
virtual void texImage2D(
- blink::WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Denum internalformat,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Dint border,
- blink::WGC3Denum format,
- blink::WGC3Denum type,
+ GLenum target,
+ GLint level,
+ GLenum internalformat,
+ GLsizei width,
+ GLsizei height,
+ GLint border,
+ GLenum format,
+ GLenum type,
const void* pixels) {}
virtual void texParameterf(
- blink::WGC3Denum target,
- blink::WGC3Denum pname,
- blink::WGC3Dfloat param) {}
+ GLenum target,
+ GLenum pname,
+ GLfloat param) {}
virtual void texParameteri(
- blink::WGC3Denum target,
- blink::WGC3Denum pname,
- blink::WGC3Dint param) {}
+ GLenum target,
+ GLenum pname,
+ GLint param) {}
virtual void texSubImage2D(
- blink::WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Dint xoffset,
- blink::WGC3Dint yoffset,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Denum format,
- blink::WGC3Denum type,
+ GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
const void* pixels) {}
- virtual void uniform1f(blink::WGC3Dint location, blink::WGC3Dfloat x) {}
+ virtual void uniform1f(GLint location, GLfloat x) {}
virtual void uniform1fv(
- blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- const blink::WGC3Dfloat* v) {}
- virtual void uniform1i(blink::WGC3Dint location, blink::WGC3Dint x) {}
+ GLint location,
+ GLsizei count,
+ const GLfloat* v) {}
+ virtual void uniform1i(GLint location, GLint x) {}
virtual void uniform1iv(
- blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- const blink::WGC3Dint* v) {}
+ GLint location,
+ GLsizei count,
+ const GLint* v) {}
virtual void uniform2f(
- blink::WGC3Dint location,
- blink::WGC3Dfloat x,
- blink::WGC3Dfloat y) {}
+ GLint location,
+ GLfloat x,
+ GLfloat y) {}
virtual void uniform2fv(
- blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- const blink::WGC3Dfloat* v) {}
+ GLint location,
+ GLsizei count,
+ const GLfloat* v) {}
virtual void uniform2i(
- blink::WGC3Dint location,
- blink::WGC3Dint x,
- blink::WGC3Dint y) {}
+ GLint location,
+ GLint x,
+ GLint y) {}
virtual void uniform2iv(
- blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- const blink::WGC3Dint* v) {}
+ GLint location,
+ GLsizei count,
+ const GLint* v) {}
virtual void uniform3f(
- blink::WGC3Dint location,
- blink::WGC3Dfloat x,
- blink::WGC3Dfloat y,
- blink::WGC3Dfloat z) {}
+ GLint location,
+ GLfloat x,
+ GLfloat y,
+ GLfloat z) {}
virtual void uniform3fv(
- blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- const blink::WGC3Dfloat* v) {}
+ GLint location,
+ GLsizei count,
+ const GLfloat* v) {}
virtual void uniform3i(
- blink::WGC3Dint location,
- blink::WGC3Dint x,
- blink::WGC3Dint y,
- blink::WGC3Dint z) {}
+ GLint location,
+ GLint x,
+ GLint y,
+ GLint z) {}
virtual void uniform3iv(
- blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- const blink::WGC3Dint* v) {}
+ GLint location,
+ GLsizei count,
+ const GLint* v) {}
virtual void uniform4f(
- blink::WGC3Dint location,
- blink::WGC3Dfloat x,
- blink::WGC3Dfloat y,
- blink::WGC3Dfloat z,
- blink::WGC3Dfloat w) {}
+ GLint location,
+ GLfloat x,
+ GLfloat y,
+ GLfloat z,
+ GLfloat w) {}
virtual void uniform4fv(
- blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- const blink::WGC3Dfloat* v) {}
+ GLint location,
+ GLsizei count,
+ const GLfloat* v) {}
virtual void uniform4i(
- blink::WGC3Dint location,
- blink::WGC3Dint x,
- blink::WGC3Dint y,
- blink::WGC3Dint z,
- blink::WGC3Dint w) {}
+ GLint location,
+ GLint x,
+ GLint y,
+ GLint z,
+ GLint w) {}
virtual void uniform4iv(
- blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- const blink::WGC3Dint* v) {}
+ GLint location,
+ GLsizei count,
+ const GLint* v) {}
virtual void uniformMatrix2fv(
- blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- blink::WGC3Dboolean transpose,
- const blink::WGC3Dfloat* value) {}
+ GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat* value) {}
virtual void uniformMatrix3fv(
- blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- blink::WGC3Dboolean transpose,
- const blink::WGC3Dfloat* value) {}
+ GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat* value) {}
virtual void uniformMatrix4fv(
- blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- blink::WGC3Dboolean transpose,
- const blink::WGC3Dfloat* value) {}
+ GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat* value) {}
- virtual void useProgram(blink::WebGLId program);
- virtual void validateProgram(blink::WebGLId program) {}
+ virtual void useProgram(GLuint program);
+ virtual void validateProgram(GLuint program) {}
- virtual void vertexAttrib1f(blink::WGC3Duint index, blink::WGC3Dfloat x) {}
+ virtual void vertexAttrib1f(GLuint index, GLfloat x) {}
virtual void vertexAttrib1fv(
- blink::WGC3Duint index,
- const blink::WGC3Dfloat* values) {}
+ GLuint index,
+ const GLfloat* values) {}
virtual void vertexAttrib2f(
- blink::WGC3Duint index,
- blink::WGC3Dfloat x,
- blink::WGC3Dfloat y) {}
+ GLuint index,
+ GLfloat x,
+ GLfloat y) {}
virtual void vertexAttrib2fv(
- blink::WGC3Duint index,
- const blink::WGC3Dfloat* values) {}
+ GLuint index,
+ const GLfloat* values) {}
virtual void vertexAttrib3f(
- blink::WGC3Duint index,
- blink::WGC3Dfloat x,
- blink::WGC3Dfloat y,
- blink::WGC3Dfloat z) {}
+ GLuint index,
+ GLfloat x,
+ GLfloat y,
+ GLfloat z) {}
virtual void vertexAttrib3fv(
- blink::WGC3Duint index,
- const blink::WGC3Dfloat* values) {}
+ GLuint index,
+ const GLfloat* values) {}
virtual void vertexAttrib4f(
- blink::WGC3Duint index,
- blink::WGC3Dfloat x,
- blink::WGC3Dfloat y,
- blink::WGC3Dfloat z,
- blink::WGC3Dfloat w) {}
+ GLuint index,
+ GLfloat x,
+ GLfloat y,
+ GLfloat z,
+ GLfloat w) {}
virtual void vertexAttrib4fv(
- blink::WGC3Duint index,
- const blink::WGC3Dfloat* values) {}
+ GLuint index,
+ const GLfloat* values) {}
virtual void vertexAttribPointer(
- blink::WGC3Duint index,
- blink::WGC3Dint size,
- blink::WGC3Denum type,
- blink::WGC3Dboolean normalized,
- blink::WGC3Dsizei stride,
- blink::WGC3Dintptr offset) {}
+ GLuint index,
+ GLint size,
+ GLenum type,
+ GLboolean normalized,
+ GLsizei stride,
+ GLintptr offset) {}
virtual void viewport(
- blink::WGC3Dint x,
- blink::WGC3Dint y,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height) {}
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) {}
- virtual void genBuffers(blink::WGC3Dsizei count, blink::WebGLId* ids);
- virtual void genFramebuffers(blink::WGC3Dsizei count, blink::WebGLId* ids);
- virtual void genRenderbuffers(blink::WGC3Dsizei count, blink::WebGLId* ids);
- virtual void genTextures(blink::WGC3Dsizei count, blink::WebGLId* ids);
+ virtual void genBuffers(GLsizei count, GLuint* ids);
+ virtual void genFramebuffers(GLsizei count, GLuint* ids);
+ virtual void genRenderbuffers(GLsizei count, GLuint* ids);
+ virtual void genTextures(GLsizei count, GLuint* ids);
- virtual void deleteBuffers(blink::WGC3Dsizei count, blink::WebGLId* ids);
+ virtual void deleteBuffers(GLsizei count, GLuint* ids);
virtual void deleteFramebuffers(
- blink::WGC3Dsizei count, blink::WebGLId* ids);
+ GLsizei count, GLuint* ids);
virtual void deleteRenderbuffers(
- blink::WGC3Dsizei count, blink::WebGLId* ids);
- virtual void deleteTextures(blink::WGC3Dsizei count, blink::WebGLId* ids);
+ GLsizei count, GLuint* ids);
+ virtual void deleteTextures(GLsizei count, GLuint* ids);
- virtual blink::WebGLId createBuffer();
- virtual blink::WebGLId createFramebuffer();
- virtual blink::WebGLId createRenderbuffer();
- virtual blink::WebGLId createTexture();
+ virtual GLuint createBuffer();
+ virtual GLuint createFramebuffer();
+ virtual GLuint createRenderbuffer();
+ virtual GLuint createTexture();
- virtual void deleteBuffer(blink::WebGLId id);
- virtual void deleteFramebuffer(blink::WebGLId id);
- virtual void deleteRenderbuffer(blink::WebGLId id);
- virtual void deleteTexture(blink::WebGLId id);
+ virtual void deleteBuffer(GLuint id);
+ virtual void deleteFramebuffer(GLuint id);
+ virtual void deleteRenderbuffer(GLuint id);
+ virtual void deleteTexture(GLuint id);
- virtual blink::WebGLId createProgram();
- virtual blink::WebGLId createShader(blink::WGC3Denum);
+ virtual GLuint createProgram();
+ virtual GLuint createShader(GLenum);
- virtual void deleteProgram(blink::WebGLId id);
- virtual void deleteShader(blink::WebGLId id);
+ virtual void deleteProgram(GLuint id);
+ virtual void deleteShader(GLuint id);
virtual void texStorage2DEXT(
- blink::WGC3Denum target,
- blink::WGC3Dint levels,
- blink::WGC3Duint internalformat,
- blink::WGC3Dint width,
- blink::WGC3Dint height) {}
-
- virtual blink::WebGLId createQueryEXT();
- virtual void deleteQueryEXT(blink::WebGLId query) {}
- virtual blink::WGC3Dboolean isQueryEXT(blink::WebGLId query);
+ GLenum target,
+ GLint levels,
+ GLuint internalformat,
+ GLint width,
+ GLint height) {}
+
+ virtual GLuint createQueryEXT();
+ virtual void deleteQueryEXT(GLuint query) {}
+ virtual GLboolean isQueryEXT(GLuint query);
virtual void beginQueryEXT(
- blink::WGC3Denum target,
- blink::WebGLId query) {}
- virtual void endQueryEXT(blink::WGC3Denum target);
+ GLenum target,
+ GLuint query) {}
+ virtual void endQueryEXT(GLenum target);
virtual void getQueryivEXT(
- blink::WGC3Denum target,
- blink::WGC3Denum pname,
- blink::WGC3Dint* params) {}
+ GLenum target,
+ GLenum pname,
+ GLint* params) {}
virtual void getQueryObjectuivEXT(
- blink::WebGLId query,
- blink::WGC3Denum pname,
- blink::WGC3Duint* params);
+ GLuint query,
+ GLenum pname,
+ GLuint* params);
virtual void setContextLostCallback(
blink::WebGraphicsContext3D::WebGraphicsContextLostCallback* callback);
- virtual void loseContextCHROMIUM(blink::WGC3Denum current,
- blink::WGC3Denum other);
+ virtual void loseContextCHROMIUM(GLenum current,
+ GLenum other);
- virtual void drawBuffersEXT(blink::WGC3Dsizei m,
- const blink::WGC3Denum* bufs) {}
+ virtual void drawBuffersEXT(GLsizei m,
+ const GLenum* bufs) {}
- virtual void bindTexImage2DCHROMIUM(blink::WGC3Denum target,
- blink::WGC3Dint image_id) {}
+ virtual void bindTexImage2DCHROMIUM(GLenum target,
+ GLint image_id) {}
// GL_CHROMIUM_gpu_memory_buffer
- virtual blink::WGC3Duint createImageCHROMIUM(
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Denum internalformat);
- virtual void destroyImageCHROMIUM(blink::WGC3Duint image_id) {}
+ virtual GLuint createImageCHROMIUM(
+ GLsizei width,
+ GLsizei height,
+ GLenum internalformat);
+ virtual void destroyImageCHROMIUM(GLuint image_id) {}
virtual void getImageParameterivCHROMIUM(
- blink::WGC3Duint image_id,
- blink::WGC3Denum pname,
- blink::WGC3Dint* params) {}
+ GLuint image_id,
+ GLenum pname,
+ GLint* params) {}
virtual void* mapImageCHROMIUM(
- blink::WGC3Duint image_id,
- blink::WGC3Denum access);
- virtual void unmapImageCHROMIUM(blink::WGC3Duint image_id) {}
+ GLuint image_id,
+ GLenum access);
+ virtual void unmapImageCHROMIUM(GLuint image_id) {}
private:
DISALLOW_COPY_AND_ASSIGN(FakeWebGraphicsContext3D);
diff --git a/cc/test/ordered_texture_map.cc b/cc/test/ordered_texture_map.cc
index 9775e83..ee3e2f3 100644
--- a/cc/test/ordered_texture_map.cc
+++ b/cc/test/ordered_texture_map.cc
@@ -13,7 +13,7 @@ OrderedTextureMap::OrderedTextureMap() {}
OrderedTextureMap::~OrderedTextureMap() {}
-void OrderedTextureMap::Append(blink::WebGLId id,
+void OrderedTextureMap::Append(GLuint id,
scoped_refptr<TestTexture> texture) {
DCHECK(texture.get());
DCHECK(!ContainsId(id));
@@ -22,7 +22,7 @@ void OrderedTextureMap::Append(blink::WebGLId id,
ordered_textures_.push_back(id);
}
-void OrderedTextureMap::Replace(blink::WebGLId id,
+void OrderedTextureMap::Replace(GLuint id,
scoped_refptr<TestTexture> texture) {
DCHECK(texture.get());
DCHECK(ContainsId(id));
@@ -30,7 +30,7 @@ void OrderedTextureMap::Replace(blink::WebGLId id,
textures_[id] = texture;
}
-void OrderedTextureMap::Remove(blink::WebGLId id) {
+void OrderedTextureMap::Remove(GLuint id) {
TextureMap::iterator map_it = textures_.find(id);
DCHECK(map_it != textures_.end());
textures_.erase(map_it);
@@ -43,18 +43,18 @@ void OrderedTextureMap::Remove(blink::WebGLId id) {
size_t OrderedTextureMap::Size() { return ordered_textures_.size(); }
-bool OrderedTextureMap::ContainsId(blink::WebGLId id) {
+bool OrderedTextureMap::ContainsId(GLuint id) {
return textures_.find(id) != textures_.end();
}
-scoped_refptr<TestTexture> OrderedTextureMap::TextureForId(blink::WebGLId id) {
+scoped_refptr<TestTexture> OrderedTextureMap::TextureForId(GLuint id) {
DCHECK(ContainsId(id));
scoped_refptr<TestTexture> texture = textures_[id];
DCHECK(texture.get());
return texture;
}
-blink::WebGLId OrderedTextureMap::IdAt(size_t index) {
+GLuint OrderedTextureMap::IdAt(size_t index) {
DCHECK(index < Size());
return ordered_textures_[index];
}
diff --git a/cc/test/ordered_texture_map.h b/cc/test/ordered_texture_map.h
index b826595..4797c59 100644
--- a/cc/test/ordered_texture_map.h
+++ b/cc/test/ordered_texture_map.h
@@ -9,7 +9,7 @@
#include "base/containers/hash_tables.h"
#include "base/memory/ref_counted.h"
-#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
+#include "third_party/khronos/GLES2/gl2.h"
namespace cc {
@@ -20,21 +20,21 @@ class OrderedTextureMap {
OrderedTextureMap();
~OrderedTextureMap();
- void Append(blink::WebGLId id, scoped_refptr<TestTexture> texture);
- void Replace(blink::WebGLId id, scoped_refptr<TestTexture> texture);
- void Remove(blink::WebGLId id);
+ void Append(GLuint id, scoped_refptr<TestTexture> texture);
+ void Replace(GLuint id, scoped_refptr<TestTexture> texture);
+ void Remove(GLuint id);
size_t Size();
- bool ContainsId(blink::WebGLId id);
+ bool ContainsId(GLuint id);
- scoped_refptr<TestTexture> TextureForId(blink::WebGLId id);
- blink::WebGLId IdAt(size_t index);
+ scoped_refptr<TestTexture> TextureForId(GLuint id);
+ GLuint IdAt(size_t index);
private:
- typedef base::hash_map<blink::WebGLId, scoped_refptr<TestTexture> >
+ typedef base::hash_map<GLuint, scoped_refptr<TestTexture> >
TextureMap;
- typedef std::vector<blink::WebGLId> TextureList;
+ typedef std::vector<GLuint> TextureList;
TextureMap textures_;
TextureList ordered_textures_;
diff --git a/cc/test/test_texture.cc b/cc/test/test_texture.cc
index d94ad56..0f4f07c 100644
--- a/cc/test/test_texture.cc
+++ b/cc/test/test_texture.cc
@@ -5,7 +5,6 @@
#include "cc/test/test_texture.h"
#include "gpu/GLES2/gl2extchromium.h"
-#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/khronos/GLES2/gl2ext.h"
namespace cc {
@@ -35,7 +34,7 @@ void TestTexture::Reallocate(gfx::Size size, ResourceFormat format) {
this->data.reset(new uint8_t[TextureSizeBytes(size, format)]);
}
-bool TestTexture::IsValidParameter(blink::WGC3Denum pname) {
+bool TestTexture::IsValidParameter(GLenum pname) {
return params.find(pname) != params.end();
}
diff --git a/cc/test/test_texture.h b/cc/test/test_texture.h
index 71015c8..f5070e1 100644
--- a/cc/test/test_texture.h
+++ b/cc/test/test_texture.h
@@ -9,7 +9,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "cc/resources/resource_format.h"
-#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
+#include "third_party/khronos/GLES2/gl2.h"
#include "ui/gfx/size.h"
namespace cc {
@@ -20,13 +20,13 @@ struct TestTexture : public base::RefCounted<TestTexture> {
TestTexture();
void Reallocate(gfx::Size size, ResourceFormat format);
- bool IsValidParameter(blink::WGC3Denum pname);
+ bool IsValidParameter(GLenum pname);
gfx::Size size;
ResourceFormat format;
scoped_ptr<uint8_t[]> data;
- typedef base::hash_map<blink::WGC3Denum, blink::WGC3Dint>
+ typedef base::hash_map<GLenum, GLint>
TextureParametersMap;
TextureParametersMap params;
diff --git a/cc/test/test_web_graphics_context_3d.cc b/cc/test/test_web_graphics_context_3d.cc
index e454976..bfb8bc4 100644
--- a/cc/test/test_web_graphics_context_3d.cc
+++ b/cc/test/test_web_graphics_context_3d.cc
@@ -16,24 +16,16 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/khronos/GLES2/gl2ext.h"
-using blink::WGC3Dboolean;
-using blink::WGC3Dchar;
-using blink::WGC3Denum;
-using blink::WGC3Dint;
-using blink::WGC3Dsizei;
-using blink::WGC3Dsizeiptr;
-using blink::WGC3Duint;
-using blink::WebGLId;
using blink::WebGraphicsContext3D;
namespace cc {
-static const WebGLId kFramebufferId = 1;
-static const WebGLId kRenderbufferId = 2;
+static const GLuint kFramebufferId = 1;
+static const GLuint kRenderbufferId = 2;
static unsigned s_context_id = 1;
-const WebGLId TestWebGraphicsContext3D::kExternalTextureId = 1337;
+const GLuint TestWebGraphicsContext3D::kExternalTextureId = 1337;
static base::LazyInstance<base::Lock>::Leaky
g_shared_namespace_lock = LAZY_INSTANCE_INITIALIZER;
@@ -112,82 +104,82 @@ bool TestWebGraphicsContext3D::isContextLost() {
return context_lost_;
}
-WGC3Denum TestWebGraphicsContext3D::checkFramebufferStatus(
- WGC3Denum target) {
+GLenum TestWebGraphicsContext3D::checkFramebufferStatus(
+ GLenum target) {
if (context_lost_)
return GL_FRAMEBUFFER_UNDEFINED_OES;
return GL_FRAMEBUFFER_COMPLETE;
}
-blink::WebString TestWebGraphicsContext3D::getString(WGC3Denum name) {
+blink::WebString TestWebGraphicsContext3D::getString(GLenum name) {
return blink::WebString();
}
-WGC3Dint TestWebGraphicsContext3D::getUniformLocation(
- WebGLId program,
- const WGC3Dchar* name) {
+GLint TestWebGraphicsContext3D::getUniformLocation(
+ GLuint program,
+ const GLchar* name) {
return 0;
}
-WGC3Dsizeiptr TestWebGraphicsContext3D::getVertexAttribOffset(
- WGC3Duint index,
- WGC3Denum pname) {
+GLsizeiptr TestWebGraphicsContext3D::getVertexAttribOffset(
+ GLuint index,
+ GLenum pname) {
return 0;
}
-WGC3Dboolean TestWebGraphicsContext3D::isBuffer(
- WebGLId buffer) {
+GLboolean TestWebGraphicsContext3D::isBuffer(
+ GLuint buffer) {
return false;
}
-WGC3Dboolean TestWebGraphicsContext3D::isEnabled(
- WGC3Denum cap) {
+GLboolean TestWebGraphicsContext3D::isEnabled(
+ GLenum cap) {
return false;
}
-WGC3Dboolean TestWebGraphicsContext3D::isFramebuffer(
- WebGLId framebuffer) {
+GLboolean TestWebGraphicsContext3D::isFramebuffer(
+ GLuint framebuffer) {
return false;
}
-WGC3Dboolean TestWebGraphicsContext3D::isProgram(
- WebGLId program) {
+GLboolean TestWebGraphicsContext3D::isProgram(
+ GLuint program) {
return false;
}
-WGC3Dboolean TestWebGraphicsContext3D::isRenderbuffer(
- WebGLId renderbuffer) {
+GLboolean TestWebGraphicsContext3D::isRenderbuffer(
+ GLuint renderbuffer) {
return false;
}
-WGC3Dboolean TestWebGraphicsContext3D::isShader(
- WebGLId shader) {
+GLboolean TestWebGraphicsContext3D::isShader(
+ GLuint shader) {
return false;
}
-WGC3Dboolean TestWebGraphicsContext3D::isTexture(
- WebGLId texture) {
+GLboolean TestWebGraphicsContext3D::isTexture(
+ GLuint texture) {
return false;
}
-void TestWebGraphicsContext3D::genBuffers(WGC3Dsizei count, WebGLId* ids) {
+void TestWebGraphicsContext3D::genBuffers(GLsizei count, GLuint* ids) {
for (int i = 0; i < count; ++i)
ids[i] = NextBufferId();
}
void TestWebGraphicsContext3D::genFramebuffers(
- WGC3Dsizei count, WebGLId* ids) {
+ GLsizei count, GLuint* ids) {
for (int i = 0; i < count; ++i)
ids[i] = kFramebufferId | context_id_ << 16;
}
void TestWebGraphicsContext3D::genRenderbuffers(
- WGC3Dsizei count, WebGLId* ids) {
+ GLsizei count, GLuint* ids) {
for (int i = 0; i < count; ++i)
ids[i] = kRenderbufferId | context_id_ << 16;
}
-void TestWebGraphicsContext3D::genTextures(WGC3Dsizei count, WebGLId* ids) {
+void TestWebGraphicsContext3D::genTextures(GLsizei count, GLuint* ids) {
for (int i = 0; i < count; ++i) {
ids[i] = NextTextureId();
DCHECK_NE(ids[i], kExternalTextureId);
@@ -197,24 +189,24 @@ void TestWebGraphicsContext3D::genTextures(WGC3Dsizei count, WebGLId* ids) {
namespace_->textures.Append(ids[i], new TestTexture());
}
-void TestWebGraphicsContext3D::deleteBuffers(WGC3Dsizei count, WebGLId* ids) {
+void TestWebGraphicsContext3D::deleteBuffers(GLsizei count, GLuint* ids) {
for (int i = 0; i < count; ++i)
RetireBufferId(ids[i]);
}
void TestWebGraphicsContext3D::deleteFramebuffers(
- WGC3Dsizei count, WebGLId* ids) {
+ GLsizei count, GLuint* ids) {
for (int i = 0; i < count; ++i)
DCHECK_EQ(kFramebufferId | context_id_ << 16, ids[i]);
}
void TestWebGraphicsContext3D::deleteRenderbuffers(
- WGC3Dsizei count, WebGLId* ids) {
+ GLsizei count, GLuint* ids) {
for (int i = 0; i < count; ++i)
DCHECK_EQ(kRenderbufferId | context_id_ << 16, ids[i]);
}
-void TestWebGraphicsContext3D::deleteTextures(WGC3Dsizei count, WebGLId* ids) {
+void TestWebGraphicsContext3D::deleteTextures(GLsizei count, GLuint* ids) {
for (int i = 0; i < count; ++i)
RetireTextureId(ids[i]);
base::AutoLock lock(namespace_->lock);
@@ -224,43 +216,43 @@ void TestWebGraphicsContext3D::deleteTextures(WGC3Dsizei count, WebGLId* ids) {
}
}
-WebGLId TestWebGraphicsContext3D::createBuffer() {
- WebGLId id;
+GLuint TestWebGraphicsContext3D::createBuffer() {
+ GLuint id;
genBuffers(1, &id);
return id;
}
-WebGLId TestWebGraphicsContext3D::createFramebuffer() {
- WebGLId id;
+GLuint TestWebGraphicsContext3D::createFramebuffer() {
+ GLuint id;
genFramebuffers(1, &id);
return id;
}
-WebGLId TestWebGraphicsContext3D::createRenderbuffer() {
- WebGLId id;
+GLuint TestWebGraphicsContext3D::createRenderbuffer() {
+ GLuint id;
genRenderbuffers(1, &id);
return id;
}
-WebGLId TestWebGraphicsContext3D::createTexture() {
- WebGLId id;
+GLuint TestWebGraphicsContext3D::createTexture() {
+ GLuint id;
genTextures(1, &id);
return id;
}
-void TestWebGraphicsContext3D::deleteBuffer(WebGLId id) {
+void TestWebGraphicsContext3D::deleteBuffer(GLuint id) {
deleteBuffers(1, &id);
}
-void TestWebGraphicsContext3D::deleteFramebuffer(WebGLId id) {
+void TestWebGraphicsContext3D::deleteFramebuffer(GLuint id) {
deleteFramebuffers(1, &id);
}
-void TestWebGraphicsContext3D::deleteRenderbuffer(WebGLId id) {
+void TestWebGraphicsContext3D::deleteRenderbuffer(GLuint id) {
deleteRenderbuffers(1, &id);
}
-void TestWebGraphicsContext3D::deleteTexture(WebGLId id) {
+void TestWebGraphicsContext3D::deleteTexture(GLuint id) {
deleteTextures(1, &id);
}
@@ -270,38 +262,38 @@ unsigned TestWebGraphicsContext3D::createProgram() {
return program;
}
-WebGLId TestWebGraphicsContext3D::createShader(WGC3Denum) {
+GLuint TestWebGraphicsContext3D::createShader(GLenum) {
unsigned shader = next_shader_id_++ | context_id_ << 16;
shader_set_.insert(shader);
return shader;
}
-WebGLId TestWebGraphicsContext3D::createExternalTexture() {
+GLuint TestWebGraphicsContext3D::createExternalTexture() {
base::AutoLock lock(namespace_->lock);
namespace_->textures.Append(kExternalTextureId, new TestTexture());
return kExternalTextureId;
}
-void TestWebGraphicsContext3D::deleteProgram(WebGLId id) {
+void TestWebGraphicsContext3D::deleteProgram(GLuint id) {
if (!program_set_.count(id))
ADD_FAILURE() << "deleteProgram called on unknown program " << id;
program_set_.erase(id);
}
-void TestWebGraphicsContext3D::deleteShader(WebGLId id) {
+void TestWebGraphicsContext3D::deleteShader(GLuint id) {
if (!shader_set_.count(id))
ADD_FAILURE() << "deleteShader called on unknown shader " << id;
shader_set_.erase(id);
}
-void TestWebGraphicsContext3D::attachShader(WebGLId program, WebGLId shader) {
+void TestWebGraphicsContext3D::attachShader(GLuint program, GLuint shader) {
if (!program_set_.count(program))
ADD_FAILURE() << "attachShader called with unknown program " << program;
if (!shader_set_.count(shader))
ADD_FAILURE() << "attachShader called with unknown shader " << shader;
}
-void TestWebGraphicsContext3D::useProgram(WebGLId program) {
+void TestWebGraphicsContext3D::useProgram(GLuint program) {
if (!program)
return;
if (!program_set_.count(program))
@@ -309,21 +301,21 @@ void TestWebGraphicsContext3D::useProgram(WebGLId program) {
}
void TestWebGraphicsContext3D::bindFramebuffer(
- WGC3Denum target, WebGLId framebuffer) {
+ GLenum target, GLuint framebuffer) {
if (!framebuffer)
return;
DCHECK_EQ(kFramebufferId | context_id_ << 16, framebuffer);
}
void TestWebGraphicsContext3D::bindRenderbuffer(
- WGC3Denum target, WebGLId renderbuffer) {
+ GLenum target, GLuint renderbuffer) {
if (!renderbuffer)
return;
DCHECK_EQ(kRenderbufferId | context_id_ << 16, renderbuffer);
}
void TestWebGraphicsContext3D::bindTexture(
- WGC3Denum target, WebGLId texture_id) {
+ GLenum target, GLuint texture_id) {
if (times_bind_texture_succeeds_ >= 0) {
if (!times_bind_texture_succeeds_) {
loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB,
@@ -340,23 +332,23 @@ void TestWebGraphicsContext3D::bindTexture(
used_textures_.insert(texture_id);
}
-blink::WebGLId TestWebGraphicsContext3D::BoundTextureId(
- blink::WGC3Denum target) {
+GLuint TestWebGraphicsContext3D::BoundTextureId(
+ GLenum target) {
return texture_targets_.BoundTexture(target);
}
scoped_refptr<TestTexture> TestWebGraphicsContext3D::BoundTexture(
- WGC3Denum target) {
+ GLenum target) {
// The caller is expected to lock the namespace for texture access.
namespace_->lock.AssertAcquired();
return namespace_->textures.TextureForId(BoundTextureId(target));
}
-void TestWebGraphicsContext3D::CheckTextureIsBound(WGC3Denum target) {
+void TestWebGraphicsContext3D::CheckTextureIsBound(GLenum target) {
DCHECK(BoundTextureId(target));
}
-void TestWebGraphicsContext3D::endQueryEXT(WGC3Denum target) {
+void TestWebGraphicsContext3D::endQueryEXT(GLenum target) {
if (times_end_query_succeeds_ >= 0) {
if (!times_end_query_succeeds_) {
loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB,
@@ -367,24 +359,24 @@ void TestWebGraphicsContext3D::endQueryEXT(WGC3Denum target) {
}
void TestWebGraphicsContext3D::getQueryObjectuivEXT(
- WebGLId query,
- WGC3Denum pname,
- WGC3Duint* params) {
+ GLuint query,
+ GLenum pname,
+ GLuint* params) {
// If the context is lost, behave as if result is available.
if (pname == GL_QUERY_RESULT_AVAILABLE_EXT)
*params = 1;
}
void TestWebGraphicsContext3D::getIntegerv(
- WGC3Denum pname,
- blink::WGC3Dint* value) {
+ GLenum pname,
+ GLint* value) {
if (pname == GL_MAX_TEXTURE_SIZE)
*value = max_texture_size_;
else if (pname == GL_ACTIVE_TEXTURE)
*value = GL_TEXTURE0;
}
-void TestWebGraphicsContext3D::genMailboxCHROMIUM(blink::WGC3Dbyte* mailbox) {
+void TestWebGraphicsContext3D::genMailboxCHROMIUM(GLbyte* mailbox) {
if (times_gen_mailbox_succeeds_ >= 0) {
if (!times_gen_mailbox_succeeds_) {
loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB,
@@ -413,8 +405,8 @@ void TestWebGraphicsContext3D::setContextLostCallback(
context_lost_callback_ = callback;
}
-void TestWebGraphicsContext3D::loseContextCHROMIUM(WGC3Denum current,
- WGC3Denum other) {
+void TestWebGraphicsContext3D::loseContextCHROMIUM(GLenum current,
+ GLenum other) {
if (context_lost_)
return;
context_lost_ = true;
@@ -434,8 +426,8 @@ void TestWebGraphicsContext3D::flush() {
test_support_->CallAllSyncPointCallbacks();
}
-void TestWebGraphicsContext3D::bindBuffer(blink::WGC3Denum target,
- blink::WebGLId buffer) {
+void TestWebGraphicsContext3D::bindBuffer(GLenum target,
+ GLuint buffer) {
bound_buffer_ = buffer;
if (!bound_buffer_)
return;
@@ -453,10 +445,10 @@ void TestWebGraphicsContext3D::bindBuffer(blink::WGC3Denum target,
buffers.get(bound_buffer_)->target = target;
}
-void TestWebGraphicsContext3D::bufferData(blink::WGC3Denum target,
- blink::WGC3Dsizeiptr size,
+void TestWebGraphicsContext3D::bufferData(GLenum target,
+ GLsizeiptr size,
const void* data,
- blink::WGC3Denum usage) {
+ GLenum usage) {
base::AutoLock lock(namespace_->lock);
base::ScopedPtrHashMap<unsigned, Buffer>& buffers = namespace_->buffers;
DCHECK_GT(buffers.count(bound_buffer_), 0u);
@@ -477,8 +469,8 @@ void TestWebGraphicsContext3D::bufferData(blink::WGC3Denum target,
GetTransferBufferMemoryUsedBytes());
}
-void* TestWebGraphicsContext3D::mapBufferCHROMIUM(blink::WGC3Denum target,
- blink::WGC3Denum access) {
+void* TestWebGraphicsContext3D::mapBufferCHROMIUM(GLenum target,
+ GLenum access) {
base::AutoLock lock(namespace_->lock);
base::ScopedPtrHashMap<unsigned, Buffer>& buffers = namespace_->buffers;
DCHECK_GT(buffers.count(bound_buffer_), 0u);
@@ -497,8 +489,8 @@ void* TestWebGraphicsContext3D::mapBufferCHROMIUM(blink::WGC3Denum target,
return buffers.get(bound_buffer_)->pixels.get();
}
-blink::WGC3Dboolean TestWebGraphicsContext3D::unmapBufferCHROMIUM(
- blink::WGC3Denum target) {
+GLboolean TestWebGraphicsContext3D::unmapBufferCHROMIUM(
+ GLenum target) {
base::AutoLock lock(namespace_->lock);
base::ScopedPtrHashMap<unsigned, Buffer>& buffers = namespace_->buffers;
DCHECK_GT(buffers.count(bound_buffer_), 0u);
@@ -507,11 +499,11 @@ blink::WGC3Dboolean TestWebGraphicsContext3D::unmapBufferCHROMIUM(
return true;
}
-blink::WGC3Duint TestWebGraphicsContext3D::createImageCHROMIUM(
- blink::WGC3Dsizei width, blink::WGC3Dsizei height,
- blink::WGC3Denum internalformat) {
+GLuint TestWebGraphicsContext3D::createImageCHROMIUM(
+ GLsizei width, GLsizei height,
+ GLenum internalformat) {
DCHECK_EQ(GL_RGBA8_OES, static_cast<int>(internalformat));
- blink::WGC3Duint image_id = NextImageId();
+ GLuint image_id = NextImageId();
base::AutoLock lock(namespace_->lock);
base::ScopedPtrHashMap<unsigned, Image>& images = namespace_->images;
images.set(image_id, make_scoped_ptr(new Image).Pass());
@@ -520,22 +512,22 @@ blink::WGC3Duint TestWebGraphicsContext3D::createImageCHROMIUM(
}
void TestWebGraphicsContext3D::destroyImageCHROMIUM(
- blink::WGC3Duint id) {
+ GLuint id) {
RetireImageId(id);
}
void TestWebGraphicsContext3D::getImageParameterivCHROMIUM(
- blink::WGC3Duint image_id,
- blink::WGC3Denum pname,
- blink::WGC3Dint* params) {
+ GLuint image_id,
+ GLenum pname,
+ GLint* params) {
base::AutoLock lock(namespace_->lock);
DCHECK_GT(namespace_->images.count(image_id), 0u);
DCHECK_EQ(GL_IMAGE_ROWBYTES_CHROMIUM, static_cast<int>(pname));
*params = 0;
}
-void* TestWebGraphicsContext3D::mapImageCHROMIUM(blink::WGC3Duint image_id,
- blink::WGC3Denum access) {
+void* TestWebGraphicsContext3D::mapImageCHROMIUM(GLuint image_id,
+ GLenum access) {
base::AutoLock lock(namespace_->lock);
base::ScopedPtrHashMap<unsigned, Image>& images = namespace_->images;
DCHECK_GT(images.count(image_id), 0u);
@@ -549,7 +541,7 @@ void* TestWebGraphicsContext3D::mapImageCHROMIUM(blink::WGC3Duint image_id,
}
void TestWebGraphicsContext3D::unmapImageCHROMIUM(
- blink::WGC3Duint image_id) {
+ GLuint image_id) {
base::AutoLock lock(namespace_->lock);
DCHECK_GT(namespace_->images.count(image_id), 0u);
}
@@ -568,20 +560,20 @@ size_t TestWebGraphicsContext3D::NumTextures() const {
return namespace_->textures.Size();
}
-blink::WebGLId TestWebGraphicsContext3D::TextureAt(int i) const {
+GLuint TestWebGraphicsContext3D::TextureAt(int i) const {
base::AutoLock lock(namespace_->lock);
return namespace_->textures.IdAt(i);
}
-WebGLId TestWebGraphicsContext3D::NextTextureId() {
+GLuint TestWebGraphicsContext3D::NextTextureId() {
base::AutoLock lock(namespace_->lock);
- WebGLId texture_id = namespace_->next_texture_id++;
+ GLuint texture_id = namespace_->next_texture_id++;
DCHECK(texture_id < (1 << 16));
texture_id |= context_id_ << 16;
return texture_id;
}
-void TestWebGraphicsContext3D::RetireTextureId(WebGLId id) {
+void TestWebGraphicsContext3D::RetireTextureId(GLuint id) {
base::AutoLock lock(namespace_->lock);
unsigned context_id = id >> 16;
unsigned texture_id = id & 0xffff;
@@ -590,15 +582,15 @@ void TestWebGraphicsContext3D::RetireTextureId(WebGLId id) {
DCHECK_EQ(context_id, context_id_);
}
-WebGLId TestWebGraphicsContext3D::NextBufferId() {
+GLuint TestWebGraphicsContext3D::NextBufferId() {
base::AutoLock lock(namespace_->lock);
- WebGLId buffer_id = namespace_->next_buffer_id++;
+ GLuint buffer_id = namespace_->next_buffer_id++;
DCHECK(buffer_id < (1 << 16));
buffer_id |= context_id_ << 16;
return buffer_id;
}
-void TestWebGraphicsContext3D::RetireBufferId(WebGLId id) {
+void TestWebGraphicsContext3D::RetireBufferId(GLuint id) {
base::AutoLock lock(namespace_->lock);
unsigned context_id = id >> 16;
unsigned buffer_id = id & 0xffff;
@@ -607,15 +599,15 @@ void TestWebGraphicsContext3D::RetireBufferId(WebGLId id) {
DCHECK_EQ(context_id, context_id_);
}
-blink::WGC3Duint TestWebGraphicsContext3D::NextImageId() {
+GLuint TestWebGraphicsContext3D::NextImageId() {
base::AutoLock lock(namespace_->lock);
- WGC3Duint image_id = namespace_->next_image_id++;
+ GLuint image_id = namespace_->next_image_id++;
DCHECK(image_id < (1 << 16));
image_id |= context_id_ << 16;
return image_id;
}
-void TestWebGraphicsContext3D::RetireImageId(WebGLId id) {
+void TestWebGraphicsContext3D::RetireImageId(GLuint id) {
base::AutoLock lock(namespace_->lock);
unsigned context_id = id >> 16;
unsigned image_id = id & 0xffff;
@@ -652,16 +644,16 @@ TestWebGraphicsContext3D::TextureTargets::TextureTargets() {
TestWebGraphicsContext3D::TextureTargets::~TextureTargets() {}
void TestWebGraphicsContext3D::TextureTargets::BindTexture(
- blink::WGC3Denum target,
- blink::WebGLId id) {
+ GLenum target,
+ GLuint id) {
// Make sure this is a supported target by seeing if it was bound to before.
DCHECK(bound_textures_.find(target) != bound_textures_.end());
bound_textures_[target] = id;
}
-void TestWebGraphicsContext3D::texParameteri(blink::WGC3Denum target,
- blink::WGC3Denum pname,
- blink::WGC3Dint param) {
+void TestWebGraphicsContext3D::texParameteri(GLenum target,
+ GLenum pname,
+ GLint param) {
CheckTextureIsBound(target);
base::AutoLock lock_for_texture_access(namespace_->lock);
scoped_refptr<TestTexture> texture = BoundTexture(target);
@@ -669,9 +661,9 @@ void TestWebGraphicsContext3D::texParameteri(blink::WGC3Denum target,
texture->params[pname] = param;
}
-void TestWebGraphicsContext3D::getTexParameteriv(blink::WGC3Denum target,
- blink::WGC3Denum pname,
- blink::WGC3Dint* value) {
+void TestWebGraphicsContext3D::getTexParameteriv(GLenum target,
+ GLenum pname,
+ GLint* value) {
CheckTextureIsBound(target);
base::AutoLock lock_for_texture_access(namespace_->lock);
scoped_refptr<TestTexture> texture = BoundTexture(target);
@@ -682,7 +674,7 @@ void TestWebGraphicsContext3D::getTexParameteriv(blink::WGC3Denum target,
}
void TestWebGraphicsContext3D::TextureTargets::UnbindTexture(
- blink::WebGLId id) {
+ GLuint id) {
// Bind zero to any targets that the id is bound to.
for (TargetTextureMap::iterator it = bound_textures_.begin();
it != bound_textures_.end();
@@ -692,8 +684,8 @@ void TestWebGraphicsContext3D::TextureTargets::UnbindTexture(
}
}
-blink::WebGLId TestWebGraphicsContext3D::TextureTargets::BoundTexture(
- blink::WGC3Denum target) {
+GLuint TestWebGraphicsContext3D::TextureTargets::BoundTexture(
+ GLenum target) {
DCHECK(bound_textures_.find(target) != bound_textures_.end());
return bound_textures_[target];
}
diff --git a/cc/test/test_web_graphics_context_3d.h b/cc/test/test_web_graphics_context_3d.h
index 98ef9a6..db85b19 100644
--- a/cc/test/test_web_graphics_context_3d.h
+++ b/cc/test/test_web_graphics_context_3d.h
@@ -37,21 +37,21 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D {
virtual bool isContextLost() OVERRIDE;
- virtual void attachShader(blink::WebGLId program,
- blink::WebGLId shader) OVERRIDE;
- virtual void bindFramebuffer(blink::WGC3Denum target,
- blink::WebGLId framebuffer) OVERRIDE;
- virtual void bindRenderbuffer(blink::WGC3Denum target,
- blink::WebGLId renderbuffer) OVERRIDE;
- virtual void bindTexture(blink::WGC3Denum target,
- blink::WebGLId texture_id) OVERRIDE;
-
- virtual void texParameteri(blink::WGC3Denum target,
- blink::WGC3Denum pname,
- blink::WGC3Dint param) OVERRIDE;
- virtual void getTexParameteriv(blink::WGC3Denum target,
- blink::WGC3Denum pname,
- blink::WGC3Dint* value) OVERRIDE;
+ virtual void attachShader(GLuint program, GLuint shader) OVERRIDE;
+ virtual void bindFramebuffer(
+ GLenum target, GLuint framebuffer) OVERRIDE;
+ virtual void bindRenderbuffer(
+ GLenum target, GLuint renderbuffer) OVERRIDE;
+ virtual void bindTexture(
+ GLenum target,
+ GLuint texture_id) OVERRIDE;
+
+ virtual void texParameteri(GLenum target,
+ GLenum pname,
+ GLint param) OVERRIDE;
+ virtual void getTexParameteriv(GLenum target,
+ GLenum pname,
+ GLint* value) OVERRIDE;
virtual void asyncTexImage2DCHROMIUM(GLenum target,
GLint level,
GLenum internalformat,
@@ -73,109 +73,103 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D {
virtual void waitAsyncTexImage2DCHROMIUM(GLenum target) {}
virtual void releaseTexImage2DCHROMIUM(GLenum target, GLint image_id) {}
- virtual blink::WGC3Denum checkFramebufferStatus(blink::WGC3Denum target)
- OVERRIDE;
-
- virtual blink::WebString getString(blink::WGC3Denum name) OVERRIDE;
- virtual blink::WGC3Dint getUniformLocation(blink::WebGLId program,
- const blink::WGC3Dchar* name)
- OVERRIDE;
- virtual blink::WGC3Dsizeiptr getVertexAttribOffset(blink::WGC3Duint index,
- blink::WGC3Denum pname)
- OVERRIDE;
-
- virtual blink::WGC3Dboolean isBuffer(blink::WebGLId buffer) OVERRIDE;
- virtual blink::WGC3Dboolean isEnabled(blink::WGC3Denum cap) OVERRIDE;
- virtual blink::WGC3Dboolean isFramebuffer(blink::WebGLId framebuffer)
- OVERRIDE;
- virtual blink::WGC3Dboolean isProgram(blink::WebGLId program) OVERRIDE;
- virtual blink::WGC3Dboolean isRenderbuffer(blink::WebGLId renderbuffer)
- OVERRIDE;
- virtual blink::WGC3Dboolean isShader(blink::WebGLId shader) OVERRIDE;
- virtual blink::WGC3Dboolean isTexture(blink::WebGLId texture) OVERRIDE;
-
- virtual void useProgram(blink::WebGLId program) OVERRIDE;
-
- virtual void genBuffers(blink::WGC3Dsizei count,
- blink::WebGLId* ids) OVERRIDE;
- virtual void genFramebuffers(blink::WGC3Dsizei count,
- blink::WebGLId* ids) OVERRIDE;
- virtual void genRenderbuffers(blink::WGC3Dsizei count,
- blink::WebGLId* ids) OVERRIDE;
- virtual void genTextures(blink::WGC3Dsizei count,
- blink::WebGLId* ids) OVERRIDE;
-
- virtual void deleteBuffers(blink::WGC3Dsizei count,
- blink::WebGLId* ids) OVERRIDE;
- virtual void deleteFramebuffers(blink::WGC3Dsizei count,
- blink::WebGLId* ids) OVERRIDE;
- virtual void deleteRenderbuffers(blink::WGC3Dsizei count,
- blink::WebGLId* ids) OVERRIDE;
- virtual void deleteTextures(blink::WGC3Dsizei count,
- blink::WebGLId* ids) OVERRIDE;
-
- virtual blink::WebGLId createBuffer() OVERRIDE;
- virtual blink::WebGLId createFramebuffer() OVERRIDE;
- virtual blink::WebGLId createRenderbuffer() OVERRIDE;
- virtual blink::WebGLId createTexture() OVERRIDE;
-
- virtual void deleteBuffer(blink::WebGLId id) OVERRIDE;
- virtual void deleteFramebuffer(blink::WebGLId id) OVERRIDE;
- virtual void deleteRenderbuffer(blink::WebGLId id) OVERRIDE;
- virtual void deleteTexture(blink::WebGLId id) OVERRIDE;
-
- virtual blink::WebGLId createProgram() OVERRIDE;
- virtual blink::WebGLId createShader(blink::WGC3Denum) OVERRIDE;
- virtual blink::WebGLId createExternalTexture();
-
- virtual void deleteProgram(blink::WebGLId id) OVERRIDE;
- virtual void deleteShader(blink::WebGLId id) OVERRIDE;
-
- virtual void endQueryEXT(blink::WGC3Denum target) OVERRIDE;
- virtual void getQueryObjectuivEXT(blink::WebGLId query,
- blink::WGC3Denum pname,
- blink::WGC3Duint* params) OVERRIDE;
-
- virtual void getIntegerv(blink::WGC3Denum pname,
- blink::WGC3Dint* value) OVERRIDE;
-
- virtual void genMailboxCHROMIUM(blink::WGC3Dbyte* mailbox);
- virtual void produceTextureCHROMIUM(blink::WGC3Denum target,
- const blink::WGC3Dbyte* mailbox) {}
- virtual void consumeTextureCHROMIUM(blink::WGC3Denum target,
- const blink::WGC3Dbyte* mailbox) {}
+ virtual GLenum checkFramebufferStatus(GLenum target) OVERRIDE;
+
+ virtual blink::WebString getString(GLenum name) OVERRIDE;
+ virtual GLint getUniformLocation(
+ GLuint program,
+ const GLchar* name) OVERRIDE;
+ virtual GLsizeiptr getVertexAttribOffset(
+ GLuint index,
+ GLenum pname) OVERRIDE;
+
+ virtual GLboolean isBuffer(GLuint buffer) OVERRIDE;
+ virtual GLboolean isEnabled(GLenum cap) OVERRIDE;
+ virtual GLboolean isFramebuffer(GLuint framebuffer) OVERRIDE;
+ virtual GLboolean isProgram(GLuint program) OVERRIDE;
+ virtual GLboolean isRenderbuffer(GLuint renderbuffer) OVERRIDE;
+ virtual GLboolean isShader(GLuint shader) OVERRIDE;
+ virtual GLboolean isTexture(GLuint texture) OVERRIDE;
+
+ virtual void useProgram(GLuint program) OVERRIDE;
+
+ virtual void genBuffers(GLsizei count, GLuint* ids) OVERRIDE;
+ virtual void genFramebuffers(GLsizei count, GLuint* ids) OVERRIDE;
+ virtual void genRenderbuffers(GLsizei count, GLuint* ids) OVERRIDE;
+ virtual void genTextures(GLsizei count, GLuint* ids) OVERRIDE;
+
+ virtual void deleteBuffers(GLsizei count, GLuint* ids) OVERRIDE;
+ virtual void deleteFramebuffers(
+ GLsizei count, GLuint* ids) OVERRIDE;
+ virtual void deleteRenderbuffers(
+ GLsizei count, GLuint* ids) OVERRIDE;
+ virtual void deleteTextures(GLsizei count, GLuint* ids) OVERRIDE;
+
+ virtual GLuint createBuffer() OVERRIDE;
+ virtual GLuint createFramebuffer() OVERRIDE;
+ virtual GLuint createRenderbuffer() OVERRIDE;
+ virtual GLuint createTexture() OVERRIDE;
+
+ virtual void deleteBuffer(GLuint id) OVERRIDE;
+ virtual void deleteFramebuffer(GLuint id) OVERRIDE;
+ virtual void deleteRenderbuffer(GLuint id) OVERRIDE;
+ virtual void deleteTexture(GLuint id) OVERRIDE;
+
+ virtual GLuint createProgram() OVERRIDE;
+ virtual GLuint createShader(GLenum) OVERRIDE;
+ virtual GLuint createExternalTexture();
+
+ virtual void deleteProgram(GLuint id) OVERRIDE;
+ virtual void deleteShader(GLuint id) OVERRIDE;
+
+ virtual void endQueryEXT(GLenum target) OVERRIDE;
+ virtual void getQueryObjectuivEXT(
+ GLuint query,
+ GLenum pname,
+ GLuint* params) OVERRIDE;
+
+ virtual void getIntegerv(
+ GLenum pname,
+ GLint* value) OVERRIDE;
+
+ virtual void genMailboxCHROMIUM(GLbyte* mailbox);
+ virtual void produceTextureCHROMIUM(GLenum target,
+ const GLbyte* mailbox) { }
+ virtual void consumeTextureCHROMIUM(GLenum target,
+ const GLbyte* mailbox) { }
virtual void setContextLostCallback(
blink::WebGraphicsContext3D::WebGraphicsContextLostCallback* callback)
OVERRIDE;
- virtual void loseContextCHROMIUM(blink::WGC3Denum current,
- blink::WGC3Denum other) OVERRIDE;
+ virtual void loseContextCHROMIUM(GLenum current,
+ GLenum other) OVERRIDE;
virtual void finish() OVERRIDE;
virtual void flush() OVERRIDE;
- virtual void bindBuffer(blink::WGC3Denum target,
- blink::WebGLId buffer) OVERRIDE;
- virtual void bufferData(blink::WGC3Denum target,
- blink::WGC3Dsizeiptr size,
+ virtual void bindBuffer(GLenum target, GLuint buffer) OVERRIDE;
+ virtual void bufferData(GLenum target,
+ GLsizeiptr size,
const void* data,
- blink::WGC3Denum usage) OVERRIDE;
- virtual void* mapBufferCHROMIUM(blink::WGC3Denum target,
- blink::WGC3Denum access);
- virtual blink::WGC3Dboolean unmapBufferCHROMIUM(blink::WGC3Denum target);
-
- virtual blink::WGC3Duint createImageCHROMIUM(blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Denum internalformat)
- OVERRIDE;
- virtual void destroyImageCHROMIUM(blink::WGC3Duint image_id) OVERRIDE;
- virtual void getImageParameterivCHROMIUM(blink::WGC3Duint image_id,
- blink::WGC3Denum pname,
- blink::WGC3Dint* params) OVERRIDE;
- virtual void* mapImageCHROMIUM(blink::WGC3Duint image_id,
- blink::WGC3Denum access) OVERRIDE;
- virtual void unmapImageCHROMIUM(blink::WGC3Duint image_id) OVERRIDE;
+ GLenum usage) OVERRIDE;
+ virtual void* mapBufferCHROMIUM(GLenum target,
+ GLenum access);
+ virtual GLboolean unmapBufferCHROMIUM(GLenum target);
+
+ virtual GLuint createImageCHROMIUM(
+ GLsizei width,
+ GLsizei height,
+ GLenum internalformat) OVERRIDE;
+ virtual void destroyImageCHROMIUM(GLuint image_id) OVERRIDE;
+ virtual void getImageParameterivCHROMIUM(
+ GLuint image_id,
+ GLenum pname,
+ GLint* params) OVERRIDE;
+ virtual void* mapImageCHROMIUM(
+ GLuint image_id,
+ GLenum access) OVERRIDE;
+ virtual void unmapImageCHROMIUM(GLuint image_id) OVERRIDE;
virtual void texImageIOSurface2DCHROMIUM(GLenum target,
GLsizei width,
GLsizei height,
@@ -212,7 +206,7 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D {
}
size_t NumTextures() const;
- blink::WebGLId TextureAt(int i) const;
+ GLuint TextureAt(int i) const;
size_t NumUsedTextures() const { return used_textures_.size(); }
bool UsedTexture(int texture) const {
@@ -247,15 +241,15 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D {
void set_max_texture_size(int size) { max_texture_size_ = size; }
- static const blink::WebGLId kExternalTextureId;
- virtual blink::WebGLId NextTextureId();
- virtual void RetireTextureId(blink::WebGLId id);
+ static const GLuint kExternalTextureId;
+ virtual GLuint NextTextureId();
+ virtual void RetireTextureId(GLuint id);
- virtual blink::WebGLId NextBufferId();
- virtual void RetireBufferId(blink::WebGLId id);
+ virtual GLuint NextBufferId();
+ virtual void RetireBufferId(GLuint id);
- virtual blink::WebGLId NextImageId();
- virtual void RetireImageId(blink::WebGLId id);
+ virtual GLuint NextImageId();
+ virtual void RetireImageId(GLuint id);
size_t GetTransferBufferMemoryUsedBytes() const;
void SetMaxTransferBufferUsageBytes(size_t max_transfer_buffer_usage_bytes);
@@ -288,13 +282,13 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D {
TextureTargets();
~TextureTargets();
- void BindTexture(blink::WGC3Denum target, blink::WebGLId id);
- void UnbindTexture(blink::WebGLId id);
+ void BindTexture(GLenum target, GLuint id);
+ void UnbindTexture(GLuint id);
- blink::WebGLId BoundTexture(blink::WGC3Denum target);
+ GLuint BoundTexture(GLenum target);
private:
- typedef base::hash_map<blink::WGC3Denum, blink::WebGLId> TargetTextureMap;
+ typedef base::hash_map<GLenum, GLuint> TargetTextureMap;
TargetTextureMap bound_textures_;
};
@@ -302,7 +296,7 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D {
Buffer();
~Buffer();
- blink::WGC3Denum target;
+ GLenum target;
scoped_ptr<uint8[]> pixels;
size_t size;
@@ -341,9 +335,9 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D {
TestWebGraphicsContext3D();
void CreateNamespace();
- blink::WebGLId BoundTextureId(blink::WGC3Denum target);
- scoped_refptr<TestTexture> BoundTexture(blink::WGC3Denum target);
- void CheckTextureIsBound(blink::WGC3Denum target);
+ GLuint BoundTextureId(GLenum target);
+ scoped_refptr<TestTexture> BoundTexture(GLenum target);
+ void CheckTextureIsBound(GLenum target);
unsigned context_id_;
ContextProvider::Capabilities test_capabilities_;
diff --git a/cc/test/test_web_graphics_context_3d_unittest.cc b/cc/test/test_web_graphics_context_3d_unittest.cc
index aa5ccf3..107f15c 100644
--- a/cc/test/test_web_graphics_context_3d_unittest.cc
+++ b/cc/test/test_web_graphics_context_3d_unittest.cc
@@ -13,9 +13,9 @@ namespace cc {
namespace {
static bool check_parameter_value(TestWebGraphicsContext3D* context,
- blink::WGC3Denum pname,
- blink::WGC3Dint expected_value) {
- blink::WGC3Dint actual_value = 0;
+ GLenum pname,
+ GLint expected_value) {
+ GLint actual_value = 0;
context->getTexParameteriv(GL_TEXTURE_2D, pname, &actual_value);
return expected_value == actual_value;
}
@@ -35,7 +35,7 @@ TEST(TestWebGraphicsContext3DTest, GetDefaultTextureParameterValues) {
scoped_ptr<TestWebGraphicsContext3D> context(
TestWebGraphicsContext3D::Create());
- blink::WebGLId texture = context->createTexture();
+ GLuint texture = context->createTexture();
context->bindTexture(GL_TEXTURE_2D, texture);
expect_default_parameter_values(context.get());
@@ -45,7 +45,7 @@ TEST(TestWebGraphicsContext3DTest, SetAndGetTextureParameter) {
scoped_ptr<TestWebGraphicsContext3D> context(
TestWebGraphicsContext3D::Create());
- blink::WebGLId texture = context->createTexture();
+ GLuint texture = context->createTexture();
context->bindTexture(GL_TEXTURE_2D, texture);
context->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
@@ -59,7 +59,7 @@ TEST(TestWebGraphicsContext3DTest,
TestWebGraphicsContext3D::Create());
// Set and get non-default texture parameters on the first texture.
- blink::WebGLId first_texture = context->createTexture();
+ GLuint first_texture = context->createTexture();
context->bindTexture(GL_TEXTURE_2D, first_texture);
context->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
context->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
@@ -71,7 +71,7 @@ TEST(TestWebGraphicsContext3DTest,
// Set and get different, non-default texture parameters on the second
// texture.
- blink::WebGLId second_texture = context->createTexture();
+ GLuint second_texture = context->createTexture();
context->bindTexture(GL_TEXTURE_2D, second_texture);
context->texParameteri(
GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index ef30642..2694d4c 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -3532,27 +3532,27 @@ class FakeLayerWithQuads : public LayerImpl {
class MockContext : public TestWebGraphicsContext3D {
public:
- MOCK_METHOD1(useProgram, void(blink::WebGLId program));
- MOCK_METHOD5(uniform4f, void(blink::WGC3Dint location,
- blink::WGC3Dfloat x,
- blink::WGC3Dfloat y,
- blink::WGC3Dfloat z,
- blink::WGC3Dfloat w));
- MOCK_METHOD4(uniformMatrix4fv, void(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- blink::WGC3Dboolean transpose,
- const blink::WGC3Dfloat* value));
- MOCK_METHOD4(drawElements, void(blink::WGC3Denum mode,
- blink::WGC3Dsizei count,
- blink::WGC3Denum type,
- blink::WGC3Dintptr offset));
+ MOCK_METHOD1(useProgram, void(GLuint program));
+ MOCK_METHOD5(uniform4f, void(GLint location,
+ GLfloat x,
+ GLfloat y,
+ GLfloat z,
+ GLfloat w));
+ MOCK_METHOD4(uniformMatrix4fv, void(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat* value));
+ MOCK_METHOD4(drawElements, void(GLenum mode,
+ GLsizei count,
+ GLenum type,
+ GLintptr offset));
MOCK_METHOD0(getRequestableExtensionsCHROMIUM, blink::WebString());
- MOCK_METHOD1(enable, void(blink::WGC3Denum cap));
- MOCK_METHOD1(disable, void(blink::WGC3Denum cap));
- MOCK_METHOD4(scissor, void(blink::WGC3Dint x,
- blink::WGC3Dint y,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height));
+ MOCK_METHOD1(enable, void(GLenum cap));
+ MOCK_METHOD1(disable, void(GLenum cap));
+ MOCK_METHOD4(scissor, void(GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height));
};
class MockContextHarness {
@@ -3873,11 +3873,11 @@ TEST_F(LayerTreeHostImplTest, LayersFreeTextures) {
class MockDrawQuadsToFillScreenContext : public TestWebGraphicsContext3D {
public:
- MOCK_METHOD1(useProgram, void(blink::WebGLId program));
- MOCK_METHOD4(drawElements, void(blink::WGC3Denum mode,
- blink::WGC3Dsizei count,
- blink::WGC3Denum type,
- blink::WGC3Dintptr offset));
+ MOCK_METHOD1(useProgram, void(GLuint program));
+ MOCK_METHOD4(drawElements, void(GLenum mode,
+ GLsizei count,
+ GLenum type,
+ GLintptr offset));
};
TEST_F(LayerTreeHostImplTest, HasTransparentBackground) {
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 642180a..ad17438 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -2810,26 +2810,26 @@ class MockIOSurfaceWebGraphicsContext3D : public TestWebGraphicsContext3D {
test_capabilities_.texture_rectangle = true;
}
- virtual blink::WebGLId createTexture() OVERRIDE {
+ virtual GLuint createTexture() OVERRIDE {
return 1;
}
- MOCK_METHOD1(activeTexture, void(blink::WGC3Denum texture));
- MOCK_METHOD2(bindTexture, void(blink::WGC3Denum target,
- blink::WebGLId texture_id));
- MOCK_METHOD3(texParameteri, void(blink::WGC3Denum target,
- blink::WGC3Denum pname,
- blink::WGC3Dint param));
- MOCK_METHOD5(texImageIOSurface2DCHROMIUM, void(blink::WGC3Denum target,
- blink::WGC3Dint width,
- blink::WGC3Dint height,
- blink::WGC3Duint ioSurfaceId,
- blink::WGC3Duint plane));
- MOCK_METHOD4(drawElements, void(blink::WGC3Denum mode,
- blink::WGC3Dsizei count,
- blink::WGC3Denum type,
- blink::WGC3Dintptr offset));
- MOCK_METHOD1(deleteTexture, void(blink::WGC3Denum texture));
+ MOCK_METHOD1(activeTexture, void(GLenum texture));
+ MOCK_METHOD2(bindTexture, void(GLenum target,
+ GLuint texture_id));
+ MOCK_METHOD3(texParameteri, void(GLenum target,
+ GLenum pname,
+ GLint param));
+ MOCK_METHOD5(texImageIOSurface2DCHROMIUM, void(GLenum target,
+ GLint width,
+ GLint height,
+ GLuint ioSurfaceId,
+ GLuint plane));
+ MOCK_METHOD4(drawElements, void(GLenum mode,
+ GLsizei count,
+ GLenum type,
+ GLintptr offset));
+ MOCK_METHOD1(deleteTexture, void(GLenum texture));
};