| Index: components/test_runner/test_plugin.cc
|
| diff --git a/components/test_runner/test_plugin.cc b/components/test_runner/test_plugin.cc
|
| index 08aed025b38b767e5b041dc02e51feec358e48b9..efca2b6a4e0ed3d5d3fabdbe954c8aef6723f61b 100644
|
| --- a/components/test_runner/test_plugin.cc
|
| +++ b/components/test_runner/test_plugin.cc
|
| @@ -40,7 +40,7 @@ namespace test_runner {
|
|
|
| namespace {
|
|
|
| -void PremultiplyAlpha(const unsigned color_in[3],
|
| +void PremultiplyAlpha(const uint8_t color_in[3],
|
| float alpha,
|
| float color_out[4]) {
|
| for (int i = 0; i < 3; ++i)
|
| @@ -337,7 +337,7 @@ TestPlugin::Primitive TestPlugin::ParsePrimitive(
|
|
|
| // FIXME: This method should already exist. Use it.
|
| // For now just parse primary colors.
|
| -void TestPlugin::ParseColor(const blink::WebString& string, unsigned color[3]) {
|
| +void TestPlugin::ParseColor(const blink::WebString& string, uint8_t color[3]) {
|
| color[0] = color[1] = color[2] = 0;
|
| if (string == "black")
|
| return;
|
| @@ -368,8 +368,8 @@ bool TestPlugin::InitScene() {
|
| float color[4];
|
| PremultiplyAlpha(scene_.background_color, scene_.opacity, color);
|
|
|
| - color_texture_ = context_->createTexture();
|
| - framebuffer_ = context_->createFramebuffer();
|
| + gl_->GenTextures(1, &color_texture_);
|
| + gl_->GenFramebuffers(1, &framebuffer_);
|
|
|
| gl_->Viewport(0, 0, rect_.width, rect_.height);
|
| gl_->Disable(GL_DEPTH_TEST);
|
| @@ -426,17 +426,17 @@ void TestPlugin::DestroyScene() {
|
| scene_.program = 0;
|
| }
|
| if (scene_.vbo) {
|
| - context_->deleteBuffer(scene_.vbo);
|
| + gl_->DeleteBuffers(1, &scene_.vbo);
|
| scene_.vbo = 0;
|
| }
|
|
|
| if (framebuffer_) {
|
| - context_->deleteFramebuffer(framebuffer_);
|
| + gl_->DeleteFramebuffers(1, &framebuffer_);
|
| framebuffer_ = 0;
|
| }
|
|
|
| if (color_texture_) {
|
| - context_->deleteTexture(color_texture_);
|
| + gl_->DeleteTextures(1, &color_texture_);
|
| color_texture_ = 0;
|
| }
|
| }
|
| @@ -467,7 +467,7 @@ bool TestPlugin::InitProgram() {
|
| bool TestPlugin::InitPrimitive() {
|
| DCHECK_EQ(scene_.primitive, PrimitiveTriangle);
|
|
|
| - scene_.vbo = context_->createBuffer();
|
| + gl_->GenBuffers(1, &scene_.vbo);
|
| if (!scene_.vbo)
|
| return false;
|
|
|
| @@ -499,8 +499,8 @@ void TestPlugin::DrawPrimitive() {
|
| gl_->DrawArrays(GL_TRIANGLES, 0, 3);
|
| }
|
|
|
| -unsigned TestPlugin::LoadShader(unsigned type, const std::string& source) {
|
| - unsigned shader = gl_->CreateShader(type);
|
| +GLuint TestPlugin::LoadShader(GLenum type, const std::string& source) {
|
| + GLuint shader = gl_->CreateShader(type);
|
| if (shader) {
|
| context_->shaderSource(shader, source.data());
|
| gl_->CompileShader(shader);
|
| @@ -515,11 +515,11 @@ unsigned TestPlugin::LoadShader(unsigned type, const std::string& source) {
|
| return shader;
|
| }
|
|
|
| -unsigned TestPlugin::LoadProgram(const std::string& vertex_source,
|
| - const std::string& fragment_source) {
|
| - unsigned vertex_shader = LoadShader(GL_VERTEX_SHADER, vertex_source);
|
| - unsigned fragment_shader = LoadShader(GL_FRAGMENT_SHADER, fragment_source);
|
| - unsigned program = gl_->CreateProgram();
|
| +GLuint TestPlugin::LoadProgram(const std::string& vertex_source,
|
| + const std::string& fragment_source) {
|
| + GLuint vertex_shader = LoadShader(GL_VERTEX_SHADER, vertex_source);
|
| + GLuint fragment_shader = LoadShader(GL_FRAGMENT_SHADER, fragment_source);
|
| + GLuint program = gl_->CreateProgram();
|
| if (vertex_shader && fragment_shader && program) {
|
| gl_->AttachShader(program, vertex_shader);
|
| gl_->AttachShader(program, fragment_shader);
|
|
|