After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 619468 - DirectFB backend fixes
DirectFB backend fixes
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: [obsolete] Backend: directfb
2.90.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
Michael Emmel
: 628083 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-05-23 23:32 UTC by Lionel Landwerlin
Modified: 2010-10-15 10:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GTK+ 2.22 directfb patchs (59.22 KB, application/x-gzip)
2010-08-30 23:05 UTC, Lionel Landwerlin
Details
black screen (33.53 KB, image/x-png)
2010-10-14 23:32 UTC, JesseStone
Details

Description Lionel Landwerlin 2010-05-23 23:32:02 UTC
So I'm opening another bug on the directfb backend, because this one does not match one of the others already opened... In fact, it matches several others...

I've been trying to fix the directfb backend for my own use the last few weeks and rebased my work on the last master commit. And here is the result :

http://git.potipota.net/cgi-bin/cgit.cgi/gtk+/log/?h=directfb-fixes
It's of course clonable from git://git.potipota.net/gtk+ (might be a little slow).

Several bugs remains, mostly on the scrolling, probably a few others on window resize, and also on the dragging events.

I'm looking for any comment/review/help. For example, I spend a few days on the scrolling bug and didn't find/understand how to fix it, any idea is welcome.

Hoping the directfb backend will work again soon ;)
Thanks for your help !
Comment 1 Matthias Clasen 2010-08-25 02:36:01 UTC
The directfb backend has been removed form GTK 3
Comment 2 Sven Neumann 2010-08-25 20:24:42 UTC
Reopening...

Lionel, can you rebase your patch-set so that it applies cleanly on top of gtk-2-90 and gtk-2-22 branches? Then I can commit them. We should also try to get commit access for you so that you can work on the DirectFB backend more easily.

If the backend can be made to work cleanly in the branches mentioned, then we can still propose to add it back for GTK+ 3.0.
Comment 3 Matthias Clasen 2010-08-25 20:36:24 UTC
not without a clear maintainer
Comment 4 Sven Neumann 2010-08-25 20:50:26 UTC
That's fair enough. I won't have enough time for this, so I am out of this game. But if Lionel or Michael Emmel or anyone else volunteers to maintain the port, then they should also get commit access. Otherwise patches will stay uncommitted until they won't apply any longer, which is what happened over the past few years.
Comment 5 Michael Emmel 2010-08-25 20:55:42 UTC
After this work I worked on the Gtk/Webkit port and went on to write my own webbrowser as a "smaller" project. Needless to say I simply don't have the time.
Comment 6 Lionel Landwerlin 2010-08-25 21:36:19 UTC
I will rebase ASAP, but for remaining problems I need some help.
I could also spend some time on WebKit, once we have something more stable.
Comment 7 Javier Jardón (IRC: jjardon) 2010-08-27 01:13:49 UTC
*** Bug 628083 has been marked as a duplicate of this bug. ***
Comment 8 JesseStone 2010-08-27 01:17:36 UTC
Please RE opening Directfb~~~~~~~~~~~~~Need it 


Here is good DEBUG IDE, please Debug it.

http://www.wretch.cc/blog/fatalfeel/656116
Comment 9 JesseStone 2010-08-27 01:18:37 UTC
If anyone fix it please let me know~~

fatalfeel@hotmail.com
Comment 10 JesseStone 2010-08-27 01:21:28 UTC
I try many version, the Last Gtk Directfb version is 2.17.2 works fine.

Maybe you can refer to it
Comment 11 JesseStone 2010-08-27 01:23:43 UTC
In Ubuntu Frame Buffer mode

I find if mouse out of text window the inside text rect will clear again

maybe you can try this one

