cairo-1.6.4-directfb-all.patch 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012
  1. diff --git a/.gitignore b/.gitignore
  2. new file mode 100644
  3. index 0000000..99849ce
  4. --- /dev/null
  5. +++ b/.gitignore
  6. @@ -0,0 +1,13 @@
  7. +.deps
  8. +.libs
  9. +*.o
  10. +*.la
  11. +*.lo
  12. +Makefile
  13. +boot
  14. +boot.log
  15. +config.h
  16. +config.log
  17. +config.status
  18. +libtool
  19. +stamp-h1
  20. diff --git a/src/.gitignore b/src/.gitignore
  21. new file mode 100644
  22. index 0000000..17146ae
  23. --- /dev/null
  24. +++ b/src/.gitignore
  25. @@ -0,0 +1,11 @@
  26. +cairo-directfb.pc
  27. +cairo-features.h
  28. +cairo-ft.pc
  29. +cairo-no-features.h
  30. +cairo-pdf.pc
  31. +cairo-png.pc
  32. +cairo-ps.pc
  33. +cairo-svg.pc
  34. +cairo-xlib-xrender.pc
  35. +cairo-xlib.pc
  36. +cairo.pc
  37. diff --git a/src/cairo-directfb-surface.c b/src/cairo-directfb-surface.c
  38. index f20bf2b..57e3980 100644
  39. --- a/src/cairo-directfb-surface.c
  40. +++ b/src/cairo-directfb-surface.c
  41. @@ -34,7 +34,8 @@
  42. * Michael Emmel <mike.emmel@gmail.com>
  43. * Claudio Ciccani <klan@users.sf.net>
  44. */
  45. -
  46. +
  47. +//#define DIRECT_ENABLE_DEBUG
  48. #include "cairoint.h"
  49. #include "cairo-directfb.h"
  50. @@ -42,6 +43,8 @@
  51. #include <stdlib.h>
  52. #include <directfb.h>
  53. +#include <directfb_util.h>
  54. +
  55. #include <direct/types.h>
  56. #include <direct/debug.h>
  57. #include <direct/memcpy.h>
  58. @@ -63,7 +66,7 @@
  59. /*
  60. * CompositeTrapezoids works (without antialiasing).
  61. */
  62. -#define DFB_COMPOSITE_TRAPEZOIDS 0
  63. +#define DFB_COMPOSITE_TRAPEZOIDS 1
  64. /*
  65. * ShowGlyphs works fine.
  66. @@ -71,7 +74,13 @@
  67. #define DFB_SHOW_GLYPHS 1
  68. -D_DEBUG_DOMAIN (Cairo_DirectFB, "Cairo/DirectFB", "Cairo DirectFB backend");
  69. +D_DEBUG_DOMAIN( CairoDFB_Acquire, "CairoDFB/Acquire", "Cairo DirectFB Acquire" );
  70. +D_DEBUG_DOMAIN( CairoDFB_Clip, "CairoDFB/Clip", "Cairo DirectFB Clipping" );
  71. +D_DEBUG_DOMAIN( CairoDFB_Font, "CairoDFB/Font", "Cairo DirectFB Font Rendering" );
  72. +D_DEBUG_DOMAIN( CairoDFB_Glyphs, "CairoDFB/Glyphs", "Cairo DirectFB Font Rendering - Glyphs" );
  73. +D_DEBUG_DOMAIN( CairoDFB_Render, "CairoDFB/Render", "Cairo DirectFB Rendering" );
  74. +D_DEBUG_DOMAIN( CairoDFB_Surface, "CairoDFB/Surface", "Cairo DirectFB Surface" );
  75. +D_DEBUG_DOMAIN( CairoDFB_SurfExt, "CairoDFB/SurfExt", "Cairo DirectFB Surface Extents" );
  76. /*****************************************************************************/
  77. @@ -89,7 +98,7 @@ typedef struct _cairo_directfb_surface {
  78. cairo_surface_t *color;
  79. DFBRegion *clips;
  80. - int n_clips;
  81. + int n_clips; // -1 = don't draw at all
  82. int width;
  83. int height;
  84. @@ -122,7 +131,7 @@ static int _directfb_argb_font = 0;
  85. #define RUN_CLIPPED( surface, clip, func ) {\
  86. - if ((surface)->clips) {\
  87. + if ((surface)->n_clips) {\
  88. int k;\
  89. for (k = 0; k < (surface)->n_clips; k++) {\
  90. if (clip) {\
  91. @@ -155,15 +164,15 @@ static int _directfb_argb_font = 0;
  92. }
  93. #define TRANSFORM_POINT2X( m, x, y, ret_x, ret_y ) {\
  94. - double _x = (x);\
  95. - double _y = (y);\
  96. + float _x = (x);\
  97. + float _y = (y);\
  98. (ret_x) = (_x * (m).xx + (m).x0);\
  99. (ret_y) = (_y * (m).yy + (m).y0);\
  100. }
  101. #define TRANSFORM_POINT3X( m, x, y, ret_x, ret_y ) {\
  102. - double _x = (x);\
  103. - double _y = (y);\
  104. + float _x = (x);\
  105. + float _y = (y);\
  106. (ret_x) = (_x * (m).xx + _y * (m).xy + (m).x0);\
  107. (ret_y) = (_x * (m).yx + _y * (m).yy + (m).y0);\
  108. }
  109. @@ -291,6 +300,7 @@ _directfb_get_operator (cairo_operator_t operator,
  110. dstblend = DSBF_ONE;
  111. break;
  112. default:
  113. + D_DEBUG_AT (CairoDFB_Render, "=> UNSUPPORTED OPERATOR %d\n", operator);
  114. return CAIRO_INT_STATUS_UNSUPPORTED;
  115. }
  116. @@ -312,6 +322,8 @@ _directfb_buffer_surface_create (IDirectFB *dfb,
  117. DFBSurfaceDescription dsc;
  118. DFBResult ret;
  119. + D_DEBUG_AT( CairoDFB_Surface, "%s( %4dx%4d %s )\n", __FUNCTION__, width, height, dfb_pixelformat_name(format) );
  120. +
  121. dsc.flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT;
  122. dsc.width = width;
  123. dsc.height = height;
  124. @@ -339,26 +351,24 @@ _directfb_acquire_surface (cairo_directfb_surface_t *surface,
  125. cairo_format_t cairo_format;
  126. void *data;
  127. int pitch;
  128. -
  129. +
  130. if (surface->format == (cairo_format_t) -1) {
  131. - DFBSurfaceCapabilities caps;
  132. -
  133. if (intrest_rec) {
  134. source_rect.x = intrest_rec->x;
  135. source_rect.y = intrest_rec->y;
  136. source_rect.w = intrest_rec->width;
  137. source_rect.h = intrest_rec->height;
  138. } else {
  139. - source_rect.x = 0;
  140. - source_rect.y = 0;
  141. - surface->dfbsurface->GetSize (surface->dfbsurface,
  142. - &source_rect.w, &source_rect.h);
  143. + /* Use GetVisibleRectangle() here, because GetSize() might return huge values of a sub surface */
  144. + surface->dfbsurface->GetVisibleRectangle (surface->dfbsurface, &source_rect);
  145. }
  146. if (surface->tmpsurface) {
  147. int w, h;
  148. surface->tmpsurface->GetSize (surface->tmpsurface, &w, &h);
  149. - if (w < source_rect.w || h < source_rect.h) {
  150. + if (w < source_rect.w || h < source_rect.h ||
  151. + ((w*4 > source_rect.w*5 || h*4 > source_rect.h*5) && (w > 32 || h > 32)))
  152. + {
  153. surface->tmpsurface->Release (surface->tmpsurface);
  154. surface->tmpsurface = NULL;
  155. }
  156. @@ -366,7 +376,7 @@ _directfb_acquire_surface (cairo_directfb_surface_t *surface,
  157. cairo_format = _cairo_format_from_content (surface->content);
  158. if (!surface->tmpsurface) {
  159. - D_DEBUG_AT (Cairo_DirectFB, "Allocating buffer for surface %p.\n", surface);
  160. + D_DEBUG_AT (CairoDFB_Acquire, " -> Allocating %dx%d buffer\n", source_rect.w, source_rect.h);
  161. surface->tmpsurface =
  162. _directfb_buffer_surface_create (surface->dfb,
  163. @@ -377,14 +387,12 @@ _directfb_acquire_surface (cairo_directfb_surface_t *surface,
  164. }
  165. buffer = surface->tmpsurface;
  166. - surface->dfbsurface->GetCapabilities (surface->dfbsurface, &caps);
  167. - if (caps & DSCAPS_FLIPPING) {
  168. - DFBRegion region = { .x1 = source_rect.x, .y1 = source_rect.y,
  169. - .x2 = source_rect.x + source_rect.w - 1,
  170. - .y2 = source_rect.y + source_rect.h - 1 };
  171. - surface->dfbsurface->Flip (surface->dfbsurface, &region, DSFLIP_BLIT);
  172. - }
  173. + D_DEBUG_AT( CairoDFB_Render, " => Blit( 0,0-%4dx%4d <- %4d,%4d )\n",
  174. + source_rect.w, source_rect.h, source_rect.x, source_rect.y );
  175. +
  176. + buffer->SetBlittingFlags (buffer, DSBLIT_NOFX);
  177. buffer->Blit (buffer, surface->dfbsurface, &source_rect, 0, 0);
  178. + buffer->ReleaseSource (buffer);
  179. }
  180. else {
  181. /*might be a subsurface get the offset*/
  182. @@ -396,7 +404,7 @@ _directfb_acquire_surface (cairo_directfb_surface_t *surface,
  183. *image_extra = buffer;
  184. if (buffer->Lock (buffer, lock_flags, &data, &pitch)) {
  185. - D_DEBUG_AT (Cairo_DirectFB, "Couldn't lock surface!\n");
  186. + D_DEBUG_AT (CairoDFB_Acquire, "Couldn't lock surface!\n");
  187. goto ERROR;
  188. }
  189. @@ -443,9 +451,9 @@ _cairo_directfb_surface_create_similar (void *abstract_src,
  190. cairo_directfb_surface_t *surface;
  191. cairo_format_t format;
  192. - D_DEBUG_AT (Cairo_DirectFB,
  193. - "%s( src=%p, content=0x%x, width=%d, height=%d).\n",
  194. - __FUNCTION__, source, content, width, height);
  195. + D_DEBUG_AT (CairoDFB_Surface, "%s( src=%p, content=%s%s, width=%d, height=%d)\n", __FUNCTION__, source,
  196. + (content & CAIRO_CONTENT_COLOR) ? "COLOR" : "",
  197. + (content & CAIRO_CONTENT_ALPHA) ? "+ALPHA" : "", width, height);
  198. width = (width <= 0) ? 1 : width;
  199. height = (height<= 0) ? 1 : height;
  200. @@ -497,8 +505,7 @@ _cairo_directfb_surface_finish (void *data)
  201. {
  202. cairo_directfb_surface_t *surface = (cairo_directfb_surface_t *)data;
  203. - D_DEBUG_AT (Cairo_DirectFB,
  204. - "%s( surface=%p ).\n", __FUNCTION__, surface);
  205. + D_DEBUG_AT (CairoDFB_Surface, "%s( surface=%p ).\n", __FUNCTION__, surface);
  206. if (surface->clips) {
  207. free (surface->clips);
  208. @@ -534,8 +541,8 @@ _cairo_directfb_surface_acquire_source_image (void *abstract_s
  209. {
  210. cairo_directfb_surface_t *surface = abstract_surface;
  211. - D_DEBUG_AT (Cairo_DirectFB,
  212. - "%s( surface=%p ).\n", __FUNCTION__, surface);
  213. + D_DEBUG_AT( CairoDFB_Acquire, "%s( %p - %dx%d 0x%x )\n", __FUNCTION__,
  214. + surface, surface->width, surface->height, surface->format );
  215. return _directfb_acquire_surface (surface, NULL, image_out,
  216. NULL, image_extra, DSLF_READ);
  217. @@ -549,8 +556,7 @@ _cairo_directfb_surface_release_source_image (void *abstract_su
  218. cairo_directfb_surface_t *surface = abstract_surface;
  219. IDirectFBSurface *buffer = image_extra;
  220. - D_DEBUG_AT (Cairo_DirectFB,
  221. - "%s( surface=%p ).\n", __FUNCTION__, surface);
  222. + D_DEBUG_AT (CairoDFB_Acquire, "%s( %p )\n", __FUNCTION__, surface);
  223. buffer->Unlock (buffer);
  224. @@ -564,18 +570,58 @@ _cairo_directfb_surface_acquire_dest_image (void *abstract_s
  225. cairo_rectangle_int_t *image_rect_out,
  226. void **image_extra)
  227. {
  228. + cairo_status_t status;
  229. cairo_directfb_surface_t *surface = abstract_surface;
  230. - D_DEBUG_AT (Cairo_DirectFB,
  231. - "%s( surface=%p, interest_rect={ %d %d %d %d } ).\n",
  232. - __FUNCTION__, surface,
  233. + D_DEBUG_AT (CairoDFB_Acquire,
  234. + "%s( %p - %dx%d 0x%x { %u %u %u %u } )\n",
  235. + __FUNCTION__, surface, surface->width, surface->height, surface->format,
  236. interest_rect ? interest_rect->x : 0,
  237. interest_rect ? interest_rect->y : 0,
  238. - interest_rect ? interest_rect->width : surface->width,
  239. - interest_rect ? interest_rect->height : surface->height);
  240. + interest_rect ? interest_rect->width : (unsigned) surface->width,
  241. + interest_rect ? interest_rect->height : (unsigned) surface->height);
  242. - return _directfb_acquire_surface (surface, interest_rect, image_out,
  243. - image_rect_out, image_extra, DSLF_READ | DSLF_WRITE);
  244. + status = _directfb_acquire_surface (surface, interest_rect, image_out,
  245. + image_rect_out, image_extra, DSLF_READ | DSLF_WRITE);
  246. + if (status)
  247. + return status;
  248. +
  249. + /* Ensure that the new image has the same clip, if it's the same buffer */
  250. + if ((IDirectFBSurface*) *image_extra == surface->dfbsurface &&
  251. + surface->clips)
  252. + {
  253. + cairo_surface_t *s = (cairo_surface_t*) *image_out;
  254. +
  255. + unsigned int clip_serial = _cairo_surface_allocate_clip_serial (s);
  256. +
  257. + cairo_region_t clip_region;
  258. +
  259. + if (surface->n_clips == 1) {
  260. + cairo_rectangle_int_t rect = { surface->clips[0].x1, surface->clips[0].y1,
  261. + surface->clips[0].x2 - surface->clips[0].x1 + 1,
  262. + surface->clips[0].y2 - surface->clips[0].y1 + 1 };
  263. + _cairo_region_init_rect (&clip_region, &rect);
  264. + } else {
  265. + cairo_box_int_t *boxes = _cairo_malloc_ab (surface->n_clips, sizeof(cairo_box_int_t));
  266. + int k;
  267. +
  268. + for (k = 0; k < surface->n_clips; k++) {
  269. + boxes[k].p1.x = surface->clips[k].x1;
  270. + boxes[k].p1.y = surface->clips[k].y1;
  271. + boxes[k].p2.x = surface->clips[k].x2 + 1;
  272. + boxes[k].p2.y = surface->clips[k].y2 + 1;
  273. + }
  274. +
  275. + _cairo_region_init_boxes (&clip_region, boxes, surface->n_clips);
  276. + free (boxes);
  277. + }
  278. +
  279. + _cairo_surface_set_clip_region (s, &clip_region, clip_serial);
  280. +
  281. + _cairo_region_fini (&clip_region);
  282. + }
  283. +
  284. + return CAIRO_STATUS_SUCCESS;
  285. }
  286. static void
  287. @@ -586,21 +632,31 @@ _cairo_directfb_surface_release_dest_image (void *abstract_surf
  288. void *image_extra)
  289. {
  290. cairo_directfb_surface_t *surface = abstract_surface;
  291. - IDirectFBSurface *buffer = image_extra;
  292. + IDirectFBSurface *buffer = image_extra;
  293. - D_DEBUG_AT (Cairo_DirectFB,
  294. - "%s( surface=%p ).\n", __FUNCTION__, surface);
  295. + D_DEBUG_AT (CairoDFB_Acquire,
  296. + "%s( %p - %dx%d 0x%x { %u %u %u %u } )\n",
  297. + __FUNCTION__, surface, surface->width, surface->height, surface->format,
  298. + interest_rect ? interest_rect->x : 0,
  299. + interest_rect ? interest_rect->y : 0,
  300. + interest_rect ? interest_rect->width : (unsigned) surface->width,
  301. + interest_rect ? interest_rect->height : (unsigned) surface->height);
  302. buffer->Unlock (buffer);
  303. if (surface->dfbsurface != buffer) {
  304. - DFBRegion region = { .x1 = interest_rect->x, .y1 = interest_rect->y,
  305. - .x2 = interest_rect->x+interest_rect->width-1,
  306. - .y2 = interest_rect->y+interest_rect->height-1 };
  307. - surface->dfbsurface->SetClip (surface->dfbsurface, &region);
  308. + DFBRectangle sr = { 0, 0, image_rect->width, image_rect->height };
  309. +
  310. + D_DEBUG_AT( CairoDFB_Render, " => Blit( %4d,%4d-%4dx%4d <- 0,0 )\n",
  311. + image_rect->x, image_rect->y, sr.w, sr.h );
  312. +
  313. surface->dfbsurface->SetBlittingFlags (surface->dfbsurface, DSBLIT_NOFX);
  314. - surface->dfbsurface->Blit (surface->dfbsurface, buffer,
  315. - NULL, image_rect->x, image_rect->y);
  316. +
  317. + RUN_CLIPPED( surface, NULL,
  318. + surface->dfbsurface->Blit (surface->dfbsurface,
  319. + buffer, &sr, image_rect->x, image_rect->y));
  320. +
  321. + surface->dfbsurface->ReleaseSource (surface->dfbsurface);
  322. }
  323. cairo_surface_destroy (&image->base);
  324. @@ -618,13 +674,15 @@ _cairo_directfb_surface_clone_similar (void *abstract_surface,
  325. cairo_directfb_surface_t *surface = abstract_surface;
  326. cairo_directfb_surface_t *clone;
  327. - D_DEBUG_AT (Cairo_DirectFB,
  328. - "%s( surface=%p, src=%p ).\n", __FUNCTION__, surface, src);
  329. + D_DEBUG_AT (CairoDFB_Surface, "%s( surface=%p, src=%p [%d,%d-%dx%d] )\n",
  330. + __FUNCTION__, surface, src, src_x, src_y, width, height);
  331. if (src->backend == surface->base.backend) {
  332. cairo_surface_reference (src);
  333. *clone_out = src;
  334. + D_DEBUG_AT (CairoDFB_Surface, " -> lightweight - referenced :)\n");
  335. +
  336. return CAIRO_STATUS_SUCCESS;
  337. }
  338. else if (_cairo_surface_is_image (src)) {
  339. @@ -640,7 +698,8 @@ _cairo_directfb_surface_clone_similar (void *abstract_surface,
  340. image_src->width, image_src->height);
  341. if (!clone)
  342. return _cairo_error (CAIRO_STATUS_NO_MEMORY);
  343. -
  344. +
  345. +
  346. ret = clone->dfbsurface->Lock (clone->dfbsurface,
  347. DSLF_WRITE, (void *)&dst, &pitch);
  348. if (ret) {
  349. @@ -653,6 +712,8 @@ _cairo_directfb_surface_clone_similar (void *abstract_surface,
  350. src += image_src->stride * src_y;
  351. if (image_src->format == CAIRO_FORMAT_A1) {
  352. + D_DEBUG_AT (CairoDFB_Surface, " ==> converting A1 -> A8 data\n");
  353. +
  354. /* A1 -> A8 */
  355. for (i = 0; i < height; i++) {
  356. for (j = src_x; j < src_x + width; j++)
  357. @@ -665,10 +726,14 @@ _cairo_directfb_surface_clone_similar (void *abstract_surface,
  358. int len;
  359. if (image_src->format == CAIRO_FORMAT_A8) {
  360. + D_DEBUG_AT (CairoDFB_Surface, " ==> copying A8 data\n");
  361. +
  362. dst += src_x;
  363. src += src_x;
  364. len = width;
  365. } else {
  366. + D_DEBUG_AT (CairoDFB_Surface, " ==> copying ARGB data\n");
  367. +
  368. dst += src_x * 4;
  369. src += src_x * 4;
  370. len = width * 4;
  371. @@ -722,11 +787,17 @@ _directfb_prepare_composite (cairo_directfb_surface_t *dst,
  372. cairo_pattern_t *tmp;
  373. int tmp_x, tmp_y;
  374. - if (src_pattern->type != CAIRO_PATTERN_TYPE_SOLID ||
  375. - sblend == DSBF_INVDESTALPHA) /* Doesn't work correctly */
  376. + if (src_pattern->type != CAIRO_PATTERN_TYPE_SOLID) { /* Doesn't work correctly */
  377. + D_DEBUG_AT (CairoDFB_Render, "=> PATTERN TYPE %d WITH MASK NOT SUPPORTED\n", src_pattern->type);
  378. return CAIRO_INT_STATUS_UNSUPPORTED;
  379. + }
  380. - D_DEBUG_AT (Cairo_DirectFB, "Replacing src pattern by mask pattern.\n");
  381. + if (sblend == DSBF_INVDESTALPHA) { /* Doesn't work correctly */
  382. + D_DEBUG_AT (CairoDFB_Render, "=> SOURCE BLEND %d WITH MASK NOT SUPPORTED\n", sblend);
  383. + return CAIRO_INT_STATUS_UNSUPPORTED;
  384. + }
  385. +
  386. + D_DEBUG_AT (CairoDFB_Render, "-> Replacing src pattern by mask pattern.\n");
  387. tmp = src_pattern;
  388. tmp_x = *src_x; tmp_y = *src_y;
  389. @@ -748,6 +819,10 @@ _directfb_prepare_composite (cairo_directfb_surface_t *dst,
  390. color.r = pattern->color.red_short >> 8;
  391. color.g = pattern->color.green_short >> 8;
  392. color.b = pattern->color.blue_short >> 8;
  393. +
  394. + D_DEBUG_AT (CairoDFB_Render, "-> SOLID MASK (%02x %02x %02x %02x)\n",
  395. + pattern->color.alpha_short >> 8, pattern->color.red_short >> 8,
  396. + pattern->color.green_short >> 8, pattern->color.blue_short >> 8 );
  397. }
  398. else {
  399. color.a = color.r = color.g = color.b = 0xff;
  400. @@ -756,6 +831,10 @@ _directfb_prepare_composite (cairo_directfb_surface_t *dst,
  401. if (src_pattern->type == CAIRO_PATTERN_TYPE_SOLID) {
  402. cairo_solid_pattern_t *pattern = (cairo_solid_pattern_t *)src_pattern;
  403. + D_DEBUG_AT (CairoDFB_Render, "-> SOLID PATTERN (%02x %02x %02x %02x)\n",
  404. + pattern->color.alpha_short >> 8, pattern->color.red_short >> 8,
  405. + pattern->color.green_short >> 8, pattern->color.blue_short >> 8 );
  406. +
  407. if (!dst->color) {
  408. dst->color = _cairo_directfb_surface_create_similar (dst,
  409. CAIRO_CONTENT_COLOR_ALPHA, 1, 1);
  410. @@ -777,6 +856,8 @@ _directfb_prepare_composite (cairo_directfb_surface_t *dst,
  411. src_attr.y_offset = 0;
  412. }
  413. else {
  414. + D_DEBUG_AT (CairoDFB_Render, "-> PATTERN TYPE %d\n", src_pattern->type );
  415. +
  416. ret = _cairo_pattern_acquire_surface (src_pattern, &dst->base,
  417. *src_x, *src_y, width, height,
  418. (cairo_surface_t **)&src, &src_attr);
  419. @@ -838,6 +919,9 @@ _directfb_finish_composite (cairo_directfb_surface_t *dst,
  420. {
  421. if (src != dst->color)
  422. _cairo_pattern_release_surface (src_pattern, src, src_attr);
  423. +
  424. + if (dst->dfbsurface)
  425. + dst->dfbsurface->ReleaseSource( dst->dfbsurface );
  426. }
  427. #endif /* DFB_COMPOSITE || DFB_COMPOSITE_TRAPEZOIDS */
  428. @@ -848,20 +932,38 @@ _directfb_categorize_operation (cairo_surface_attributes_t *src_attr)
  429. cairo_matrix_t *m = &src_attr->matrix;
  430. if (m->xy != 0 || m->yx != 0 || m->xx < 0 || m->yy < 0) {
  431. - if (src_attr->extend != CAIRO_EXTEND_NONE)
  432. - return DFXL_NONE;
  433. + D_DEBUG_AT (CairoDFB_Render, "-> NON-RECTANGULAR TRANSFORM\n" );
  434. +
  435. + if (src_attr->extend != CAIRO_EXTEND_NONE) {
  436. + D_DEBUG_AT (CairoDFB_Render, "=> EXTEND MODE %d NOT SUPPORTED\n", src_attr->extend );
  437. + return DFXL_NONE;
  438. + }
  439. +
  440. return DFXL_TEXTRIANGLES;
  441. }
  442. if (m->xx != 1 || m->yy != 1) {
  443. - if (src_attr->extend != CAIRO_EXTEND_NONE)
  444. - return DFXL_NONE;
  445. + D_DEBUG_AT (CairoDFB_Render, "-> RECTANGULAR TRANSFORM\n" );
  446. +
  447. + if (src_attr->extend != CAIRO_EXTEND_NONE) {
  448. + D_DEBUG_AT (CairoDFB_Render, "=> EXTEND MODE %d NOT SUPPORTED\n", src_attr->extend );
  449. +
  450. + /* TODO: support EXTEND_PAD in special cases */
  451. +
  452. + return DFXL_NONE;
  453. + }
  454. +
  455. return DFXL_STRETCHBLIT;
  456. }
  457. + D_DEBUG_AT (CairoDFB_Render, "-> NO TRANSFORM\n" );
  458. +
  459. if (src_attr->extend != CAIRO_EXTEND_NONE &&
  460. src_attr->extend != CAIRO_EXTEND_REPEAT)
  461. + {
  462. + D_DEBUG_AT (CairoDFB_Render, "=> EXTEND MODE %d NOT SUPPORTED\n", src_attr->extend );
  463. return DFXL_NONE;
  464. + }
  465. return DFXL_BLIT;
  466. }
  467. @@ -880,13 +982,13 @@ _cairo_directfb_surface_composite (cairo_operator_t op,
  468. cairo_directfb_surface_t *dst = abstract_dst;
  469. cairo_directfb_surface_t *src;
  470. cairo_surface_attributes_t src_attr;
  471. - DFBAccelerationMask accel, mask;
  472. + DFBAccelerationMask accel;
  473. cairo_int_status_t ret;
  474. - D_DEBUG_AT (Cairo_DirectFB,
  475. - "%s( op=%d, src_pattern=%p, mask_pattern=%p, dst=%p,"
  476. + D_DEBUG_AT (CairoDFB_Render,
  477. + "%s( op=%d, src=%p, mask=%p, dst=%p,"
  478. " src_x=%d, src_y=%d, mask_x=%d, mask_y=%d, dst_x=%d,"
  479. - " dst_y=%d, width=%u, height=%u ).\n",
  480. + " dst_y=%d, width=%u, height=%u )\n",
  481. __FUNCTION__, op, src_pattern, mask_pattern, dst,
  482. src_x, src_y, mask_x, mask_y, dst_x, dst_y, width, height);
  483. @@ -895,16 +997,12 @@ _cairo_directfb_surface_composite (cairo_operator_t op,
  484. width, height, &src, &src_attr);
  485. if (ret)
  486. return ret;
  487. -
  488. +
  489. accel = _directfb_categorize_operation (&src_attr);
  490. -
  491. - dst->dfbsurface->GetAccelerationMask (dst->dfbsurface, src->dfbsurface, &mask);
  492. - if (!(mask & accel)) {
  493. - D_DEBUG_AT (Cairo_DirectFB, "No acceleration (%08x)!\n", accel);
  494. - if (accel != DFXL_BLIT) {
  495. - _directfb_finish_composite (dst, src_pattern, &src->base, &src_attr);
  496. - return CAIRO_INT_STATUS_UNSUPPORTED;
  497. - }
  498. + if (!accel) {
  499. + D_DEBUG_AT (CairoDFB_Render, " ====>> UNSUPPORTED!!!\n");
  500. + _directfb_finish_composite (dst, src_pattern, &src->base, &src_attr);
  501. + return CAIRO_INT_STATUS_UNSUPPORTED;
  502. }
  503. src_x += src_attr.x_offset;
  504. @@ -920,7 +1018,8 @@ _cairo_directfb_surface_composite (cairo_operator_t op,
  505. sr.h = height;
  506. if (src_attr.extend == CAIRO_EXTEND_NONE) {
  507. - D_DEBUG_AT (Cairo_DirectFB, "Running Blit().\n");
  508. + D_DEBUG_AT( CairoDFB_Render, " ==> Blit( %4d,%4d-%4dx%4d <- %4d,%4d )\n",
  509. + dst_x, dst_y, sr.w, sr.h, sr.x, sr.y );
  510. RUN_CLIPPED( dst, NULL,
  511. dst->dfbsurface->Blit (dst->dfbsurface,
  512. @@ -934,7 +1033,8 @@ _cairo_directfb_surface_composite (cairo_operator_t op,
  513. clip.x2 = dst_x + width - 1;
  514. clip.y2 = dst_y + height - 1;
  515. - D_DEBUG_AT (Cairo_DirectFB, "Running TileBlit().\n");
  516. + D_DEBUG_AT( CairoDFB_Render, " ==> TileBlit( %4d,%4d-%4dx%4d <- %4d,%4d-%4dx%4d )\n",
  517. + dst_x, dst_y, width, height, sr.x, sr.y, sr.w, sr.h );
  518. RUN_CLIPPED( dst, &clip,
  519. dst->dfbsurface->TileBlit (dst->dfbsurface,
  520. @@ -944,7 +1044,7 @@ _cairo_directfb_surface_composite (cairo_operator_t op,
  521. case DFXL_STRETCHBLIT: {
  522. DFBRectangle sr, dr;
  523. - double x1, y1, x2, y2;
  524. + float x1, y1, x2, y2;
  525. TRANSFORM_POINT2X (src_attr.matrix,
  526. src_x, src_y, x1, y1);
  527. @@ -961,7 +1061,8 @@ _cairo_directfb_surface_composite (cairo_operator_t op,
  528. dr.w = width;
  529. dr.h = height;
  530. - D_DEBUG_AT (Cairo_DirectFB, "Running StretchBlit().\n");
  531. + D_DEBUG_AT( CairoDFB_Render, " ==> StretchBlit( %4d,%4d-%4dx%4d <- %4d,%4d-%4dx%4d )\n",
  532. + dst_x, dst_y, width, height, sr.x, sr.y, sr.w, sr.h );
  533. RUN_CLIPPED (dst, NULL,
  534. dst->dfbsurface->StretchBlit (dst->dfbsurface,
  535. @@ -1019,7 +1120,7 @@ _cairo_directfb_surface_composite (cairo_operator_t op,
  536. clip.x2 = dst_x + width - 1;
  537. clip.y2 = dst_y + height - 1;
  538. - D_DEBUG_AT (Cairo_DirectFB, "Running TextureTriangles().\n");
  539. + D_DEBUG_AT (CairoDFB_Render, " ==> TextureTriangles( ... )\n");
  540. RUN_CLIPPED (dst, &clip,
  541. dst->dfbsurface->TextureTriangles (dst->dfbsurface,
  542. @@ -1052,8 +1153,7 @@ _cairo_directfb_surface_fill_rectangles (void *abstract_surface
  543. DFBRectangle r[n_rects];
  544. int i;
  545. - D_DEBUG_AT (Cairo_DirectFB,
  546. - "%s( dst=%p, op=%d, color=%p, rects=%p, n_rects=%d ).\n",
  547. + D_DEBUG_AT (CairoDFB_Render, "%s( dst=%p, op=%d, color=%p, rects=%p, n_rects=%d )\n",
  548. __FUNCTION__, dst, op, color, rects, n_rects);
  549. if (_directfb_get_operator (op, &sblend, &dblend))
  550. @@ -1094,14 +1194,19 @@ _cairo_directfb_surface_fill_rectangles (void *abstract_surface
  551. color->green_short >> 8,
  552. color->blue_short >> 8,
  553. color->alpha_short >> 8 );
  554. +
  555. + D_DEBUG_AT( CairoDFB_Render, " -> %02x %02x %02x %02x\n", color->alpha_short >> 8,
  556. + color->red_short >> 8, color->green_short >> 8, color->blue_short >> 8 );
  557. for (i = 0; i < n_rects; i++) {
  558. r[i].x = rects[i].x;
  559. r[i].y = rects[i].y;
  560. r[i].w = rects[i].width;
  561. r[i].h = rects[i].height;
  562. +
  563. + D_DEBUG_AT( CairoDFB_Render, " ==> Fill %4d,%4d-%4dx%4d [%d]\n", DFB_RECTANGLE_VALS(&r[i]), i );
  564. }
  565. -
  566. +
  567. RUN_CLIPPED (dst, NULL,
  568. dst->dfbsurface->FillRectangles (dst->dfbsurface, r, n_rects));
  569. @@ -1128,7 +1233,7 @@ _cairo_directfb_surface_composite_trapezoids (cairo_operator_t op,
  570. cairo_status_t ret;
  571. DFBAccelerationMask accel;
  572. - D_DEBUG_AT (Cairo_DirectFB,
  573. + D_DEBUG_AT (CairoDFB_Render,
  574. "%s( op=%d, pattern=%p, dst=%p, antialias=%d,"
  575. " src_x=%d, src_y=%d, dst_x=%d, dst_y=%d,"
  576. " width=%u, height=%u, traps=%p, num_traps=%d ).\n",
  577. @@ -1235,7 +1340,7 @@ _cairo_directfb_surface_composite_trapezoids (cairo_operator_t op,
  578. #undef ADD_TRI
  579. - D_DEBUG_AT (Cairo_DirectFB, "Running TextureTriangles().\n");
  580. + D_DEBUG_AT (CairoDFB_Render, "Running TextureTriangles().\n");
  581. RUN_CLIPPED (dst, NULL,
  582. dst->dfbsurface->TextureTriangles (dst->dfbsurface, src->dfbsurface,
  583. @@ -1256,9 +1361,7 @@ _cairo_directfb_surface_set_clip_region (void *abstract_surface,
  584. {
  585. cairo_directfb_surface_t *surface = abstract_surface;
  586. - D_DEBUG_AT (Cairo_DirectFB,
  587. - "%s( surface=%p, region=%p ).\n",
  588. - __FUNCTION__, surface, region);
  589. + D_DEBUG_AT (CairoDFB_Clip, "%s( surface=%p, region=%p )\n", __FUNCTION__, surface, region);
  590. if (region) {
  591. cairo_box_int_t *boxes;
  592. @@ -1267,15 +1370,33 @@ _cairo_directfb_surface_set_clip_region (void *abstract_surface,
  593. int i;
  594. status = _cairo_region_get_boxes (region, &n_boxes, &boxes);
  595. - if (status)
  596. - return status;
  597. + if (status) {
  598. + D_DEBUG_AT( CairoDFB_Clip, " -> status %d!\n", status );
  599. + return status;
  600. + }
  601. +
  602. + if (n_boxes == 0) {
  603. + D_DEBUG_AT( CairoDFB_Clip, " -> EMPTY region (fully clipped)\n" );
  604. +
  605. + if (surface->clips) {
  606. + free (surface->clips);
  607. + surface->clips = NULL;
  608. + }
  609. +
  610. + surface->n_clips = -1;
  611. +
  612. + return CAIRO_STATUS_SUCCESS;
  613. + }
  614. +
  615. + D_DEBUG_AT( CairoDFB_Clip, " -> %d box%s\n", n_boxes, (n_boxes > 1) ? "es" : "" );
  616. - if (surface->n_clips != n_boxes) {
  617. + if (surface->n_clips < n_boxes || surface->n_clips - n_boxes > 10) {
  618. if (surface->clips)
  619. free (surface->clips);
  620. surface->clips = _cairo_malloc_ab (n_boxes, sizeof(DFBRegion));
  621. if (!surface->clips) {
  622. + D_OOM();
  623. surface->n_clips = 0;
  624. _cairo_region_boxes_fini (region, boxes);
  625. return _cairo_error (CAIRO_STATUS_NO_MEMORY);
  626. @@ -1287,18 +1408,24 @@ _cairo_directfb_surface_set_clip_region (void *abstract_surface,
  627. for (i = 0; i < n_boxes; i++) {
  628. surface->clips[i].x1 = boxes[i].p1.x;
  629. surface->clips[i].y1 = boxes[i].p1.y;
  630. - surface->clips[i].x2 = boxes[i].p2.x;
  631. - surface->clips[i].y2 = boxes[i].p2.y;
  632. + surface->clips[i].x2 = boxes[i].p2.x - 1;
  633. + surface->clips[i].y2 = boxes[i].p2.y - 1;
  634. +
  635. + D_DEBUG_AT( CairoDFB_Clip, " = CLIP %4d,%4d-%4dx%4d [%d]\n",
  636. + DFB_RECTANGLE_VALS_FROM_REGION(&surface->clips[i]), i );
  637. }
  638. _cairo_region_boxes_fini (region, boxes);
  639. }
  640. else {
  641. + D_DEBUG_AT( CairoDFB_Clip, " -> NULL region (unclipped)\n" );
  642. +
  643. if (surface->clips) {
  644. free (surface->clips);
  645. surface->clips = NULL;
  646. - surface->n_clips = 0;
  647. }
  648. +
  649. + surface->n_clips = 0;
  650. }
  651. return CAIRO_STATUS_SUCCESS;
  652. @@ -1310,9 +1437,7 @@ _cairo_directfb_abstract_surface_get_extents (void *abstract_su
  653. {
  654. cairo_directfb_surface_t *surface = abstract_surface;
  655. - D_DEBUG_AT (Cairo_DirectFB,
  656. - "%s( surface=%p, rectangle=%p ).\n",
  657. - __FUNCTION__, surface, rectangle);
  658. + D_DEBUG_AT (CairoDFB_SurfExt, "%s( surface=%p, rectangle=%p )\n", __FUNCTION__, surface, rectangle);
  659. if (rectangle) {
  660. if (!surface->local) {
  661. @@ -1323,6 +1448,8 @@ _cairo_directfb_abstract_surface_get_extents (void *abstract_su
  662. rectangle->y = 0;
  663. rectangle->width = surface->width;
  664. rectangle->height = surface->height;
  665. +
  666. + D_DEBUG_AT (CairoDFB_SurfExt, " -> %dx%d\n", surface->width, surface->height);
  667. }
  668. return CAIRO_STATUS_SUCCESS;
  669. @@ -1379,21 +1506,29 @@ _directfb_acquire_font_cache (cairo_directfb_surface_t *surface,
  670. int h = 8;
  671. int i;
  672. + D_DEBUG_AT (CairoDFB_Font, "%s( %p [%d] )\n", __FUNCTION__, glyphs, num_glyphs );
  673. +
  674. if (scaled_font->surface_private) {
  675. cache = scaled_font->surface_private;
  676. x = cache->x;
  677. y = cache->y;
  678. }
  679. -
  680. +
  681. + _cairo_cache_freeze( scaled_font->glyphs );
  682. +
  683. for (i = 0; i < num_glyphs; i++) {
  684. cairo_scaled_glyph_t *scaled_glyph;
  685. cairo_image_surface_t *img;
  686. + D_DEBUG_AT (CairoDFB_Glyphs, " -> [%2d] = %4lu\n", i, glyphs[i].index );
  687. +
  688. ret = _cairo_scaled_glyph_lookup (scaled_font, glyphs[i].index,
  689. CAIRO_SCALED_GLYPH_INFO_SURFACE,
  690. &scaled_glyph);
  691. - if (ret)
  692. + if (ret) {
  693. + _cairo_cache_thaw( scaled_font->glyphs );
  694. return ret;
  695. + }
  696. img = scaled_glyph->surface;
  697. switch (img->format) {
  698. @@ -1402,19 +1537,26 @@ _directfb_acquire_font_cache (cairo_directfb_surface_t *surface,
  699. case CAIRO_FORMAT_ARGB32:
  700. break;
  701. default:
  702. - D_DEBUG_AT (Cairo_DirectFB,
  703. - "Unsupported font format %d!\n", img->format);
  704. + D_DEBUG_AT (CairoDFB_Glyphs,
  705. + " -> Unsupported font format %d!\n", img->format);
  706. + _cairo_cache_thaw( scaled_font->glyphs );
  707. return CAIRO_INT_STATUS_UNSUPPORTED;
  708. }
  709. points[n].x = _cairo_lround (glyphs[i].x - img->base.device_transform.x0);
  710. points[n].y = _cairo_lround (glyphs[i].y - img->base.device_transform.y0);
  711. +// D_DEBUG_AT (CairoDFB_Glyphs, " (%4d,%4d) [%2d]\n", points[n].x, points[n].y, n );
  712. +
  713. if (points[n].x >= surface->width ||
  714. points[n].y >= surface->height ||
  715. points[n].x+img->width <= 0 ||
  716. points[n].y+img->height <= 0)
  717. - continue;
  718. + {
  719. + D_DEBUG_AT (CairoDFB_Glyphs,
  720. + " -> Unsupported font format %d!\n", img->format);
  721. + continue;
  722. + }
  723. if (!scaled_glyph->surface_private) {
  724. DFBRectangle *rect;
  725. @@ -1436,30 +1578,31 @@ _directfb_acquire_font_cache (cairo_directfb_surface_t *surface,
  726. /* Remember glyph location */
  727. rect = malloc (sizeof(DFBRectangle));
  728. - if (!rect)
  729. + if (!rect) {
  730. + _cairo_cache_thaw( scaled_font->glyphs );
  731. return _cairo_error (CAIRO_STATUS_NO_MEMORY);
  732. + }
  733. *rect = rects[n];
  734. scaled_glyph->surface_private = rect;
  735. chars[num_chars++] = scaled_glyph;
  736. - /*D_DEBUG_AT (Cairo_DirectFB,
  737. - "Glyph %lu will be loaded at (%d,%d).\n",
  738. - glyphs[i].index, rects[n].x, rects[n].y);*/
  739. + D_DEBUG_AT (CairoDFB_Glyphs, " -> loading at %4d,%2d <- rect %p, img %p, entry %p\n",
  740. + rects[n].x, rects[n].y, rect, scaled_glyph->surface, scaled_glyph);
  741. }
  742. else {
  743. rects[n] = *((DFBRectangle *)scaled_glyph->surface_private);
  744. - /*D_DEBUG_AT (Cairo_DirectFB,
  745. - "Glyph %lu already loaded at (%d,%d).\n",
  746. - glyphs[i].index, rects[n].x, rects[n].y);*/
  747. + D_DEBUG_AT (CairoDFB_Glyphs, " -> exists at %4d,%2d\n", rects[n].x, rects[n].y);
  748. }
  749. n++;
  750. }
  751. - if (!n)
  752. + if (!n) {
  753. + _cairo_cache_thaw( scaled_font->glyphs );
  754. return CAIRO_INT_STATUS_NOTHING_TO_DO;
  755. + }
  756. h += y;
  757. w = MAX (w, 8);
  758. @@ -1472,27 +1615,30 @@ _directfb_acquire_font_cache (cairo_directfb_surface_t *surface,
  759. w = MAX (w, cache->width);
  760. h = MAX (h, cache->height);
  761. - D_DEBUG_AT (Cairo_DirectFB,
  762. - "Reallocating font cache (%dx%d).\n", w, h);
  763. + D_DEBUG_AT (CairoDFB_Font, " -> Reallocating font cache (%dx%d).\n", w, h);
  764. new_cache = _directfb_allocate_font_cache (surface->dfb, w, h);
  765. - if (!new_cache)
  766. + if (!new_cache) {
  767. + _cairo_cache_thaw( scaled_font->glyphs );
  768. return _cairo_error (CAIRO_STATUS_NO_MEMORY);
  769. + }
  770. new_cache->dfbsurface->Blit (new_cache->dfbsurface,
  771. cache->dfbsurface, NULL, 0, 0);
  772. + new_cache->dfbsurface->ReleaseSource (new_cache->dfbsurface);
  773. _directfb_destroy_font_cache (cache);
  774. scaled_font->surface_private = cache = new_cache;
  775. }
  776. }
  777. else {
  778. - D_DEBUG_AT (Cairo_DirectFB,
  779. - "Allocating font cache (%dx%d).\n", w, h);
  780. + D_DEBUG_AT (CairoDFB_Font, " -> Allocating font cache (%dx%d).\n", w, h);
  781. cache = _directfb_allocate_font_cache (surface->dfb, w, h);
  782. - if (!cache)
  783. + if (!cache) {
  784. + _cairo_cache_thaw( scaled_font->glyphs );
  785. return _cairo_error (CAIRO_STATUS_NO_MEMORY);
  786. + }
  787. scaled_font->surface_backend = &cairo_directfb_surface_backend;
  788. scaled_font->surface_private = cache;
  789. @@ -1504,17 +1650,30 @@ _directfb_acquire_font_cache (cairo_directfb_surface_t *surface,
  790. if (cache->dfbsurface->Lock (cache->dfbsurface,
  791. DSLF_WRITE, (void *)&data, &pitch))
  792. + {
  793. + _cairo_cache_thaw( scaled_font->glyphs );
  794. return _cairo_error (CAIRO_STATUS_NO_MEMORY);
  795. + }
  796. + D_DEBUG_AT (CairoDFB_Font, " => %d chars to load, cache %dx%d\n", num_chars, cache->width, cache->height);
  797. +
  798. for (i = 0; i < num_chars; i++) {
  799. cairo_image_surface_t *img = chars[i]->surface;
  800. DFBRectangle *rect = chars[i]->surface_private;
  801. unsigned char *dst = data;
  802. - unsigned char *src = img->data;
  803. + unsigned char *src;
  804. int j;
  805. + D_DEBUG_AT (CairoDFB_Glyphs, " -> loading [%2d] <- rect %p, img %p, entry %p\n", i, rect, img, chars[i]);
  806. +
  807. + src = img->data;
  808. +
  809. + D_DEBUG_AT (CairoDFB_Glyphs, " from %p\n", src);
  810. +
  811. dst += rect->y * pitch + (_directfb_argb_font ? (rect->x<<2) : rect->x);
  812. + D_DEBUG_AT (CairoDFB_Glyphs, " to %4d,%2d (%p)\n", rect->x, rect->y, dst);
  813. +
  814. if (img->format == CAIRO_FORMAT_A1) {
  815. for (h = rect->h; h; h--) {
  816. if (_directfb_argb_font) {
  817. @@ -1563,9 +1722,13 @@ _directfb_acquire_font_cache (cairo_directfb_surface_t *surface,
  818. cache->dfbsurface->Unlock (cache->dfbsurface);
  819. }
  820. + _cairo_cache_thaw( scaled_font->glyphs );
  821. +
  822. cache->x = x;
  823. cache->y = y;
  824. + D_DEBUG_AT (CairoDFB_Font, " => cache %d,%d, %p [%d]\n", x, y, cache, n);
  825. +
  826. *ret_cache = cache;
  827. *ret_num = n;
  828. @@ -1577,7 +1740,7 @@ _cairo_directfb_surface_scaled_font_fini (cairo_scaled_font_t *scaled_font)
  829. {
  830. cairo_directfb_font_cache_t *cache = scaled_font->surface_private;
  831. - D_DEBUG_AT (Cairo_DirectFB,
  832. + D_DEBUG_AT (CairoDFB_Font,
  833. "%s( scaled_font=%p ).\n", __FUNCTION__, scaled_font);
  834. if (cache) {
  835. @@ -1590,7 +1753,7 @@ static void
  836. _cairo_directfb_surface_scaled_glyph_fini (cairo_scaled_glyph_t *scaled_glyph,
  837. cairo_scaled_font_t *scaled_font)
  838. {
  839. - D_DEBUG_AT (Cairo_DirectFB,
  840. + D_DEBUG_AT (CairoDFB_Font,
  841. "%s( scaled_glyph=%p, scaled_font=%p ).\n",
  842. __FUNCTION__, scaled_glyph, scaled_font);
  843. @@ -1619,7 +1782,7 @@ _cairo_directfb_surface_show_glyphs (void *abstract_dst,
  844. DFBPoint points[num_glyphs];
  845. int num;
  846. - D_DEBUG_AT (Cairo_DirectFB,
  847. + D_DEBUG_AT (CairoDFB_Font,
  848. "%s( dst=%p, op=%d, pattern=%p, glyphs=%p, num_glyphs=%d, scaled_font=%p ).\n",
  849. __FUNCTION__, dst, op, pattern, glyphs, num_glyphs, scaled_font);
  850. @@ -1660,12 +1823,14 @@ _cairo_directfb_surface_show_glyphs (void *abstract_dst,
  851. dst->dfbsurface->SetDstBlendFunction (dst->dfbsurface, dblend);
  852. dst->dfbsurface->SetColor (dst->dfbsurface, color.r, color.g, color.b, color.a);
  853. - D_DEBUG_AT (Cairo_DirectFB, "Running BatchBlit().\n");
  854. + D_DEBUG_AT (CairoDFB_Font, " ===> BatchBlit()\n");
  855. RUN_CLIPPED (dst, NULL,
  856. dst->dfbsurface->BatchBlit (dst->dfbsurface,
  857. cache->dfbsurface, rects, points, num));
  858. + dst->dfbsurface->ReleaseSource (dst->dfbsurface);
  859. +
  860. return CAIRO_STATUS_SUCCESS;
  861. }
  862. #endif /* DFB_SHOW_GLYPHS */
  863. @@ -1758,7 +1923,7 @@ cairo_directfb_surface_backend_init (IDirectFB *dfb)
  864. cairo_directfb_surface_backend.scaled_glyph_fini = NULL;
  865. cairo_directfb_surface_backend.show_glyphs = NULL;
  866. #endif
  867. - D_DEBUG_AT (Cairo_DirectFB, "Acceleration disabled.\n");
  868. + D_DEBUG_AT (CairoDFB_Surface, "Acceleration disabled.\n");
  869. }
  870. else {
  871. DFBGraphicsDeviceDescription dsc;
  872. @@ -1766,19 +1931,19 @@ cairo_directfb_surface_backend_init (IDirectFB *dfb)
  873. dfb->GetDeviceDescription (dfb, &dsc);
  874. #if DFB_COMPOSITE
  875. - if (!(dsc.acceleration_mask & DFXL_BLIT))
  876. - cairo_directfb_surface_backend.composite = NULL;
  877. +// if (!(dsc.acceleration_mask & DFXL_BLIT))
  878. +// cairo_directfb_surface_backend.composite = NULL;
  879. #endif
  880. #if DFB_COMPOSITE_TRAPEZOIDS
  881. - if (!(dsc.acceleration_mask & DFXL_TEXTRIANGLES))
  882. - cairo_directfb_surface_backend.composite_trapezoids = NULL;
  883. +// if (!(dsc.acceleration_mask & DFXL_TEXTRIANGLES))
  884. +// cairo_directfb_surface_backend.composite_trapezoids = NULL;
  885. #endif
  886. }
  887. if (getenv ("CAIRO_DIRECTFB_ARGB_FONT")) {
  888. _directfb_argb_font = 1;
  889. - D_DEBUG_AT (Cairo_DirectFB, "Using ARGB fonts.\n");
  890. + D_DEBUG_AT (CairoDFB_Surface, "Using ARGB fonts.\n");
  891. }
  892. done = 1;