[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog gui/gtk_glue_agg.cpp gui/gtk.cp...
From: |
Hannes Mayr |
Subject: |
[Gnash-commit] gnash ChangeLog gui/gtk_glue_agg.cpp gui/gtk.cp... |
Date: |
Mon, 16 Oct 2006 14:36:22 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Hannes Mayr <bik> 06/10/16 14:36:22
Modified files:
. : ChangeLog
gui : gtk_glue_agg.cpp gtk.cpp gtksup.h
Log message:
Added regions support to the GTK-AGG GUI.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1238&r2=1.1239
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gtk_glue_agg.cpp?cvsroot=gnash&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gtk.cpp?cvsroot=gnash&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gtksup.h?cvsroot=gnash&r1=1.21&r2=1.22
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1238
retrieving revision 1.1239
diff -u -b -r1.1238 -r1.1239
--- ChangeLog 16 Oct 2006 14:33:38 -0000 1.1238
+++ ChangeLog 16 Oct 2006 14:36:22 -0000 1.1239
@@ -1,3 +1,7 @@
+2006-10-16 Hannes Mayr <address@hidden>
+ * gui/gtk_glue_agg.cpp, gui/gtk.cpp, gui/gtksup.h: Added regions support
+ to the GTK-AGG GUI.
+
2006-10-16 Tomas Groth Christensen <address@hidden>
* doc/C/internals.xml: Updated the docs about the SDL soundhandler
Index: gui/gtk_glue_agg.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gtk_glue_agg.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- gui/gtk_glue_agg.cpp 16 Oct 2006 10:01:05 -0000 1.4
+++ gui/gtk_glue_agg.cpp 16 Oct 2006 14:36:22 -0000 1.5
@@ -35,7 +35,7 @@
//
//
-/* $Id: gtk_glue_agg.cpp,v 1.4 2006/10/16 10:01:05 bik Exp $ */
+/* $Id: gtk_glue_agg.cpp,v 1.5 2006/10/16 14:36:22 bik Exp $ */
#include <cstdio>
#include <cerrno>
@@ -140,8 +140,11 @@
);
return;
}
+
log_msg("GTK-AGG: %i bytes offscreen buffer allocated\n",
new_bufsize);
+
_offscreenbuf_size = new_bufsize;
+ memset(_offscreenbuf, 0, new_bufsize);
}
_width = width;
@@ -156,6 +159,11 @@
_width,
_height
);
+
+ // Note: At this point the buffer is empty and would show a black
screen.
+ // We have to tell the renderer to render the entire frame and not just
the
+ // invalidated region. As soon as the renderer supports that we can
implement
+ // it here.
}
void
@@ -169,39 +177,27 @@
0,
_width,
_height,
- GDK_RGB_DITHER_MAX,
+ GDK_RGB_DITHER_NONE,
_offscreenbuf,
(int)(_width*_bpp/8)
);
}
void
-GtkAggGlue::render(int /*minx*/, int /*miny*/, int /*maxx*/, int /*maxy*/)
+GtkAggGlue::render(int minx, int miny, int maxx, int maxy)
{
- render();
-
- /*
- Regions don't work yet.
-
- log_msg("Gtk-AGG: render invalidated_region: x:%i, y:%i, w:%i, h:%i\n",
\
- minx, \
- miny, \
- maxx-minx, \
- maxy-miny \
- );
-
+ // Update only the invalidated rectangle
gdk_draw_rgb_image (
_drawing_area->window,
_drawing_area->style->fg_gc[GTK_STATE_NORMAL],
- 0,
+ minx,
miny,
- _width,
+ maxx-minx,
maxy-miny,
- GDK_RGB_DITHER_MAX,
- _offscreenbuf + miny*(_width*_bpp/8),
- (int)(_width*_bpp/8)
+ GDK_RGB_DITHER_NONE,
+ _offscreenbuf + miny*(_width*(_bpp/8)) + minx*(_bpp/8),
+ (int)((_width)*_bpp/8)
);
- */
}
void
Index: gui/gtk.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gtk.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- gui/gtk.cpp 13 Oct 2006 16:38:55 -0000 1.33
+++ gui/gtk.cpp 16 Oct 2006 14:36:22 -0000 1.34
@@ -229,23 +229,12 @@
return coord;
}
-// for some reason this doesn't work as expected yet. Still working on it.
-#if 0
void
GtkGui::set_invalidated_region(const rect& bounds)
{
-#ifdef RENDERER_AGG
// forward to renderer
_renderer->set_invalidated_region(bounds);
- log_msg("GtkGui::set_invalidated_region: x1:%0.2f, y1:%0.2f, x2:%0.2f,
y2:%0.2f\n", \
- bounds.m_x_min, \
- bounds.m_y_min, \
- bounds.m_x_max, \
- bounds.m_y_max \
- );
-
-
if (bounds.m_x_max - bounds.m_x_min > 1e10f) {
// Region is entire screen. Don't convert to integer as this will overflow.
@@ -265,10 +254,18 @@
m_draw_miny = valid_coord(m_draw_miny-2, _height);
m_draw_maxx = valid_coord(m_draw_maxx+2, _width);
m_draw_maxy = valid_coord(m_draw_maxy+2, _height);
+
}
-#endif
+
+ /*
+ log_msg("GtkGui::set_invalidated_region pixel: x1:%i, y1:%i, x2:%i,
y2:%i\n", \
+ m_draw_minx,
+ m_draw_miny, \
+ m_draw_maxx, \
+ m_draw_maxy \
+ );
+ */
}
-#endif
void
GtkGui::setTimeout(unsigned int timeout)
@@ -515,13 +512,15 @@
// TODO: implement and use set_invalidated_region instead?
//gui->renderBuffer();
- // Set a invalidate region that contains the whole screen
+ // Set an invalidate region that contains the entire screen for sure
rect draw_bounds;
draw_bounds.m_x_min = -1e10f;
draw_bounds.m_y_min = -1e10f;
draw_bounds.m_x_max = +1e10f;
draw_bounds.m_y_max = +1e10f;
- //gui->set_invalidated_region(draw_bounds);
+
+ gui->set_invalidated_region(draw_bounds);
+
gui->renderBuffer();
return TRUE;
Index: gui/gtksup.h
===================================================================
RCS file: /sources/gnash/gnash/gui/gtksup.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- gui/gtksup.h 13 Oct 2006 16:38:55 -0000 1.21
+++ gui/gtksup.h 16 Oct 2006 14:36:22 -0000 1.22
@@ -133,7 +133,7 @@
GdkPixbuf* create_pixbuf(const gchar *filename);
- //void set_invalidated_region(const rect& bounds);
+ void set_invalidated_region(const rect& bounds);
private:
GtkWidget *_window;
- [Gnash-commit] gnash ChangeLog gui/gtk_glue_agg.cpp gui/gtk.cp...,
Hannes Mayr <=