(In reply to comment #0)
> So I'm opening another bug on the directfb backend, because this one does not
> match one of the others already opened... In fact, it matches several others...
> I've been trying to fix the directfb backend for my own use the last few weeks
> and rebased my work on the last master commit. And here is the result :
> http://git.potipota.net/cgi-bin/cgit.cgi/gtk+/log/?h=directfb-fixes
> It's of course clonable from git://git.potipota.net/gtk+ (might be a little
> slow).
> Several bugs remains, mostly on the scrolling, probably a few others on window
> resize, and also on the dragging events.
> I'm looking for any comment/review/help. For example, I spend a few days on the
> scrolling bug and didn't find/understand how to fix it, any idea is welcome.
> Hoping the directfb backend will work again soon ;)
> Thanks for your help !
Comment 12 JesseStone 2010-08-27 01:25:28 UTC
GTK+-2.18.5 Directfb important fix
gdkdrawable-directfb.c

cairo_surface_t *
_gdk_windowing_create_cairo_surface (GdkDrawable *drawable,
                                     int width,
                                     int height)
{
  /*GdkDrawableImplDirectFB *impl;
  IDirectFB *dfb;
  cairo_surface_t *ret;

  impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
  dfb = GDK_DISPLAY_DFB (gdk_drawable_get_display (drawable))->directfb;

  ret = cairo_directfb_surface_create (dfb, impl->surface);
  cairo_surface_set_user_data (ret,
                               &gdk_directfb_cairo_key, drawable,
                               gdk_directfb_cairo_surface_destroy);

  return ret;*/

	GdkDrawableImplDirectFB *impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
 
	if (!impl->cairo_surface)
    {
		IDirectFB             *dfb;
		IDirectFBSurface      *surface;
		DFBSurfaceDescription  desc = { .flags = (	DSDESC_WIDTH
													| DSDESC_HEIGHT
													| DSDESC_PIXELFORMAT),
										.width = width,
										.height = height };

		dfb = GDK_DISPLAY_DFB (gdk_drawable_get_display (drawable))->directfb;

		int depth = gdk_drawable_get_depth (drawable);

		switch (depth)
		{
			case 1:  desc.pixelformat = DSPF_A1;    break;
			case 8:  desc.pixelformat = DSPF_A8;    break;
			case 16: desc.pixelformat = DSPF_RGB16; break;
			case 24: desc.pixelformat = DSPF_RGB32; break;
			case 32: desc.pixelformat = DSPF_ARGB;  break;

			default:
			  return NULL;
        }

		if (dfb->CreateSurface (dfb, &desc, &surface) == DFB_OK)
        {
			impl->cairo_surface = cairo_directfb_surface_create (dfb, surface);

			if (impl->cairo_surface)
			{
				cairo_surface_set_user_data(impl->cairo_surface,
											&gdk_directfb_cairo_key, drawable,
											gdk_directfb_cairo_surface_destroy);
			}
			else
            {
              surface->Release (surface);
              return NULL;
            }
          
			impl->surface = surface;
        }
		else
			return NULL;
    }
	else
		cairo_surface_reference (impl->cairo_surface);
 
	return impl->cairo_surface;
}

