summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2013-07-12 11:08:22 -0700
committerJay Sorg <jay.sorg@gmail.com>2013-07-12 11:08:22 -0700
commita1b4baddc66b783a4779f29ead9bf537b2cc17ed (patch)
tree371724b171dc832e1ef7e53d6b347def1a010172
parentd963774fe8d4892427f0de25f458c991797ca80b (diff)
downloadxrdp-proprietary-a1b4baddc66b783a4779f29ead9bf537b2cc17ed.tar.gz
xrdp-proprietary-a1b4baddc66b783a4779f29ead9bf537b2cc17ed.zip
part of merge, move all glyph calls to rdpglyph.c
-rw-r--r--xorg/X11R7.6/rdp/rdpComposite.c68
-rw-r--r--xorg/X11R7.6/rdp/rdpglyph.c69
-rw-r--r--xorg/X11R7.6/rdp/rdpglyph.h4
3 files changed, 73 insertions, 68 deletions
diff --git a/xorg/X11R7.6/rdp/rdpComposite.c b/xorg/X11R7.6/rdp/rdpComposite.c
index 8528c4c6..ec161994 100644
--- a/xorg/X11R7.6/rdp/rdpComposite.c
+++ b/xorg/X11R7.6/rdp/rdpComposite.c
@@ -697,9 +697,9 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
rdpPixmapRec* pDstPriv;
rdpPixmapRec* pDirtyPriv;
struct image_data id;
-
+
LLOGLN(10, ("rdpComposite:"));
-
+
if (g_doing_font == 2)
{
rdpCompositeOrg(op, pSrc, pMask, pDst, xSrc, ySrc,
@@ -707,7 +707,7 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
return;
}
-
+
#if 0
if (g_do_glyph_cache && g_do_alpha_glyphs)
{
@@ -844,65 +844,3 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
rdpup_switch_os_surface(-1);
}
}
-
-/******************************************************************************/
-/* make sure no glyph is too big */
-/* returns boolean */
-static int
-rdpGlyphCheck(int nlist, GlyphListPtr list, GlyphPtr* glyphs)
-{
- int n;
- GlyphPtr glyph;
-
- while (nlist--)
- {
- n = list->len;
- list++;
- while (n--)
- {
- glyph = *glyphs++;
- if ((glyph->info.width * glyph->info.height) > 8192)
- {
- LLOGLN(10, ("rdpGlyphCheck: too big"));
- return 0;
- }
- }
- }
- return 1;
-}
-
-/******************************************************************************/
-void
-rdpGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc, INT16 ySrc, int nlists, GlyphListPtr lists,
- GlyphPtr* glyphs)
-{
- PictureScreenPtr ps;
-
- LLOGLN(10, ("rdpGlyphs: op %d xSrc %d ySrc %d maskFormat %p", op, xSrc, ySrc, maskFormat));
-
- if (g_do_glyph_cache && rdpGlyphCheck(nlists, lists, glyphs))
- {
- g_doing_font = 2;
- rdpGlyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlists, lists, glyphs);
- ps = GetPictureScreen(g_pScreen);
- ps->Glyphs = g_rdpScreen.Glyphs;
- ps->Glyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc,
- nlists, lists, glyphs);
- ps->Glyphs = rdpGlyphs;
- }
- else
- {
- g_doing_font = 1;
- rdpup_set_hints(1, 1);
- ps = GetPictureScreen(g_pScreen);
- ps->Glyphs = g_rdpScreen.Glyphs;
- ps->Glyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc,
- nlists, lists, glyphs);
- ps->Glyphs = rdpGlyphs;
- rdpup_set_hints(0, 1);
- }
- g_doing_font = 0;
- LLOGLN(10, ("rdpGlyphs: out"));
-}
diff --git a/xorg/X11R7.6/rdp/rdpglyph.c b/xorg/X11R7.6/rdp/rdpglyph.c
index e6e011be..af1d28ec 100644
--- a/xorg/X11R7.6/rdp/rdpglyph.c
+++ b/xorg/X11R7.6/rdp/rdpglyph.c
@@ -52,6 +52,11 @@
extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
extern int g_do_dirty_os; /* in rdpmain.c */
extern int g_do_alpha_glyphs; /* in rdpmain.c */
+extern int g_do_glyph_cache; /* in rdpmain.c */
+extern int g_doing_font; /* in rdpmain.c */
+extern ScreenPtr g_pScreen; /* in rdpmain.c */
+extern rdpScreenInfoRec g_rdpScreen; /* in rdpmain.c */
+
#define LOG_LEVEL 1
#define LLOG(_level, _args) \
@@ -763,7 +768,7 @@ GlyphExtents(int nlist, GlyphListPtr list, GlyphPtr* glyphs, BoxPtr extents)
}
/******************************************************************************/
-void
+static void
rdpGlypht(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
int nlists, GlyphListPtr lists, GlyphPtr* glyphs)
@@ -780,6 +785,68 @@ rdpGlypht(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
}
/******************************************************************************/
+/* make sure no glyph is too big */
+/* returns boolean */
+static int
+rdpGlyphCheck(int nlist, GlyphListPtr list, GlyphPtr* glyphs)
+{
+ int n;
+ GlyphPtr glyph;
+
+ while (nlist--)
+ {
+ n = list->len;
+ list++;
+ while (n--)
+ {
+ glyph = *glyphs++;
+ if ((glyph->info.width * glyph->info.height) > 8192)
+ {
+ LLOGLN(10, ("rdpGlyphCheck: too big"));
+ return 0;
+ }
+ }
+ }
+ return 1;
+}
+
+/******************************************************************************/
+void
+rdpGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc, INT16 ySrc, int nlists, GlyphListPtr lists,
+ GlyphPtr* glyphs)
+{
+ PictureScreenPtr ps;
+
+ LLOGLN(0, ("rdpGlyphs: op %d xSrc %d ySrc %d maskFormat %p", op, xSrc, ySrc, maskFormat));
+
+ if (g_do_glyph_cache && rdpGlyphCheck(nlists, lists, glyphs))
+ {
+ g_doing_font = 2;
+ rdpGlypht(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlists, lists, glyphs);
+ ps = GetPictureScreen(g_pScreen);
+ ps->Glyphs = g_rdpScreen.Glyphs;
+ ps->Glyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc,
+ nlists, lists, glyphs);
+ ps->Glyphs = rdpGlyphs;
+ }
+ else
+ {
+ g_doing_font = 1;
+ rdpup_set_hints(1, 1);
+ ps = GetPictureScreen(g_pScreen);
+ ps->Glyphs = g_rdpScreen.Glyphs;
+ ps->Glyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc,
+ nlists, lists, glyphs);
+ ps->Glyphs = rdpGlyphs;
+ rdpup_set_hints(0, 1);
+ }
+ g_doing_font = 0;
+ LLOGLN(0, ("rdpGlyphs: out"));
+}
+
+/******************************************************************************/
int
rdpGlyphInit(void)
{
diff --git a/xorg/X11R7.6/rdp/rdpglyph.h b/xorg/X11R7.6/rdp/rdpglyph.h
index 6bc6a9b3..6907f9e7 100644
--- a/xorg/X11R7.6/rdp/rdpglyph.h
+++ b/xorg/X11R7.6/rdp/rdpglyph.h
@@ -1,5 +1,5 @@
/*
-Copyright 2012 Jay Sorg
+Copyright 2012-2013 Jay Sorg
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
@@ -55,7 +55,7 @@ int
rdp_text_chars_to_data(struct rdp_text* rtext);
void
-rdpGlypht(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
+rdpGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
int nlists, GlyphListPtr lists, GlyphPtr* glyphs);
int