summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorsievers@chromium.org <sievers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-25 20:32:00 +0000
committersievers@chromium.org <sievers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-25 20:32:00 +0000
commitb63d1bacff5ee0ac2d7ab6821542df298e8113ef (patch)
tree7bfc429f8ca62af0c8617b495ea6551fbecfe2ba /gpu
parent87241ae93d91175e859b67f7ad4af611d2eaa60a (diff)
downloadchromium_src-b63d1bacff5ee0ac2d7ab6821542df298e8113ef.zip
chromium_src-b63d1bacff5ee0ac2d7ab6821542df298e8113ef.tar.gz
chromium_src-b63d1bacff5ee0ac2d7ab6821542df298e8113ef.tar.bz2
gpu: Always use EGL_KHR_fence_sync with mailbox sync
This is the only GLFence implementation that works across contexts and share groups. This codepath is only used by Android WebView. Review URL: https://codereview.chromium.org/342983006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279800 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/service/texture_definition.cc22
-rw-r--r--gpu/command_buffer/service/texture_definition.h7
2 files changed, 12 insertions, 17 deletions
diff --git a/gpu/command_buffer/service/texture_definition.cc b/gpu/command_buffer/service/texture_definition.cc
index d7b99b2..844962a 100644
--- a/gpu/command_buffer/service/texture_definition.cc
+++ b/gpu/command_buffer/service/texture_definition.cc
@@ -4,12 +4,18 @@
#include "gpu/command_buffer/service/texture_definition.h"
+#include <list>
+
+#include "base/memory/linked_ptr.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/synchronization/lock.h"
#include "gpu/command_buffer/service/texture_manager.h"
#include "ui/gl/gl_image.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/scoped_binders.h"
#if !defined(OS_MACOSX)
+#include "ui/gl/gl_fence_egl.h"
#include "ui/gl/gl_surface_egl.h"
#endif
@@ -101,9 +107,7 @@ class NativeImageBufferEGL : public NativeImageBuffer {
static scoped_refptr<NativeImageBufferEGL> Create(GLuint texture_id);
private:
- NativeImageBufferEGL(scoped_ptr<gfx::GLFence> write_fence,
- EGLDisplay display,
- EGLImageKHR image);
+ NativeImageBufferEGL(EGLDisplay display, EGLImageKHR image);
virtual ~NativeImageBufferEGL();
virtual void AddClient(gfx::GLImage* client) OVERRIDE;
virtual void RemoveClient(gfx::GLImage* client) OVERRIDE;
@@ -159,8 +163,7 @@ scoped_refptr<NativeImageBufferEGL> NativeImageBufferEGL::Create(
if (egl_image == EGL_NO_IMAGE_KHR)
return NULL;
- return new NativeImageBufferEGL(
- make_scoped_ptr(gfx::GLFence::Create()), egl_display, egl_image);
+ return new NativeImageBufferEGL(egl_display, egl_image);
}
NativeImageBufferEGL::ClientInfo::ClientInfo(gfx::GLImage* client)
@@ -168,13 +171,12 @@ NativeImageBufferEGL::ClientInfo::ClientInfo(gfx::GLImage* client)
NativeImageBufferEGL::ClientInfo::~ClientInfo() {}
-NativeImageBufferEGL::NativeImageBufferEGL(scoped_ptr<gfx::GLFence> write_fence,
- EGLDisplay display,
+NativeImageBufferEGL::NativeImageBufferEGL(EGLDisplay display,
EGLImageKHR image)
: NativeImageBuffer(),
egl_display_(display),
egl_image_(image),
- write_fence_(write_fence.Pass()),
+ write_fence_(new gfx::GLFenceEGL(true)),
write_client_(NULL) {
DCHECK(egl_display_ != EGL_NO_DISPLAY);
DCHECK(egl_image_ != EGL_NO_IMAGE_KHR);
@@ -262,7 +264,7 @@ void NativeImageBufferEGL::DidRead(gfx::GLImage* client) {
it != client_infos_.end();
it++) {
if (it->client == client) {
- it->read_fence = make_linked_ptr(gfx::GLFence::Create());
+ it->read_fence = make_linked_ptr(new gfx::GLFenceEGL(true));
return;
}
}
@@ -273,7 +275,7 @@ void NativeImageBufferEGL::DidWrite(gfx::GLImage* client) {
base::AutoLock lock(lock_);
// Sharing semantics require the client to flush in order to make changes
// visible to other clients.
- write_fence_.reset(gfx::GLFence::CreateWithoutFlush());
+ write_fence_.reset(new gfx::GLFenceEGL(false));
write_client_ = client;
for (std::list<ClientInfo>::iterator it = client_infos_.begin();
it != client_infos_.end();
diff --git a/gpu/command_buffer/service/texture_definition.h b/gpu/command_buffer/service/texture_definition.h
index 0b4816a..6df4b86 100644
--- a/gpu/command_buffer/service/texture_definition.h
+++ b/gpu/command_buffer/service/texture_definition.h
@@ -5,19 +5,12 @@
#ifndef GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_
#define GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_
-#include <list>
#include <vector>
-#include "base/callback.h"
-#include "base/memory/linked_ptr.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/synchronization/lock.h"
#include "gpu/command_buffer/service/gl_utils.h"
-#include "ui/gl/gl_fence.h"
namespace gfx {
-class GLFence;
class GLImage;
}