Closed Bug 357946 Opened 18 years ago Closed 16 years ago

Support for DirectFB

Categories

(Core Graveyard :: GFX: Gtk, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 422221

People

(Reporter: kumarsiddharth, Unassigned)

Details

Attachments

(7 files)

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
Build Identifier: 


Hi

We are working on Mozilla over DirectFB by using the GTK over DirectFB port. We have got a working build on DirectFB. It is able to render web pages with some issues that have been listed below.


Known Issues

1. It may hang or may not render web pages containing combo box.

2. The current release is having problems with color schemes and paint events, so web pages may not be rendered properly in terms of color.

3. Images are drawn properly but the decorations around them are not proper

4. The current release does not have support for Flash plugin


The above-mentioned list is indicative.

Regards,
Siddharth
Team MozDfb,
TATA Elxsi, INDIA


Reproducible: Always
>>Images are drawn properly but the decorations around them are not proper
        The target file may be nsImageGTK.cpp(throws assertions)

>>The current release is having problems with color schemes and paint events,
so web pages may not be rendered properly in terms of color.

    We are getting some assertions related to depth while setting the colormap for a drawable. The problem occurs when mozilla tries to create a pixmap and then set a colormap for it(in GFX module, nsRenderingContextGTK.cpp etc). It says that the depth of drawable is not equal to the depth of colormap.

  Code Snippet:

   1. pixmap = gdk_pixmap_new(NULL,x,y, gdk_rgb_get_visual());
 
   2. gdk_drawable_set_colormap(pixmap, gdk_rgb_get_colormap());

    The problem may be with the port of GTK over DirectFB, but we are not sure. This may be the reason for rendering and color related problems.

Hi,

Attached here is the cvs diff for firefox on DirectFB. We have used Firefox 1.5.0.3 Source Code for this purpose. We have not used any new files except .mozconfig, which is also attached herewith. Various packages and their versions needed to build and run Firefox on DFB have been provided in release notes(attached).

Regards,
Siddharth
Component: General → GFX: Gtk
Product: Firefox → Core
QA Contact: general → gtk
Version: unspecified → Trunk
mozconfig options to build firefox on DFB:

#
# See http://www.mozilla.org/build/ for build instructions.
#

# Options for client.mk.
mk_add_options MOZ_CO_PROJECT=browser

# Options for 'configure' (same as command-line options).
ac_add_options --enable-application=browser
ac_add_options --enable-default-toolkit=gtk2
ac_add_options --disable-pedantic
ac_add_options --prefix=$PREFIX
ac_add_options --enable-debug
ac_add_options --without-x
ac_add_options --disable-gtktest
ac_add_options --disable-tests
ac_add_options --disable-plugins
ac_add_options --enable-pango
ac_add_options --disable-xft
ac_add_options --disable-xinerama
ac_add_options --includedir=$LD_LIBRARY_PATH/../include


Regards,
Siddharth
Should the // TEL comments indicate that code was changed there? Do not attach the changes to configure, only attach the changes in configure.in. Also I wonder how/if this should be merged with the development tree (aka CVS HEAD) since in the next Gecko and/or FF version cairo-gtk2 will probably be used as GFX back end.
(In reply to comment #5)
> Should the // TEL comments indicate that code was changed there? Do not attach
> the changes to configure, only attach the changes in configure.in. Also I
> wonder how/if this should be merged with the development tree (aka CVS HEAD)
> since in the next Gecko and/or FF version cairo-gtk2 will probably be used as
> GFX back end.


We'll be attaching the clean patch shortly.

Regards,
Siddharth
Status: UNCONFIRMED → NEW
Ever confirmed: true
This patch release includes spatial navigation support along with libfad flash plugin support. Release notes contain detailed information. Flash content is rendered in seperate window (somehow window id is becoming 0, may be due to commenting in nsWindow.cpp). --enable-directfb option has been added in configuration script.

mk_add_options MOZ_CO_PROJECT=browser

# Options for 'configure' (same as command-line options).
ac_add_options --enable-application=browser
ac_add_options --enable-default-toolkit=gtk2
ac_add_options --disable-pedantic
ac_add_options --prefix=$PREFIX
ac_add_options --enable-debug
ac_add_options --without-x
ac_add_options --disable-gtktest
ac_add_options --disable-tests
#ac_add_options --disable-plugins
ac_add_options --enable-pango
ac_add_options --disable-xft
ac_add_options --enable-extensions=default,spatialnavigation
ac_add_options --disable-xinerama
ac_add_options --enable-directfb


Regards,
Siddharth
(In reply to comment #8)
> Created an attachment (id=243658) [edit]
> Firefox 1.5.0.3 on DirectFB Release Notes (updated)

//TEL means either the code was commented or changed.
In the previous release, FireFox could build properly on DirectFB but there were few build issues on X. So we made necessary changes to make FireFox build on both DirectFB and X.

Thanks,
Karunakaran A.
Hi,

This patch for Firefox on DFB includes these major enhancements:
	Web pages are rendered properly in  terms of color. 
	Combo box crash is fixed. 
	Flash plugin is also playing in the same DFB screen without hanging the system (though it is rendered in a separate window)

We had to do modifications in GTKDFB port, the patch for which is attached herewith.

Regards,
Siddharth
Hi,

This is the GTKDFB port patch(ver 2.10.1) for Mozilla over DFB. For detailed version information please refer to the previous comments and release notes.

Regards,
Siddharth
Hi ,
  I have compressed it by https://bugzilla.mozilla.org/attachment.cgi?id=243658  .
gtk-demo can be run ,and firefox can be run ,but firefox can not be auto-refresh(i can refresh it by mouse :) )
and I am compress gtk examples  ,it can be run OK.so i think the firefox may be have some problem.

  Regards,
  Juix
(In reply to comment #13)
> Hi ,
>   I have compressed it by https://bugzilla.mozilla.org/attachment.cgi?id=243658
>  .
> gtk-demo can be run ,and firefox can be run ,but firefox can not be
> auto-refresh(i can refresh it by mouse :) )
> and I am compress gtk examples  ,it can be run OK.so i think the firefox may be
> have some problem.
> 
>   Regards,
>   Juix

when i comopress the firefox:
./configure --without-x --enable-directfb --enable-application=browser --disable-xft --without-system-nspr --enable-pango --disable-xprint --disable-ldap --disable-composer --disable-mailnews --disable-gtktest --disable-tests --disable-debug --disable-pedantic

make 
make install 

Regards,
It doesn't support rendering transparency gif or png image

for example:

http://www.frybread-hut.com/christmas/card.htm

http://en.wikipedia.org/wiki/Png
(In reply to comment #15)
> It doesn't support rendering transparency gif or png image
> for example:
> http://www.frybread-hut.com/christmas/card.htm
> http://en.wikipedia.org/wiki/Png


Yes, the current release is having problem in rendering transparent images. We are working on it. Any suggestions from open source will be quite helpful for us.

Regards,
Siddharth
To solve the problem when rendering transparent images, just replace all 'image->windowing_data' with 'image->mem' in nsImageGTK.cpp.
(In reply to comment #17)
> To solve the problem when rendering transparent images, just replace all
> 'image->windowing_data' with 'image->mem' in nsImageGTK.cpp.

It only works when rendering PNG images, For GIF images, 

modify function gdk_directfb_draw_drawable in gdkdrawable-directfb.c of GTK as the following:

static void 
gdk_directfb_draw_drawable (GdkDrawable *drawable, 
                            GdkGC       *gc, 
                            GdkDrawable *src, 
                            gint         xsrc, 
                            gint         ysrc, 
                            gint         xdest, 
                            gint         ydest, 
                            gint         width, 
                            gint         height) 
{ 
  GdkDrawableImplDirectFB *impl; 
  GdkDrawableImplDirectFB *src_impl; 
  GdkRegion               *clip; 
  GdkRectangle             dest_rect = { xdest, 
                                         ydest, 
                                         xdest + width, 
                                         ydest + height }; 
  GdkGCValues values = {0}; 
  gdk_gc_get_values(gc, &values); 

  DFBRectangle rect = { xsrc, ysrc, width, height }; 
  gint i; 

  impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable); 

  if (!impl->surface) 
    return; 

  if (GDK_IS_PIXMAP (src)) 
    src_impl = GDK_DRAWABLE_IMPL_DIRECTFB (GDK_PIXMAP_OBJECT (src)->impl); 
  else if (GDK_IS_WINDOW (src)) 
    src_impl = GDK_DRAWABLE_IMPL_DIRECTFB (GDK_WINDOW_OBJECT (src)->impl); 
  else if (GDK_IS_DRAWABLE_IMPL_DIRECTFB (src)) 
    src_impl = GDK_DRAWABLE_IMPL_DIRECTFB (src); 
  else 
    return; 

  clip = gdk_directfb_clip_region (drawable, gc, &dest_rect); 

  for (i = 0; i < clip->numRects; i++) 
  { 
      DFBRegion reg = { clip->rects[i].x1,     clip->rects[i].y1, 
                        clip->rects[i].x2 - 1, clip->rects[i].y2 - 1 }; 

      impl->surface->SetClip (impl->surface, &reg); 

      if(values.clip_mask != NULL) 
      {
        impl->surface->SetBlittingFlags(impl->surface, DSBLIT_SRC_COLORKEY); 
        impl->surface->SetSrcColorKey(impl->surface, 0, 0, 0);         
      } 
      
      impl->surface->Blit (impl->surface, src_impl->surface, &rect, 
                           xdest, ydest); 
  } 
  impl->surface->SetClip (impl->surface, NULL); 

  gdk_directfb_update_region (impl, clip); 
  gdk_region_destroy (clip); 
}

Regards,

Rock

Thanks Rock!

Does anyone know how to solve the [visually] similar problem with text (showing up as black squares) when using newer versions of GTK?  The version of GTK recommended for MozDFB has been marked as having a broken directfb backend and not to be used.

The transparency changes worked pretty good, however, if I use 24 bit PNG with alpha blended transparency, I have a huge leak (1-4 MB) in the DHTML/JavaScript UI that I have implemented.  8 bit PNG and GIF files work fine (with or without 100% transparency).  Has this been seen by anyone else?  Any ideas on where to look?
Can you reproduce the leak in trunk Firefox?

You might be able to use tracemalloc to help. Or Valgrind.
The implementation is on an AMD Alchemy Au1200 MIPS32 processor (SOC).  I don't see the leak on the standard 1.5.0.3 or 1.5.0.12 firefox trunk on an X86 PC.  Haven't tried rebuilding my config on a linux x86 build.  Valgrind is not ported to MIPS32.  I haven't tried tracemalloc yet.  I was checking to see if anyone else saw this issue with this Mozilla/Gtk/DFB implementation.  

My build is as follows...
pkg-config-0.21
binutils-2.16.1
glib-2.12.3 (shared)
atk-1.9.0 (shared)
freetype-2.1.10 (static, shared)
libxml2-2.6.23 (static, shared)
fontconfig-2.4.1 (static, shared)
zlib-1.2.3 (static)
libpng-1.2.12 (static, shared)
jpeg-6b (static)
DirectFB-1.1.0 (shared, updated from 1.0)
cairo-1.4.12 (static, shared, updated from 1.2.4)
pango-1.16.4 (static, shared, updated from 1.14.4)
gtk+-2.10.1 (static, shared)
libIDL-0.8.7 (static, shared)
SDL-1.2.11 (static, shared, not used yet)
SDL_gfx-2.0.13 (static, shared, not used yet)

I have also tried DFB 1.1.1 and PNG 1.2.23.  Firefox 1.5.0.12 appeared to break the GIF transparency (garbage in the transparency area), but I might have not reapplied patches correctly.

Should this bug be duped to bug 422221 which is where current activity seems to be happening? Or vice versa?
Yes, bug 422221 has current work here.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.