static cairo_surface_t *
gdk_directfb_ref_cairo_surface (GdkDrawable *drawable)
{
  /*GdkDrawableImplDirectFB *impl;
  IDirectFB               *dfb;
  
  g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
  g_return_val_if_fail (GDK_IS_DRAWABLE_IMPL_DIRECTFB (drawable), NULL);

  impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
  dfb = GDK_DISPLAY_DFB(gdk_drawable_get_display(drawable))->directfb;
  
  if (!impl->cairo_surface) {
    IDirectFBSurface *surface;
    g_assert (impl->surface != NULL);
#if defined(CAIRO_VERSION_CODE) && CAIRO_VERSION_CODE >= CAIRO_VERSION_ENCODE(1,5,5)
    impl->surface->GetSubSurface (impl->surface, NULL, &surface);
#else
    surface = impl->surface;
#endif
    if (surface) {
      impl->cairo_surface = cairo_directfb_surface_create (dfb, surface);
      if (impl->cairo_surface) {
        cairo_surface_set_user_data (impl->cairo_surface, 
                                     &gdk_directfb_cairo_key, drawable, 
                                     gdk_directfb_cairo_surface_destroy);
      }
#if defined(CAIRO_VERSION_CODE) && CAIRO_VERSION_CODE >= CAIRO_VERSION_ENCODE(1,5,5)
      surface->Release (surface);
#endif
    }
  } else {
    cairo_surface_reference (impl->cairo_surface);
  }
  
  g_assert (impl->cairo_surface != NULL);
  return impl->cairo_surface;*/

	GdkDrawableImplDirectFB *impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
 
	if (GDK_IS_WINDOW_IMPL_DIRECTFB (drawable) && GDK_WINDOW_DESTROYED (impl->wrapper))
		return NULL;

	if (!impl->cairo_surface)
    {
		int width, height;
   
		gdk_drawable_get_size (drawable, &width, &height);

		impl->cairo_surface = _gdk_windowing_create_cairo_surface (drawable, width, height);

		if (impl->cairo_surface)
		{
			cairo_surface_set_user_data(impl->cairo_surface, 
				                        &gdk_directfb_cairo_key, drawable, 
					                    gdk_directfb_cairo_surface_destroy);
		}
	}
	else
		cairo_surface_reference (impl->cairo_surface);

	return impl->cairo_surface;
}



gdkwindow-directfb.c

void
_gdk_windowing_window_init (void)
{
  GdkWindowObject       *private;
  GdkWindowImplDirectFB *impl;
  DFBDisplayLayerConfig  dlc;

  g_assert (_gdk_parent_root == NULL);

  _gdk_display->layer->GetConfiguration (_gdk_display->layer, &dlc);

  _gdk_parent_root = g_object_new (GDK_TYPE_WINDOW, NULL);

  private = GDK_WINDOW_OBJECT (_gdk_parent_root);
  private->impl = g_object_new (_gdk_window_impl_get_type (), NULL);
  
  private->impl_window = private;

  impl = GDK_WINDOW_IMPL_DIRECTFB (private->impl);

  private->window_type = GDK_WINDOW_ROOT;
  private->state       = 0;
  private->children    = NULL;
  private->viewable = TRUE;
//  impl->drawable.paint_region   = NULL;
  impl->gdkWindow      = _gdk_parent_root;
  impl->window           = NULL;
  impl->drawable.abs_x   = 0;
  impl->drawable.abs_y   = 0;
  impl->drawable.width   = dlc.width;
  impl->drawable.height  = dlc.height;
  impl->drawable.wrapper = GDK_DRAWABLE (private);
  /* custom root window init */
  {
    DFBWindowDescription   desc;
    desc.flags = 0;
	/*XXX I must do this now its a bug  ALPHA ROOT*/

    desc.flags = DWDESC_CAPS;
    desc.caps = 0;
    desc.caps  |= DWCAPS_NODECORATION;
    desc.caps  |= DWCAPS_ALPHACHANNEL;
    desc.flags |= ( DWDESC_WIDTH | DWDESC_HEIGHT |
                      DWDESC_POSX  | DWDESC_POSY );
    desc.posx   = 0;
    desc.posy   = 0;
    desc.width  = dlc.width;
    desc.height = dlc.height;
    create_directfb_window (impl,&desc,0);
	g_assert(impl->window != NULL);
    g_assert(impl->drawable.surface != NULL );
  }
  impl->drawable.surface->GetPixelFormat(impl->drawable.surface,&impl->drawable.format);
  private->depth = DFB_BITS_PER_PIXEL(impl->drawable.format);
  
  _gdk_window_update_size (_gdk_parent_root);
  /*
	Now we can set up the system colormap
  */
  gdk_drawable_set_colormap (GDK_DRAWABLE (_gdk_parent_root),gdk_colormap_get_system());
}
Comment 13 Lionel Landwerlin 2010-08-29 11:44:55 UTC
Here is the update for GTK+ 2.22 :

