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

Unified Diff: gpu/command_buffer/service/texture_definition.cc

Issue 1421903006: ui/gl: Move GLImage into gl namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ozone demo Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/texture_definition.cc
diff --git a/gpu/command_buffer/service/texture_definition.cc b/gpu/command_buffer/service/texture_definition.cc
index ad9fe8a9a105bc17d20492acfa2756310a933a3f..c15c029fe9a9a8018bade08f7838b6077a14df1b 100644
--- a/gpu/command_buffer/service/texture_definition.cc
+++ b/gpu/command_buffer/service/texture_definition.cc
@@ -25,7 +25,7 @@ namespace gles2 {
namespace {
-class GLImageSync : public gfx::GLImage {
+class GLImageSync : public gl::GLImage {
public:
explicit GLImageSync(const scoped_refptr<NativeImageBuffer>& buffer,
const gfx::Size& size);
@@ -124,9 +124,9 @@ class NativeImageBufferEGL : public NativeImageBuffer {
private:
NativeImageBufferEGL(EGLDisplay display, EGLImageKHR image);
~NativeImageBufferEGL() override;
- void AddClient(gfx::GLImage* client) override;
- void RemoveClient(gfx::GLImage* client) override;
- bool IsClient(gfx::GLImage* client) override;
+ void AddClient(gl::GLImage* client) override;
+ void RemoveClient(gl::GLImage* client) override;
+ bool IsClient(gl::GLImage* client) override;
void BindToTexture(GLenum target) const override;
const EGLDisplay egl_display_;
@@ -135,14 +135,14 @@ class NativeImageBufferEGL : public NativeImageBuffer {
base::Lock lock_;
struct ClientInfo {
- explicit ClientInfo(gfx::GLImage* client);
+ explicit ClientInfo(gl::GLImage* client);
~ClientInfo();
- gfx::GLImage* client;
+ gl::GLImage* client;
bool needs_wait_before_read;
};
std::list<ClientInfo> client_infos_;
- gfx::GLImage* write_client_;
+ gl::GLImage* write_client_;
DISALLOW_COPY_AND_ASSIGN(NativeImageBufferEGL);
};
@@ -177,7 +177,7 @@ scoped_refptr<NativeImageBufferEGL> NativeImageBufferEGL::Create(
return new NativeImageBufferEGL(egl_display, egl_image);
}
-NativeImageBufferEGL::ClientInfo::ClientInfo(gfx::GLImage* client)
+NativeImageBufferEGL::ClientInfo::ClientInfo(gl::GLImage* client)
: client(client), needs_wait_before_read(true) {}
NativeImageBufferEGL::ClientInfo::~ClientInfo() {}
@@ -198,12 +198,12 @@ NativeImageBufferEGL::~NativeImageBufferEGL() {
eglDestroyImageKHR(egl_display_, egl_image_);
}
-void NativeImageBufferEGL::AddClient(gfx::GLImage* client) {
+void NativeImageBufferEGL::AddClient(gl::GLImage* client) {
base::AutoLock lock(lock_);
client_infos_.push_back(ClientInfo(client));
}
-void NativeImageBufferEGL::RemoveClient(gfx::GLImage* client) {
+void NativeImageBufferEGL::RemoveClient(gl::GLImage* client) {
base::AutoLock lock(lock_);
if (write_client_ == client)
write_client_ = NULL;
@@ -218,7 +218,7 @@ void NativeImageBufferEGL::RemoveClient(gfx::GLImage* client) {
NOTREACHED();
}
-bool NativeImageBufferEGL::IsClient(gfx::GLImage* client) {
+bool NativeImageBufferEGL::IsClient(gl::GLImage* client) {
base::AutoLock lock(lock_);
for (std::list<ClientInfo>::iterator it = client_infos_.begin();
it != client_infos_.end();
@@ -244,9 +244,9 @@ class NativeImageBufferStub : public NativeImageBuffer {
private:
~NativeImageBufferStub() override {}
- void AddClient(gfx::GLImage* client) override {}
- void RemoveClient(gfx::GLImage* client) override {}
- bool IsClient(gfx::GLImage* client) override { return true; }
+ void AddClient(gl::GLImage* client) override {}
+ void RemoveClient(gl::GLImage* client) override {}
+ bool IsClient(gl::GLImage* client) override { return true; }
void BindToTexture(GLenum target) const override {}
DISALLOW_COPY_AND_ASSIGN(NativeImageBufferStub);
@@ -342,10 +342,9 @@ TextureDefinition::TextureDefinition(
const Texture::FaceInfo& first_face = texture->face_infos_[0];
if (image_buffer_.get()) {
- scoped_refptr<gfx::GLImage> gl_image(
- new GLImageSync(image_buffer_,
- gfx::Size(first_face.level_infos[0].width,
- first_face.level_infos[0].height)));
+ scoped_refptr<gl::GLImage> gl_image(new GLImageSync(
+ image_buffer_, gfx::Size(first_face.level_infos[0].width,
+ first_face.level_infos[0].height)));
texture->SetLevelImage(target_, 0, gl_image.get(), Texture::BOUND);
}
@@ -376,7 +375,7 @@ void TextureDefinition::UpdateTextureInternal(Texture* texture) const {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap_t_);
if (image_buffer_.get()) {
- gfx::GLImage* existing_image = texture->GetLevelImage(target_, 0);
+ gl::GLImage* existing_image = texture->GetLevelImage(target_, 0);
// Don't need to re-bind if already bound before.
if (!existing_image || !image_buffer_->IsClient(existing_image)) {
image_buffer_->BindToTexture(target_);

Powered by Google App Engine
This is Rietveld 408576698