gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, master, updated. 89337dc857cb685ad622


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. 89337dc857cb685ad6222695821cb9fc3ef313f9
Date: Thu, 11 Nov 2010 21:24:21 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  89337dc857cb685ad6222695821cb9fc3ef313f9 (commit)
       via  3aac1c17b6a8fa57d8bc09deb392674227f002ee (commit)
      from  d2399ea06a3d65015d9534e8d0a9ca392483c373 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=89337dc857cb685ad6222695821cb9fc3ef313f9


commit 89337dc857cb685ad6222695821cb9fc3ef313f9
Author: Sandro Santilli <address@hidden>
Date:   Thu Nov 11 22:23:55 2010 +0100

    Add support for -X/-Y to fb gui (works only with --enable-doublebuf)

diff --git a/gui/fb/fb.cpp b/gui/fb/fb.cpp
index 7bf1639..a205be9 100644
--- a/gui/fb/fb.cpp
+++ b/gui/fb/fb.cpp
@@ -154,6 +154,8 @@ FBGui::FBGui(unsigned long xid, float scale, bool loop, 
RunResources& r)
       own_vt(-1),
       fbmem(0),
       buffer(0),                // the real value is set by 
ENABLE_DOUBLE_BUFFERING
+      _xpos(0),
+      _ypos(0),  
       m_rowsize(0),
       _timeout(0)
 {
@@ -412,6 +414,7 @@ FBGui::renderBuffer()
     if ( _drawbounds.size() == 0 ) return; // nothing to do..
 
 #ifdef ENABLE_DOUBLE_BUFFERING
+
     // Size of a pixel in bytes
     // NOTE: +7 to support 15 bpp
     const unsigned int pixel_size = (var_screeninfo.bits_per_pixel+7)/8;
@@ -426,10 +429,12 @@ FBGui::renderBuffer()
         // copy each row
         const int minx = bounds.getMinX();
         const int maxy = bounds.getMaxY();
-    
-        for (int y=bounds.getMinY(); y<=maxy; ++y) {
-            const unsigned int pixel_index = y*m_rowsize + minx*pixel_size;
-            memcpy(&fbmem[pixel_index], &buffer[pixel_index], row_size);
+
+        const int minx1 = minx+_xpos;
+        for (int y=bounds.getMinY(), y1=y+_ypos; y<=maxy; ++y, ++y1) {
+            const unsigned int pix_idx_in = y*m_rowsize + minx*pixel_size;
+            const unsigned int pix_idx_out = y1*m_rowsize + minx1*pixel_size;
+            memcpy(&fbmem[pix_idx_out], &buffer[pix_idx_in], row_size);
         }
     }  
        
@@ -439,8 +444,11 @@ FBGui::renderBuffer()
 
 bool
 FBGui::createWindow(const char* /*title*/, int /*width*/, int /*height*/,
-                     int /*xPosition*/, int /*yPosition*/)
+                     int xPosition, int yPosition)
 {
+    _xpos = clamp<int>(xPosition, 0, var_screeninfo.xres-_width);
+    _ypos = clamp<int>(yPosition, 0, var_screeninfo.yres-_height);
+
     // Now initialize AGG
     return initialize_renderer();
 }
@@ -498,21 +506,6 @@ FBGui::showMouse(bool /*show*/)
     return true;
 }
 
-int
-FBGui::valid_x(int x) {
-    if (x < 0) x = 0;
-    if (x >= _width) x = _width - 1;
-    return x;
-}
-
-int
-FBGui::valid_y(int y)
-{
-    if (y < 0) y = 0;
-    if (y >= _height) y = _height - 1;
-    return y;
-}
-
 void
 FBGui::setInvalidatedRegions(const InvalidatedRanges& ranges)
 {
diff --git a/gui/fb/fbsup.h b/gui/fb/fbsup.h
index 4552d42..ed3ff67 100644
--- a/gui/fb/fbsup.h
+++ b/gui/fb/fbsup.h
@@ -99,6 +99,12 @@ private:
     unsigned char *buffer; // offscreen buffer
     
     std::vector< geometry::Range2d<int> > _drawbounds;
+
+    // X position of the output window
+    int _xpos;
+
+    // Y position of the output window
+    int _ypos;
     
     unsigned m_rowsize;
     
@@ -127,9 +133,6 @@ private:
     /// reverts disable_terminal() changes
     bool enable_terminal();
     
-    int valid_x(int x);
-    int valid_y(int y);
-    
 public:
     FBGui(unsigned long xid, float scale, bool loop, RunResources& r);
     virtual ~FBGui();

http://git.savannah.gnu.org/cgit//commit/?id=3aac1c17b6a8fa57d8bc09deb392674227f002ee


commit 3aac1c17b6a8fa57d8bc09deb392674227f002ee
Author: Sandro Santilli <address@hidden>
Date:   Thu Nov 11 22:02:01 2010 +0100

    drop obsoleted question

diff --git a/gui/gui.h b/gui/gui.h
index adbabaa..9afc5f8 100644
--- a/gui/gui.h
+++ b/gui/gui.h
@@ -479,7 +479,6 @@ protected:
     /// The X Window ID to attach to. If zero, we create a new window.
     unsigned long   _xid;
 
-    // should it be unsigned ints ? (probably!)
     // This would be 0,0,_width,_height, so maybe
     // we should not duplicate the info with those
     // explicit values too..

-----------------------------------------------------------------------

Summary of changes:
 gui/fb/fb.cpp  |   33 +++++++++++++--------------------
 gui/fb/fbsup.h |    9 ++++++---
 gui/gui.h      |    1 -
 3 files changed, 19 insertions(+), 24 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]