http://git.potipota.net/cgi-bin/cgit.cgi/gtk+/log/?h=gtk-2-22-directfb

The GTK+ 2.90/3.0 version will come later, I have to reverse the removal of the directfb backend.

JesseStone: I would prefer a proper patch rather than copy/paste and a little bit of explanation.
Comment 14 JesseStone 2010-08-29 21:59:05 UTC
Would you stay your msn or skype or email to me

mine  msn & email = fatalfeel@hotmail.com


(In reply to comment #0)
> So I'm opening another bug on the directfb backend, because this one does not
> match one of the others already opened... In fact, it matches several others...
> I've been trying to fix the directfb backend for my own use the last few weeks
> and rebased my work on the last master commit. And here is the result :
> http://git.potipota.net/cgi-bin/cgit.cgi/gtk+/log/?h=directfb-fixes
> It's of course clonable from git://git.potipota.net/gtk+ (might be a little
> slow).
> Several bugs remains, mostly on the scrolling, probably a few others on window
> resize, and also on the dragging events.
> I'm looking for any comment/review/help. For example, I spend a few days on the
> scrolling bug and didn't find/understand how to fix it, any idea is welcome.
> Hoping the directfb backend will work again soon ;)
> Thanks for your help !
Comment 15 André Klapper 2010-08-30 07:39:12 UTC
(Please do not fullquote complete previous comments and please don't answer above the quote. Thanks!)
Comment 16 JesseStone 2010-08-30 14:48:21 UTC
Lionel really do a good job.
just download .gz

and replace gdk\directfb

rebuild , works fine.

But still have question in png image, lack of some pixels~
Comment 17 Sven Neumann 2010-08-30 21:53:36 UTC
Lionel, can you please create a patch-set from your tree (using git format-patch) that I can apply against the gtk-2-22 branch? Thanks.
Comment 18 Lionel Landwerlin 2010-08-30 22:08:07 UTC
Were do you want me to send it ? Right here in bugzilla ?
Comment 19 Sven Neumann 2010-08-30 22:41:02 UTC
You could attach a tarball here or point me to a link where I can download it.
Comment 20 Lionel Landwerlin 2010-08-30 23:05:11 UTC
Created attachment 169134 [details]
GTK+ 2.22 directfb patchs
Comment 21 Lionel Landwerlin 2010-08-30 23:06:21 UTC
Here you go.

http://potipota.net/~djdeath/gtk-directfb-2.22-patchs.tar.gz

There is also the git repository (as mentionned above) :

http://git.potipota.net/cgi-bin/cgit.cgi/gtk+/log/?h=gtk-2-22-directfb
Comment 22 JesseStone 2010-08-31 06:11:50 UTC
If could, please help us debug png problem. here is a debug way~

http://www.wretch.cc/blog/fatalfeel/656116
Comment 23 Lionel Landwerlin 2010-08-31 06:30:10 UTC
JesseStone: If you have a particular issue, please open another bug.
Comment 24 André Klapper 2010-08-31 09:50:17 UTC
JesseStone: Bugzilla is not a forum. Please stop spamming this bug.
Comment 25 Sven Neumann 2010-08-31 19:10:12 UTC
Merged and pushed to gtk-2-22. Closing as FIXED.
Comment 26 JesseStone 2010-10-14 23:32:30 UTC
Created attachment 172395 [details]
black screen
Comment 27 JesseStone 2010-10-14 23:33:48 UTC
why words will be covered by black screen in GTK+ 2.16.x directfb?

Could anyone help me?
Comment 28 André Klapper 2010-10-15 10:13:14 UTC
JesseStone: PLEASE DO READ, for example comment 23 clearly tells you to go somewhere else. If you continue ignoring it I might disable your Bugzilla account, as this is not the only bug report where you show this behaviour.