rpms/gource/F-13 gource-ppm-software-flip.patch, NONE, 1.1 gource.spec, 1.1, 1.2

Siddhesh Poyarekar siddhesh at fedoraproject.org
Sun Feb 28 12:31:10 UTC 2010


Author: siddhesh

Update of /cvs/pkgs/rpms/gource/F-13
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv5852

Modified Files:
	gource.spec 
Added Files:
	gource-ppm-software-flip.patch 
Log Message:
BZ #567559: Flip images in software for PPM output since hardware flipping fails on some video cards


gource-ppm-software-flip.patch:
 ppm.cpp |   33 ++++++++++++++++-----------------
 ppm.h   |    2 ++
 2 files changed, 18 insertions(+), 17 deletions(-)

--- NEW FILE gource-ppm-software-flip.patch ---
commit aac1f0378e293a6e456a7de5e1fe615e581be202
Author: Andrew Caudwell <acaudwell at gmail.com>
Date:   Wed Feb 24 16:23:41 2010 +1300

    PPM output no longer flips the image in hardware, which failed on
    some video cards.

diff --git a/src/ppm.cpp b/src/ppm.cpp
index 82ac334..9f103d9 100644
--- a/src/ppm.cpp
+++ b/src/ppm.cpp
@@ -37,8 +37,9 @@ FrameExporter::FrameExporter() {
 
     rowstride     = display.width * 3;
 
-    pixels1 = new char[display.height * rowstride];
-    pixels2 = new char[display.height * rowstride];
+    pixels1        = new char[display.height * rowstride];
+    pixels2        = new char[display.height * rowstride];
+    pixels_out     = new char[display.height * rowstride];
 
     pixels_shared_ptr = 0;
 
@@ -73,6 +74,7 @@ FrameExporter::~FrameExporter() {
 
     delete[] pixels1;
     delete[] pixels2;
+    delete[] pixels_out;
 }
 
 void FrameExporter::dump() {
@@ -82,12 +84,6 @@ void FrameExporter::dump() {
     glEnable(GL_TEXTURE_2D);
     glDisable(GL_BLEND);
 
-    //render view to texture
-    display.renderToTexture(screentex, display.width, display.height, GL_RGBA);
-
-    //draw view screen flipped
-    display.fullScreenQuad(true);
-
     char* next_pixel_ptr = (pixels_shared_ptr == pixels1) ? pixels2 : pixels1;
 
     // copy pixels - now the right way up
@@ -103,10 +99,6 @@ void FrameExporter::dump() {
 
     SDL_CondSignal(cond);
     SDL_mutexV(mutex);
-
-    // redraw view the right way up for the user
-    display.fullScreenQuad(false);
-
 }
 
 void FrameExporter::dumpThr() {
@@ -119,7 +111,17 @@ void FrameExporter::dumpThr() {
 
         if (dumper_thread_state == FRAME_EXPORTER_EXIT) break;
 
-        dumpImpl();
+        if (pixels_shared_ptr != 0) {
+
+            //invert image
+            for(int y=0;y<display.height;y++) {
+                for(int x=0;x<rowstride;x++) {
+                    pixels_out[x + y * rowstride] = pixels_shared_ptr[x + (display.height - y - 1) * rowstride];
+                }
+            }
+
+            dumpImpl();
+        }
 
         dumper_thread_state = FRAME_EXPORTER_WAIT;
     }
@@ -166,9 +168,6 @@ PPMExporter::~PPMExporter() {
 }
 
 void PPMExporter::dumpImpl() {
-    if(pixels_shared_ptr==0) return;
-
     *output << ppmheader;
-
-    output->write(pixels_shared_ptr, rowstride * display.height);
+    output->write(pixels_out, rowstride * display.height);
 }
diff --git a/src/ppm.h b/src/ppm.h
index 994c661..7564fbd 100644
--- a/src/ppm.h
+++ b/src/ppm.h
@@ -35,6 +35,8 @@ protected:
 
     char* pixels1;
     char* pixels2;
+    char* pixels_out;
+
     char* pixels_shared_ptr;
 
     size_t rowstride;


Index: gource.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gource/F-13/gource.spec,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- gource.spec	18 Feb 2010 06:23:23 -0000	1.1
+++ gource.spec	28 Feb 2010 12:31:10 -0000	1.2
@@ -3,7 +3,7 @@
 Summary: Software version control visualization
 Name: gource
 Version: 0.24
-Release: 1%{?dist}
+Release: 2%{?dist}
 URL: http://gource.googlecode.com/
 Source: http://gource.googlecode.com/files/%{name}-%{version}.tar.gz
 
@@ -24,6 +24,9 @@ BuildRequires: freetype-devel
 
 Requires: gnu-free-sans-fonts
 
+# https://bugzilla.redhat.com/show_bug.cgi?id=567559
+Patch0: gource-ppm-software-flip.patch
+
 %description
 
 OpenGL-based 3D visualisation tool for source control repositories.
@@ -36,6 +39,8 @@ files and directories.
 %setup -q
 sed -i.cp -e 's|cp |cp -p |' Makefile.in
 
+%patch0 -p1 -b .ppm-software-flip
+
 %build
 %configure --enable-ttf-font-dir=%{_datadir}/fonts/gnu-free/
 make %{?_smp_mflags}
@@ -59,6 +64,10 @@ rm -rf %{buildroot}
 %{_datadir}/gource/*
 
 %changelog
+* Sun Feb 28 2010 Siddhesh Poyarekar <spoyarek at redhat.com> - 0.24-2
+- BZ #567559: Flip images in software for PPM output since hardware flipping
+  fails on some video cards
+
 * Thu Feb 18 2010 Siddhesh Poyarekar <spoyarek at redhat.com> - 0.24-1
 - New upstream release
 - Added COPYING, README, THANKS and ChangeLog in docs



More information about the scm-commits mailing list