summaryrefslogtreecommitdiffstats
path: root/content/common
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-11 20:03:00 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-11 20:03:00 +0000
commit3244314a8ee28b44a0ac4dc38eb07879d02fcb94 (patch)
tree604d881d1b770974aea2249ed3a2556d8acaae7c /content/common
parent38098fc097d400afb68fe581654fe8ea34526c7b (diff)
downloadchromium_src-3244314a8ee28b44a0ac4dc38eb07879d02fcb94.zip
chromium_src-3244314a8ee28b44a0ac4dc38eb07879d02fcb94.tar.gz
chromium_src-3244314a8ee28b44a0ac4dc38eb07879d02fcb94.tar.bz2
get rid of clearing/sync issues with osmesa
We are seeing clearing artifacts using OSMesa since the shared memory buffer is being written to in the Renderer while also being put on screen by the GPU. This makes all Renderer drawing happen in a local buffer which is then blitted to the shared memory buffer. BUG= TEST= Review URL: http://codereview.chromium.org/8139006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104951 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common')
-rw-r--r--content/common/gpu/image_transport_surface_linux.cc22
1 files changed, 5 insertions, 17 deletions
diff --git a/content/common/gpu/image_transport_surface_linux.cc b/content/common/gpu/image_transport_surface_linux.cc
index 3389160..8c01101 100644
--- a/content/common/gpu/image_transport_surface_linux.cc
+++ b/content/common/gpu/image_transport_surface_linux.cc
@@ -132,7 +132,6 @@ class OSMesaImageTransportSurface : public ImageTransportSurface,
virtual bool IsOffscreen() OVERRIDE;
virtual bool SwapBuffers() OVERRIDE;
virtual gfx::Size GetSize() OVERRIDE;
- virtual void* GetHandle() OVERRIDE;
protected:
// ImageTransportSurface implementation:
@@ -475,11 +474,10 @@ void OSMesaImageTransportSurface::OnResize(gfx::Size size) {
if (shared_mem_.get())
ReleaseSurface();
- // Now that the shared memory buffer is gone, we need to change OSMesa to
- // point at something valid, so we'll let it point to the buffer in the super
- // class. This would be really bad since that buffer has a different size,
- // but we don't allow any drawing to take place until we reset the surface
- // back to a new buffer of shared memory.
+ GLSurfaceOSMesa::Resize(size);
+
+ // Now that we resized/reallocated the memory buffer, we need to change
+ // what OSMesa is pointing at to the new buffer.
helper_->MakeCurrent();
size_ = size;
@@ -499,10 +497,6 @@ void OSMesaImageTransportSurface::OnNewSurfaceACK(
shared_mem_.reset(TransportDIB::Map(surface_handle));
DCHECK_NE(shared_mem_.get(), static_cast<void*>(NULL));
- // When we get the shared memory buffer back we can use that for OSMesa to
- // write in, so we give it to OSMesa.
- helper_->MakeCurrent();
-
helper_->SetScheduled(true);
}
@@ -510,6 +504,7 @@ bool OSMesaImageTransportSurface::SwapBuffers() {
DCHECK_NE(shared_mem_.get(), static_cast<void*>(NULL));
// Copy the OSMesa buffer to the shared memory
+ glFinish();
memcpy(shared_mem_->memory(), GetHandle(), size_.GetArea() * 4);
GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params;
@@ -528,13 +523,6 @@ gfx::Size OSMesaImageTransportSurface::GetSize() {
return size_;
}
-void* OSMesaImageTransportSurface::GetHandle() {
- if (shared_mem_.get())
- return shared_mem_->memory();
- else
- return GLSurfaceOSMesa::GetHandle();
-}
-
} // namespace
// static