summaryrefslogtreecommitdiffstats
path: root/ui/gl
diff options
context:
space:
mode:
authormmocny@chromium.org <mmocny@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-16 15:55:53 +0000
committermmocny@chromium.org <mmocny@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-16 15:55:53 +0000
commit3ac71bf7f18b40dc499b92e5c7cb6424a3f1871f (patch)
tree24c611f227bc08f2efc57e4940089a67233d36e4 /ui/gl
parent518e1798442d6f9a27e7f7af160979e9b436dd66 (diff)
downloadchromium_src-3ac71bf7f18b40dc499b92e5c7cb6424a3f1871f.zip
chromium_src-3ac71bf7f18b40dc499b92e5c7cb6424a3f1871f.tar.gz
chromium_src-3ac71bf7f18b40dc499b92e5c7cb6424a3f1871f.tar.bz2
Decoupling backbuffer allocation suggestion from frontbuffer allocation suggestion.
Frontbuffer drop was hinged onto the discardBackbuffer message. Since only a single discard mess is sent now, and since discarding backbuffer comes first, a message frontbuffer drop was waiting for would never come. This cl just refactors to decouple the two allocations and should be functionally equivalent to current behaviour, except it does not make assumptions about when discard messages should come through. BUG=126542 TEST=Manual Review URL: https://chromiumcodereview.appspot.com/10388010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137432 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gl')
-rw-r--r--ui/gl/gl_surface.cc13
-rw-r--r--ui/gl/gl_surface.h14
2 files changed, 15 insertions, 12 deletions
diff --git a/ui/gl/gl_surface.cc b/ui/gl/gl_surface.cc
index cc6c3b3..b5b2fd7 100644
--- a/ui/gl/gl_surface.cc
+++ b/ui/gl/gl_surface.cc
@@ -101,7 +101,10 @@ bool GLSurface::OnMakeCurrent(GLContext* context) {
return true;
}
-void GLSurface::SetBufferAllocation(BufferAllocationState state) {
+void GLSurface::SetBackbufferAllocation(bool allocated) {
+}
+
+void GLSurface::SetFrontbufferAllocation(bool allocated) {
}
void* GLSurface::GetShareHandle() {
@@ -183,8 +186,12 @@ bool GLSurfaceAdapter::OnMakeCurrent(GLContext* context) {
return surface_->OnMakeCurrent(context);
}
-void GLSurfaceAdapter::SetBufferAllocation(BufferAllocationState state) {
- surface_->SetBufferAllocation(state);
+void GLSurfaceAdapter::SetBackbufferAllocation(bool allocated) {
+ surface_->SetBackbufferAllocation(allocated);
+}
+
+void GLSurfaceAdapter::SetFrontbufferAllocation(bool allocated) {
+ surface_->SetFrontbufferAllocation(allocated);
}
void* GLSurfaceAdapter::GetShareHandle() {
diff --git a/ui/gl/gl_surface.h b/ui/gl/gl_surface.h
index efa4f23..a2483c4 100644
--- a/ui/gl/gl_surface.h
+++ b/ui/gl/gl_surface.h
@@ -71,14 +71,9 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> {
// on error.
virtual bool OnMakeCurrent(GLContext* context);
- // Used for explicit buffer management. Expect buffers to be destroyed only
- // when surface is not visible.
- enum BufferAllocationState {
- BUFFER_ALLOCATION_FRONT_AND_BACK,
- BUFFER_ALLOCATION_FRONT_ONLY,
- BUFFER_ALLOCATION_NONE
- };
- virtual void SetBufferAllocation(BufferAllocationState state);
+ // Used for explicit buffer management.
+ virtual void SetBackbufferAllocation(bool allocated);
+ virtual void SetFrontbufferAllocation(bool allocated);
// Get a handle used to share the surface with another process. Returns null
// if this is not possible.
@@ -135,7 +130,8 @@ class GL_EXPORT GLSurfaceAdapter : public GLSurface {
virtual void* GetHandle() OVERRIDE;
virtual unsigned int GetBackingFrameBufferObject() OVERRIDE;
virtual bool OnMakeCurrent(GLContext* context) OVERRIDE;
- virtual void SetBufferAllocation(BufferAllocationState state) OVERRIDE;
+ virtual void SetBackbufferAllocation(bool allocated) OVERRIDE;
+ virtual void SetFrontbufferAllocation(bool allocated) OVERRIDE;
virtual void* GetShareHandle() OVERRIDE;
virtual void* GetDisplay() OVERRIDE;
virtual void* GetConfig() OVERRIDE;