summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cc/layers/io_surface_layer_impl.cc22
-rw-r--r--cc/layers/texture_layer.cc1
-rw-r--r--cc/layers/texture_layer.h2
-rw-r--r--cc/layers/texture_layer_client.h2
-rw-r--r--cc/test/test_gles2_interface.cc9
-rw-r--r--cc/test/test_gles2_interface.h5
6 files changed, 24 insertions, 17 deletions
diff --git a/cc/layers/io_surface_layer_impl.cc b/cc/layers/io_surface_layer_impl.cc
index c4eac66..a70006a 100644
--- a/cc/layers/io_surface_layer_impl.cc
+++ b/cc/layers/io_surface_layer_impl.cc
@@ -11,7 +11,7 @@
#include "cc/quads/io_surface_draw_quad.h"
#include "cc/trees/layer_tree_impl.h"
#include "gpu/GLES2/gl2extchromium.h"
-#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
+#include "gpu/command_buffer/client/gles2_interface.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/khronos/GLES2/gl2ext.h"
@@ -44,7 +44,7 @@ void IOSurfaceLayerImpl::DestroyTexture() {
layer_tree_impl()->output_surface()->context_provider().get();
// TODO(skaslev): Implement this path for software compositing.
if (context_provider)
- context_provider->Context3d()->deleteTexture(io_surface_texture_id_);
+ context_provider->ContextGL()->DeleteTextures(1, &io_surface_texture_id_);
io_surface_texture_id_ = 0;
}
}
@@ -75,25 +75,23 @@ bool IOSurfaceLayerImpl::WillDraw(DrawMode draw_mode,
return false;
}
- blink::WebGraphicsContext3D* context3d = context_provider->Context3d();
+ gpu::gles2::GLES2Interface* gl = context_provider->ContextGL();
// TODO(ernstm): Do this in a way that we can track memory usage.
if (!io_surface_texture_id_) {
- io_surface_texture_id_ = context3d->createTexture();
+ gl->GenTextures(1, &io_surface_texture_id_);
io_surface_resource_id_ =
resource_provider->CreateResourceFromExternalTexture(
GL_TEXTURE_RECTANGLE_ARB,
io_surface_texture_id_);
}
- GLC(context3d,
- context3d->bindTexture(GL_TEXTURE_RECTANGLE_ARB,
- io_surface_texture_id_));
- context3d->texImageIOSurface2DCHROMIUM(GL_TEXTURE_RECTANGLE_ARB,
- io_surface_size_.width(),
- io_surface_size_.height(),
- io_surface_id_,
- 0);
+ GLC(gl, gl->BindTexture(GL_TEXTURE_RECTANGLE_ARB, io_surface_texture_id_));
+ gl->TexImageIOSurface2DCHROMIUM(GL_TEXTURE_RECTANGLE_ARB,
+ io_surface_size_.width(),
+ io_surface_size_.height(),
+ io_surface_id_,
+ 0);
// Do not check for error conditions. texImageIOSurface2DCHROMIUM() is
// supposed to hold on to the last good IOSurface if the new one is already
// closed. This is only a possibility during live resizing of plugins.
diff --git a/cc/layers/texture_layer.cc b/cc/layers/texture_layer.cc
index 006f96d..195d05d 100644
--- a/cc/layers/texture_layer.cc
+++ b/cc/layers/texture_layer.cc
@@ -13,7 +13,6 @@
#include "cc/resources/single_release_callback.h"
#include "cc/trees/blocking_task_runner.h"
#include "cc/trees/layer_tree_host.h"
-#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
namespace cc {
diff --git a/cc/layers/texture_layer.h b/cc/layers/texture_layer.h
index f5819a2..5f13772 100644
--- a/cc/layers/texture_layer.h
+++ b/cc/layers/texture_layer.h
@@ -13,8 +13,6 @@
#include "cc/layers/layer.h"
#include "cc/resources/texture_mailbox.h"
-namespace blink { class WebGraphicsContext3D; }
-
namespace cc {
class BlockingTaskRunner;
class SingleReleaseCallback;
diff --git a/cc/layers/texture_layer_client.h b/cc/layers/texture_layer_client.h
index d1200f0..47d6ae0 100644
--- a/cc/layers/texture_layer_client.h
+++ b/cc/layers/texture_layer_client.h
@@ -7,8 +7,6 @@
#include "cc/resources/single_release_callback.h"
-namespace blink { class WebGraphicsContext3D; }
-
namespace cc {
class ResourceUpdateQueue;
class TextureMailbox;
diff --git a/cc/test/test_gles2_interface.cc b/cc/test/test_gles2_interface.cc
index b0ba2b5..ad75280 100644
--- a/cc/test/test_gles2_interface.cc
+++ b/cc/test/test_gles2_interface.cc
@@ -209,6 +209,15 @@ void TestGLES2Interface::TexStorage2DEXT(GLenum target,
test_context_->texStorage2DEXT(target, levels, internalformat, width, height);
}
+void TestGLES2Interface::TexImageIOSurface2DCHROMIUM(GLenum target,
+ GLsizei width,
+ GLsizei height,
+ GLuint io_surface_id,
+ GLuint plane) {
+ test_context_->texImageIOSurface2DCHROMIUM(
+ target, width, height, io_surface_id, plane);
+}
+
void TestGLES2Interface::TexParameteri(GLenum target,
GLenum pname,
GLint param) {
diff --git a/cc/test/test_gles2_interface.h b/cc/test/test_gles2_interface.h
index 81d2ae5..1d3ecce 100644
--- a/cc/test/test_gles2_interface.h
+++ b/cc/test/test_gles2_interface.h
@@ -90,6 +90,11 @@ class TestGLES2Interface : public gpu::gles2::GLES2InterfaceStub {
GLenum internalformat,
GLsizei width,
GLsizei height) OVERRIDE;
+ virtual void TexImageIOSurface2DCHROMIUM(GLenum target,
+ GLsizei width,
+ GLsizei height,
+ GLuint io_surface_id,
+ GLuint plane) OVERRIDE;
virtual void TexParameteri(GLenum target, GLenum pname, GLint param) OVERRIDE;
virtual void AsyncTexImage2DCHROMIUM(GLenum target,