winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
September 2011
----- 2025 -----
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
996 discussions
Start a n
N
ew thread
Jacek Caban : vbscript: Added lexer support for numeric literals.
by Alexandre Julliard
12 Sep '11
12 Sep '11
Module: wine Branch: master Commit: 1e224b4e09e25192d8c80d90c9208497c7a694fe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1e224b4e09e25192d8c80d90c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Sep 12 12:29:43 2011 +0200 vbscript: Added lexer support for numeric literals. --- dlls/vbscript/lex.c | 30 ++++++++++++++++++++++++++++++ dlls/vbscript/parser.y | 2 ++ 2 files changed, 32 insertions(+), 0 deletions(-) diff --git a/dlls/vbscript/lex.c b/dlls/vbscript/lex.c index 4c78b42..ddafee9 100644 --- a/dlls/vbscript/lex.c +++ b/dlls/vbscript/lex.c @@ -240,6 +240,33 @@ static int parse_string_literal(parser_ctx_t *ctx, const WCHAR **ret) return tString; } +static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) +{ + double n = 0; + + if(*ctx->ptr == '0' && !('0' <= ctx->ptr[1] && ctx->ptr[1] <= '9') && ctx->ptr[1] != '.') + return *ctx->ptr++; + + do { + n = n*10 + *ctx->ptr++ - '0'; + }while('0' <= *ctx->ptr && *ctx->ptr <= '9'); + + if(*ctx->ptr != '.') { + if((LONG)n == n) { + LONG l = n; + *(LONG*)ret = l; + return (short)l == l ? tShort : tLong; + } + }else { + double e = 1.0; + while('0' <= *++ctx->ptr && *ctx->ptr <= '9') + n += (e /= 10.0)*(*ctx->ptr-'0'); + } + + *(double*)ret = n; + return tDouble; +} + static void skip_spaces(parser_ctx_t *ctx) { while(*ctx->ptr == ' ' || *ctx->ptr == '\t' || *ctx->ptr == '\r') @@ -256,6 +283,9 @@ static int parse_next_token(void *lval, parser_ctx_t *ctx) c = *ctx->ptr; + if('0' <= c && c <= '9') + return parse_numeric_literal(ctx, lval); + if(isalphaW(c)) { int ret = check_keywords(ctx); if(!ret) diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index 607fcb6..a5fff60 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -74,6 +74,8 @@ static statement_t *new_call_statement(parser_ctx_t*,member_expression_t*); %token tCLASS tSET tNEW tPUBLIC tPRIVATE tDEFAULT tME %token tERROR tNEXT tON tRESUME tGOTO %token <string> tIdentifier tString +%token <lng> tLong tShort +%token <dbl> tDouble %type <statement> Statement StatementNl %type <expression> Expression LiteralExpression PrimaryExpression EqualityExpression CallExpression
1
0
0
0
Jacek Caban : vbscript: Don't leak memory in parser.
by Alexandre Julliard
12 Sep '11
12 Sep '11
Module: wine Branch: master Commit: bb80eaa492c0eda28d24e039e543c41a1c200a86 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bb80eaa492c0eda28d24e039e…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Sep 12 12:29:31 2011 +0200 vbscript: Don't leak memory in parser. --- dlls/vbscript/parse.h | 3 +++ dlls/vbscript/parser.y | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/vbscript/parse.h b/dlls/vbscript/parse.h index 56b3e1b..0e69921 100644 --- a/dlls/vbscript/parse.h +++ b/dlls/vbscript/parse.h @@ -87,8 +87,11 @@ typedef struct { statement_t *stats; statement_t *stats_tail; + + vbsheap_t heap; } parser_ctx_t; HRESULT parse_script(parser_ctx_t*,const WCHAR*) DECLSPEC_HIDDEN; +void parser_release(parser_ctx_t*) DECLSPEC_HIDDEN; int parser_lex(void*,parser_ctx_t*) DECLSPEC_HIDDEN; void *parser_alloc(parser_ctx_t*,size_t) DECLSPEC_HIDDEN; diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index c1c7e61..607fcb6 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -280,8 +280,7 @@ void *parser_alloc(parser_ctx_t *ctx, size_t size) { void *ret; - /* FIXME: leaks! */ - ret = heap_alloc(size); + ret = vbsheap_alloc(&ctx->heap, size); if(!ret) ctx->hres = E_OUTOFMEMORY; return ret; @@ -292,6 +291,8 @@ HRESULT parse_script(parser_ctx_t *ctx, const WCHAR *code) ctx->code = ctx->ptr = code; ctx->end = ctx->code + strlenW(ctx->code); + vbsheap_init(&ctx->heap); + ctx->parse_complete = FALSE; ctx->hres = S_OK; @@ -311,3 +312,8 @@ HRESULT parse_script(parser_ctx_t *ctx, const WCHAR *code) return S_OK; } + +void parser_release(parser_ctx_t *ctx) +{ + vbsheap_free(&ctx->heap); +}
1
0
0
0
Jacek Caban : vbscript: Make vbscode_t own the memory it uses.
by Alexandre Julliard
12 Sep '11
12 Sep '11
Module: wine Branch: master Commit: 5b8cde66f120717e063ac6a45e0690332c8b5219 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5b8cde66f120717e063ac6a45…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Sep 12 12:29:14 2011 +0200 vbscript: Make vbscode_t own the memory it uses. --- dlls/vbscript/compile.c | 33 ++++++++++++++-- dlls/vbscript/vbscript.h | 13 ++++++ dlls/vbscript/vbscript_main.c | 83 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 125 insertions(+), 4 deletions(-) diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index 181f6c1..450fa18 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -36,6 +36,23 @@ typedef struct { static HRESULT compile_expression(compile_ctx_t*,expression_t*); +static inline void *compiler_alloc(vbscode_t *vbscode, size_t size) +{ + return vbsheap_alloc(&vbscode->heap, size); +} + +static WCHAR *compiler_alloc_string(vbscode_t *vbscode, const WCHAR *str) +{ + size_t size; + WCHAR *ret; + + size = (strlenW(str)+1)*sizeof(WCHAR); + ret = compiler_alloc(vbscode, size); + if(ret) + memcpy(ret, str, size); + return ret; +} + static inline instr_t *instr_ptr(compile_ctx_t *ctx, unsigned id) { assert(id < ctx->instr_cnt); @@ -75,13 +92,18 @@ static HRESULT push_instr_int(compile_ctx_t *ctx, vbsop_t op, LONG arg) static HRESULT push_instr_str(compile_ctx_t *ctx, vbsop_t op, const WCHAR *arg) { - unsigned ret; + unsigned instr; + WCHAR *str; - ret = push_instr(ctx, op); - if(ret == -1) + str = compiler_alloc_string(ctx->code, arg); + if(!str) + return E_OUTOFMEMORY; + + instr = push_instr(ctx, op); + if(instr == -1) return E_OUTOFMEMORY; - instr_ptr(ctx, ret)->arg1.str = arg; + instr_ptr(ctx, instr)->arg1.str = str; return S_OK; } @@ -263,6 +285,8 @@ void release_vbscode(vbscode_t *code) for(i=0; i < code->bstr_cnt; i++) SysFreeString(code->bstr_pool[i]); + vbsheap_free(&code->heap); + heap_free(code->bstr_pool); heap_free(code->source); heap_free(code->instrs); @@ -291,6 +315,7 @@ static vbscode_t *alloc_vbscode(compile_ctx_t *ctx, const WCHAR *source) ctx->instr_cnt = 0; ctx->instr_size = 32; + vbsheap_init(&ret->heap); ret->option_explicit = ctx->parser.option_explicit; diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 199ca70..9c047d1 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -31,6 +31,18 @@ #include "wine/list.h" #include "wine/unicode.h" +typedef struct { + void **blocks; + DWORD block_cnt; + DWORD last_block; + DWORD offset; + struct list custom_blocks; +} vbsheap_t; + +void vbsheap_init(vbsheap_t*) DECLSPEC_HIDDEN; +void *vbsheap_alloc(vbsheap_t*,size_t) __WINE_ALLOC_SIZE(2) DECLSPEC_HIDDEN; +void vbsheap_free(vbsheap_t*) DECLSPEC_HIDDEN; + typedef struct _function_t function_t; typedef struct _vbscode_t vbscode_t; typedef struct _script_ctx_t script_ctx_t; @@ -122,6 +134,7 @@ struct _vbscode_t { BSTR *bstr_pool; unsigned bstr_pool_size; unsigned bstr_cnt; + vbsheap_t heap; struct list entry; }; diff --git a/dlls/vbscript/vbscript_main.c b/dlls/vbscript/vbscript_main.c index 9d74026..1527281 100644 --- a/dlls/vbscript/vbscript_main.c +++ b/dlls/vbscript/vbscript_main.c @@ -31,6 +31,89 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); static HINSTANCE vbscript_hinstance; +#define MIN_BLOCK_SIZE 128 + +static inline DWORD block_size(DWORD block) +{ + return MIN_BLOCK_SIZE << block; +} + +void vbsheap_init(vbsheap_t *heap) +{ + memset(heap, 0, sizeof(*heap)); + list_init(&heap->custom_blocks); +} + +void *vbsheap_alloc(vbsheap_t *heap, size_t size) +{ + struct list *list; + void *tmp; + + size = (size+3)&~3; + + if(!heap->block_cnt) { + if(!heap->blocks) { + heap->blocks = heap_alloc(sizeof(void*)); + if(!heap->blocks) + return NULL; + } + + tmp = heap_alloc(block_size(0)); + if(!tmp) + return NULL; + + heap->blocks[0] = tmp; + heap->block_cnt = 1; + } + + if(heap->offset + size <= block_size(heap->last_block)) { + tmp = ((BYTE*)heap->blocks[heap->last_block])+heap->offset; + heap->offset += size; + return tmp; + } + + if(size <= block_size(heap->last_block+1)) { + if(heap->last_block+1 == heap->block_cnt) { + tmp = heap_realloc(heap->blocks, (heap->block_cnt+1)*sizeof(void*)); + if(!tmp) + return NULL; + + heap->blocks = tmp; + heap->blocks[heap->block_cnt] = heap_alloc(block_size(heap->block_cnt)); + if(!heap->blocks[heap->block_cnt]) + return NULL; + + heap->block_cnt++; + } + + heap->last_block++; + heap->offset = size; + return heap->blocks[heap->last_block]; + } + + list = heap_alloc(size + sizeof(struct list)); + if(!list) + return NULL; + + list_add_head(&heap->custom_blocks, list); + return list+1; +} + +void vbsheap_free(vbsheap_t *heap) +{ + struct list *iter; + DWORD i; + + while((iter = list_next(&heap->custom_blocks, &heap->custom_blocks))) { + list_remove(iter); + heap_free(iter); + } + + for(i=0; i < heap->block_cnt; i++) + heap_free(heap->blocks[i]); + heap_free(heap->blocks); +} + static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv) { *ppv = NULL;
1
0
0
0
Jacek Caban : vbscript: Added lexer support for remaining equality expressions.
by Alexandre Julliard
12 Sep '11
12 Sep '11
Module: wine Branch: master Commit: e5eaf4d222469955655fb1a7e7e870a071b7e931 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e5eaf4d222469955655fb1a7e…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Sep 12 12:28:55 2011 +0200 vbscript: Added lexer support for remaining equality expressions. --- dlls/vbscript/lex.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/dlls/vbscript/lex.c b/dlls/vbscript/lex.c index 41f76e9..4c78b42 100644 --- a/dlls/vbscript/lex.c +++ b/dlls/vbscript/lex.c @@ -299,6 +299,22 @@ static int parse_next_token(void *lval, parser_ctx_t *ctx) return '('; case '"': return parse_string_literal(ctx, lval); + case '<': + switch(*++ctx->ptr) { + case '>': + ctx->ptr++; + return tNEQ; + case '=': + ctx->ptr++; + return tLTEQ; + } + return '<'; + case '>': + if(*++ctx->ptr == '=') { + ctx->ptr++; + return tGTEQ; + } + return '>'; default: FIXME("Unhandled char %c in %s\n", *ctx->ptr, debugstr_w(ctx->ptr)); }
1
0
0
0
Alexandre Julliard : winex11: Pass an HDC to the size mapping functions.
by Alexandre Julliard
12 Sep '11
12 Sep '11
Module: wine Branch: master Commit: 84f549b6832e234361510fd502fa43c289cf9aac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=84f549b6832e234361510fd50…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 12 13:27:31 2011 +0200 winex11: Pass an HDC to the size mapping functions. --- dlls/winex11.drv/graphics.c | 8 ++++---- dlls/winex11.drv/pen.c | 2 +- dlls/winex11.drv/x11drv.h | 4 ++-- dlls/winex11.drv/xfont.c | 4 ++-- dlls/winex11.drv/xrender.c | 28 ++++++++++++++-------------- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/dlls/winex11.drv/graphics.c b/dlls/winex11.drv/graphics.c index 7c4e0d5..c93001f 100644 --- a/dlls/winex11.drv/graphics.c +++ b/dlls/winex11.drv/graphics.c @@ -473,7 +473,7 @@ BOOL X11DRV_SetupGCForText( X11DRV_PDEVICE *physDev ) * * Performs a world-to-viewport transformation on the specified width. */ -INT X11DRV_XWStoDS( X11DRV_PDEVICE *physDev, INT width ) +INT X11DRV_XWStoDS( HDC hdc, INT width ) { POINT pt[2]; @@ -481,7 +481,7 @@ INT X11DRV_XWStoDS( X11DRV_PDEVICE *physDev, INT width ) pt[0].y = 0; pt[1].x = width; pt[1].y = 0; - LPtoDP( physDev->dev.hdc, pt, 2 ); + LPtoDP( hdc, pt, 2 ); return pt[1].x - pt[0].x; } @@ -490,7 +490,7 @@ INT X11DRV_XWStoDS( X11DRV_PDEVICE *physDev, INT width ) * * Performs a world-to-viewport transformation on the specified height. */ -INT X11DRV_YWStoDS( X11DRV_PDEVICE *physDev, INT height ) +INT X11DRV_YWStoDS( HDC hdc, INT height ) { POINT pt[2]; @@ -498,7 +498,7 @@ INT X11DRV_YWStoDS( X11DRV_PDEVICE *physDev, INT height ) pt[0].y = 0; pt[1].x = 0; pt[1].y = height; - LPtoDP( physDev->dev.hdc, pt, 2 ); + LPtoDP( hdc, pt, 2 ); return pt[1].y - pt[0].y; } diff --git a/dlls/winex11.drv/pen.c b/dlls/winex11.drv/pen.c index 54883b2..45a1f6f 100644 --- a/dlls/winex11.drv/pen.c +++ b/dlls/winex11.drv/pen.c @@ -74,7 +74,7 @@ HPEN X11DRV_SelectPen( PHYSDEV dev, HPEN hpen ) physDev->pen.width = logpen.lopnWidth.x; if ((logpen.lopnStyle & PS_GEOMETRIC) || (physDev->pen.width >= 1)) { - physDev->pen.width = X11DRV_XWStoDS( physDev, physDev->pen.width ); + physDev->pen.width = X11DRV_XWStoDS( dev->hdc, physDev->pen.width ); if (physDev->pen.width < 0) physDev->pen.width = -physDev->pen.width; } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index c128da7..fb190b2 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -286,8 +286,8 @@ extern void restore_clipping_region( X11DRV_PDEVICE *dev, HRGN rgn ) DECLSPEC_HI extern BOOL X11DRV_SetupGCForPatBlt( X11DRV_PDEVICE *physDev, GC gc, BOOL fMapColors ) DECLSPEC_HIDDEN; extern BOOL X11DRV_SetupGCForBrush( X11DRV_PDEVICE *physDev ) DECLSPEC_HIDDEN; extern BOOL X11DRV_SetupGCForText( X11DRV_PDEVICE *physDev ) DECLSPEC_HIDDEN; -extern INT X11DRV_XWStoDS( X11DRV_PDEVICE *physDev, INT width ) DECLSPEC_HIDDEN; -extern INT X11DRV_YWStoDS( X11DRV_PDEVICE *physDev, INT height ) DECLSPEC_HIDDEN; +extern INT X11DRV_XWStoDS( HDC hdc, INT width ) DECLSPEC_HIDDEN; +extern INT X11DRV_YWStoDS( HDC hdc, INT height ) DECLSPEC_HIDDEN; extern const int X11DRV_XROPfunction[]; diff --git a/dlls/winex11.drv/xfont.c b/dlls/winex11.drv/xfont.c index 35d23d6..9d837a4 100644 --- a/dlls/winex11.drv/xfont.c +++ b/dlls/winex11.drv/xfont.c @@ -3254,14 +3254,14 @@ HFONT X11DRV_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont ) /* FIXME - check that the other drivers do this correctly */ if (lf.lfWidth) { - INT width = X11DRV_XWStoDS( physDev, lf.lfWidth ); + INT width = X11DRV_XWStoDS( dev->hdc, lf.lfWidth ); lf.lfWidth = (lf.lfWidth < 0) ? -abs(width) : abs(width); if (lf.lfWidth == 0) lf.lfWidth = 1; /* Minimum width */ } if (lf.lfHeight) { - INT height = X11DRV_YWStoDS( physDev, lf.lfHeight ); + INT height = X11DRV_YWStoDS( dev->hdc, lf.lfHeight ); lf.lfHeight = (lf.lfHeight < 0) ? -abs(height) : abs(height); if (lf.lfHeight == 0) lf.lfHeight = MIN_FONT_SIZE; diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index 62db5b0..e7a1062 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -828,7 +828,7 @@ static int AllocEntry(void) return mru; } -static BOOL get_gasp_flags(struct xrender_physdev *physDev, WORD *flags) +static BOOL get_gasp_flags(HDC hdc, WORD *flags) { DWORD size; WORD *gasp, *buffer; @@ -838,15 +838,15 @@ static BOOL get_gasp_flags(struct xrender_physdev *physDev, WORD *flags) *flags = 0; - size = GetFontData(physDev->dev.hdc, MS_GASP_TAG, 0, NULL, 0); + size = GetFontData(hdc, MS_GASP_TAG, 0, NULL, 0); if(size == GDI_ERROR) return FALSE; gasp = buffer = HeapAlloc(GetProcessHeap(), 0, size); - GetFontData(physDev->dev.hdc, MS_GASP_TAG, 0, gasp, size); + GetFontData(hdc, MS_GASP_TAG, 0, gasp, size); - GetTextMetricsW(physDev->dev.hdc, &tm); - ppem = abs(X11DRV_YWStoDS(physDev->x11dev, tm.tmAscent + tm.tmDescent - tm.tmInternalLeading)); + GetTextMetricsW(hdc, &tm); + ppem = abs(X11DRV_YWStoDS(hdc, tm.tmAscent + tm.tmDescent - tm.tmInternalLeading)); gasp++; num_recs = get_be_word(*gasp); @@ -864,7 +864,7 @@ static BOOL get_gasp_flags(struct xrender_physdev *physDev, WORD *flags) return TRUE; } -static AA_Type get_antialias_type( struct xrender_physdev *physDev, BOOL subpixel, BOOL hinter) +static AA_Type get_antialias_type( HDC hdc, BOOL subpixel, BOOL hinter ) { AA_Type ret; WORD flags; @@ -887,7 +887,7 @@ static AA_Type get_antialias_type( struct xrender_physdev *physDev, BOOL subpixe But, Wine's subpixel rendering can support the portrait mode. */ } - else if (!hinter || !get_gasp_flags(physDev, &flags) || flags & GASP_DOGRAY) + else if (!hinter || !get_gasp_flags(hdc, &flags) || flags & GASP_DOGRAY) ret = AA_Grey; else ret = AA_None; @@ -895,7 +895,7 @@ static AA_Type get_antialias_type( struct xrender_physdev *physDev, BOOL subpixe return ret; } -static int GetCacheEntry(struct xrender_physdev *physDev, LFANDSIZE *plfsz) +static int GetCacheEntry( HDC hdc, LFANDSIZE *plfsz ) { int ret; int format; @@ -926,11 +926,11 @@ static int GetCacheEntry(struct xrender_physdev *physDev, LFANDSIZE *plfsz) switch (plfsz->lf.lfQuality) { case ANTIALIASED_QUALITY: - entry->aa_default = get_antialias_type( physDev, FALSE, hinter ); + entry->aa_default = get_antialias_type( hdc, FALSE, hinter ); return ret; /* ignore further configuration */ case CLEARTYPE_QUALITY: case CLEARTYPE_NATURAL_QUALITY: - entry->aa_default = get_antialias_type( physDev, subpixel, hinter ); + entry->aa_default = get_antialias_type( hdc, subpixel, hinter ); break; case DEFAULT_QUALITY: case DRAFT_QUALITY: @@ -939,7 +939,7 @@ static int GetCacheEntry(struct xrender_physdev *physDev, LFANDSIZE *plfsz) if ( SystemParametersInfoW( SPI_GETFONTSMOOTHING, 0, &font_smoothing, 0) && font_smoothing) { - entry->aa_default = get_antialias_type( physDev, subpixel, hinter ); + entry->aa_default = get_antialias_type( hdc, subpixel, hinter ); } else entry->aa_default = AA_None; @@ -1111,8 +1111,8 @@ static HFONT xrenderdrv_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont ) lfsz.lf.lfHeight, lfsz.lf.lfWidth, lfsz.lf.lfWeight, lfsz.lf.lfItalic, lfsz.lf.lfCharSet, debugstr_w(lfsz.lf.lfFaceName)); lfsz.lf.lfWidth = abs( lfsz.lf.lfWidth ); - lfsz.devsize.cx = X11DRV_XWStoDS( physdev->x11dev, lfsz.lf.lfWidth ); - lfsz.devsize.cy = X11DRV_YWStoDS( physdev->x11dev, lfsz.lf.lfHeight ); + lfsz.devsize.cx = X11DRV_XWStoDS( dev->hdc, lfsz.lf.lfWidth ); + lfsz.devsize.cy = X11DRV_YWStoDS( dev->hdc, lfsz.lf.lfHeight ); GetTransform( dev->hdc, 0x204, &lfsz.xform ); TRACE("font transform %f %f %f %f\n", lfsz.xform.eM11, lfsz.xform.eM12, @@ -1126,7 +1126,7 @@ static HFONT xrenderdrv_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont ) EnterCriticalSection(&xrender_cs); if (physdev->info.cache_index != -1) dec_ref_cache( physdev->info.cache_index ); - physdev->info.cache_index = GetCacheEntry( physdev, &lfsz ); + physdev->info.cache_index = GetCacheEntry( dev->hdc, &lfsz ); LeaveCriticalSection(&xrender_cs); physdev->x11dev->has_gdi_font = TRUE; return 0;
1
0
0
0
Alexandre Julliard : winex11: Add an AlphaBlend entry point in the XRender driver.
by Alexandre Julliard
12 Sep '11
12 Sep '11
Module: wine Branch: master Commit: b174bde4d2e94c3fdfaadaf3e2c1af4491bb404b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b174bde4d2e94c3fdfaadaf3e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 12 12:20:01 2011 +0200 winex11: Add an AlphaBlend entry point in the XRender driver. --- dlls/winex11.drv/bitblt.c | 22 --------------- dlls/winex11.drv/init.c | 2 +- dlls/winex11.drv/x11drv.h | 6 ---- dlls/winex11.drv/xrender.c | 62 ++++++++++++++++++++++++-------------------- 4 files changed, 35 insertions(+), 57 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=b174bde4d2e94c3fdfaad…
1
0
0
0
Alexandre Julliard : winex11: Add an ExtTextOut entry point in the XRender driver.
by Alexandre Julliard
12 Sep '11
12 Sep '11
Module: wine Branch: master Commit: 5a2ab8364afe9104937939f5c79b6f15a81e82a5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5a2ab8364afe9104937939f5c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 12 11:57:22 2011 +0200 winex11: Add an ExtTextOut entry point in the XRender driver. --- dlls/winex11.drv/text.c | 3 - dlls/winex11.drv/x11drv.h | 3 - dlls/winex11.drv/xrender.c | 153 +++++++++++++++++++++---------------------- 3 files changed, 75 insertions(+), 84 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=5a2ab8364afe910493793…
1
0
0
0
Alexandre Julliard : winex11: Add a SelectFont entry point in the XRender driver.
by Alexandre Julliard
12 Sep '11
12 Sep '11
Module: wine Branch: master Commit: cbfcce1a3dd1de19cb7fade8455448ab24613e4e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cbfcce1a3dd1de19cb7fade84…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 12 11:50:42 2011 +0200 winex11: Add a SelectFont entry point in the XRender driver. --- dlls/winex11.drv/x11drv.h | 1 - dlls/winex11.drv/xfont.c | 6 ------ dlls/winex11.drv/xrender.c | 42 ++++++++++++++++++++---------------------- 3 files changed, 20 insertions(+), 29 deletions(-) diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index e8cda91..e5010b4 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -303,7 +303,6 @@ extern int client_side_antialias_with_render DECLSPEC_HIDDEN; extern int using_client_side_fonts DECLSPEC_HIDDEN; extern const struct gdi_dc_funcs *X11DRV_XRender_Init(void) DECLSPEC_HIDDEN; extern void X11DRV_XRender_Finalize(void) DECLSPEC_HIDDEN; -extern BOOL X11DRV_XRender_SelectFont(X11DRV_PDEVICE*, HFONT) DECLSPEC_HIDDEN; extern void X11DRV_XRender_SetDeviceClipping(X11DRV_PDEVICE *physDev, const RGNDATA *data) DECLSPEC_HIDDEN; extern void X11DRV_XRender_CopyBrush(X11DRV_PDEVICE *physDev, X_PHYSBITMAP *physBitmap, int width, int height) DECLSPEC_HIDDEN; extern BOOL X11DRV_XRender_ExtTextOut(X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags, diff --git a/dlls/winex11.drv/xfont.c b/dlls/winex11.drv/xfont.c index 1e6e47c..35d23d6 100644 --- a/dlls/winex11.drv/xfont.c +++ b/dlls/winex11.drv/xfont.c @@ -3238,12 +3238,6 @@ HFONT X11DRV_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont ) TRACE("gdiFont = %p\n", gdiFont); - if(gdiFont && using_client_side_fonts) { - X11DRV_XRender_SelectFont(physDev, hfont); - physDev->has_gdi_font = TRUE; - return FALSE; - } - EnterCriticalSection( &crtsc_fonts_X11 ); if(fontList == NULL) X11DRV_FONT_InitX11Metrics(); diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index e2a9858..7c70c30 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -1091,24 +1091,30 @@ void X11DRV_XRender_Finalize(void) LeaveCriticalSection(&xrender_cs); } - -/*********************************************************************** - * X11DRV_XRender_SelectFont +/********************************************************************** + * xrenderdrv_SelectFont */ -BOOL X11DRV_XRender_SelectFont(X11DRV_PDEVICE *physDev, HFONT hfont) +static HFONT xrenderdrv_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont ) { + struct xrender_physdev *physdev = get_xrender_dev( dev ); LFANDSIZE lfsz; - struct xrender_info *info; - GetObjectW(hfont, sizeof(lfsz.lf), &lfsz.lf); + if (!GetObjectW( hfont, sizeof(lfsz.lf), &lfsz.lf )) return HGDI_ERROR; + + if (!gdiFont) + { + dev = GET_NEXT_PHYSDEV( dev, pSelectFont ); + return dev->funcs->pSelectFont( dev, hfont, gdiFont ); + } + TRACE("h=%d w=%d weight=%d it=%d charset=%d name=%s\n", lfsz.lf.lfHeight, lfsz.lf.lfWidth, lfsz.lf.lfWeight, lfsz.lf.lfItalic, lfsz.lf.lfCharSet, debugstr_w(lfsz.lf.lfFaceName)); lfsz.lf.lfWidth = abs( lfsz.lf.lfWidth ); - lfsz.devsize.cx = X11DRV_XWStoDS( physDev, lfsz.lf.lfWidth ); - lfsz.devsize.cy = X11DRV_YWStoDS( physDev, lfsz.lf.lfHeight ); + lfsz.devsize.cx = X11DRV_XWStoDS( physdev->x11dev, lfsz.lf.lfWidth ); + lfsz.devsize.cy = X11DRV_YWStoDS( physdev->x11dev, lfsz.lf.lfHeight ); - GetTransform( physDev->dev.hdc, 0x204, &lfsz.xform ); + GetTransform( dev->hdc, 0x204, &lfsz.xform ); TRACE("font transform %f %f %f %f\n", lfsz.xform.eM11, lfsz.xform.eM12, lfsz.xform.eM21, lfsz.xform.eM22); @@ -1117,14 +1123,12 @@ BOOL X11DRV_XRender_SelectFont(X11DRV_PDEVICE *physDev, HFONT hfont) lfsz_calc_hash(&lfsz); - info = get_xrender_info(physDev); - if (!info) return 0; - EnterCriticalSection(&xrender_cs); - if(info->cache_index != -1) - dec_ref_cache(info->cache_index); - info->cache_index = GetCacheEntry(physDev, &lfsz); + if (physdev->info.cache_index != -1) + dec_ref_cache( physdev->info.cache_index ); + physdev->info.cache_index = GetCacheEntry( physdev->x11dev, &lfsz ); LeaveCriticalSection(&xrender_cs); + physdev->x11dev->has_gdi_font = TRUE; return 0; } @@ -2608,7 +2612,7 @@ static const struct gdi_dc_funcs xrender_funcs = xrenderdrv_SelectBitmap, /* pSelectBitmap */ NULL, /* pSelectBrush */ NULL, /* pSelectClipPath */ - NULL, /* pSelectFont */ + xrenderdrv_SelectFont, /* pSelectFont */ NULL, /* pSelectPalette */ NULL, /* pSelectPen */ NULL, /* pSetArcDirection */ @@ -2662,12 +2666,6 @@ void X11DRV_XRender_Finalize(void) { } -BOOL X11DRV_XRender_SelectFont(X11DRV_PDEVICE *physDev, HFONT hfont) -{ - assert(0); - return FALSE; -} - void X11DRV_XRender_SetDeviceClipping(X11DRV_PDEVICE *physDev, const RGNDATA *data) { assert(0);
1
0
0
0
Alexandre Julliard : winex11: Add bitmap entry points to the XRender driver .
by Alexandre Julliard
12 Sep '11
12 Sep '11
Module: wine Branch: master Commit: 225d8abec90fbd41c59ec95af5d65c22a564b9b6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=225d8abec90fbd41c59ec95af…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 12 12:12:15 2011 +0200 winex11: Add bitmap entry points to the XRender driver. --- dlls/winex11.drv/bitmap.c | 3 - dlls/winex11.drv/x11drv.h | 1 - dlls/winex11.drv/xrender.c | 101 +++++++++++++++++++++++++------------------ 3 files changed, 59 insertions(+), 46 deletions(-) diff --git a/dlls/winex11.drv/bitmap.c b/dlls/winex11.drv/bitmap.c index af6266b..6c5eb26 100644 --- a/dlls/winex11.drv/bitmap.c +++ b/dlls/winex11.drv/bitmap.c @@ -95,9 +95,6 @@ HBITMAP X11DRV_SelectBitmap( PHYSDEV dev, HBITMAP hbitmap ) if (!GetObjectW( hbitmap, sizeof(bitmap), &bitmap )) return 0; - if(physDev->xrender) - X11DRV_XRender_UpdateDrawable( physDev ); - if (hbitmap == BITMAP_stock_phys_bitmap.hbitmap) physBitmap = &BITMAP_stock_phys_bitmap; else if (!(physBitmap = X11DRV_get_phys_bitmap( hbitmap ))) return 0; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 55b4f22..e8cda91 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -313,7 +313,6 @@ extern BOOL X11DRV_XRender_SetPhysBitmapDepth(X_PHYSBITMAP *physBitmap, int bits BOOL X11DRV_XRender_GetSrcAreaStretch(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDevDst, Pixmap pixmap, GC gc, const struct bitblt_coords *src, const struct bitblt_coords *dst ) DECLSPEC_HIDDEN; -extern void X11DRV_XRender_UpdateDrawable(X11DRV_PDEVICE *physDev) DECLSPEC_HIDDEN; extern BOOL XRender_AlphaBlend( X11DRV_PDEVICE *devDst, struct bitblt_coords *dst, X11DRV_PDEVICE *devSrc, struct bitblt_coords *src, BLENDFUNCTION blendfn ) DECLSPEC_HIDDEN; diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index 3b931b2..e2a9858 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -1222,6 +1222,60 @@ static INT xrenderdrv_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID return dev->funcs->pExtEscape( dev, escape, in_count, in_data, out_count, out_data ); } +/**************************************************************************** + * xrenderdrv_CreateBitmap + */ +static BOOL xrenderdrv_CreateBitmap( PHYSDEV dev, HBITMAP hbitmap ) +{ + dev = GET_NEXT_PHYSDEV( dev, pCreateBitmap ); + return dev->funcs->pCreateBitmap( dev, hbitmap ); +} + +/**************************************************************************** + * xrenderdrv_DeleteBitmap + */ +static BOOL xrenderdrv_DeleteBitmap( HBITMAP hbitmap ) +{ + return X11DRV_DeleteBitmap( hbitmap ); +} + +/*********************************************************************** + * xrenderdrv_SelectBitmap + */ +static HBITMAP xrenderdrv_SelectBitmap( PHYSDEV dev, HBITMAP hbitmap ) +{ + HBITMAP ret; + struct xrender_physdev *physdev = get_xrender_dev( dev ); + + dev = GET_NEXT_PHYSDEV( dev, pSelectBitmap ); + ret = dev->funcs->pSelectBitmap( dev, hbitmap ); + if (ret) update_xrender_drawable( physdev ); + return ret; +} + +/*********************************************************************** + * xrenderdrv_GetImage + */ +static DWORD xrenderdrv_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info, + struct gdi_image_bits *bits, struct bitblt_coords *src ) +{ + if (hbitmap) return X11DRV_GetImage( dev, hbitmap, info, bits, src ); + dev = GET_NEXT_PHYSDEV( dev, pGetImage ); + return dev->funcs->pGetImage( dev, hbitmap, info, bits, src ); +} + +/*********************************************************************** + * xrenderdrv_PutImage + */ +static DWORD xrenderdrv_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *info, + const struct gdi_image_bits *bits, struct bitblt_coords *src, + struct bitblt_coords *dst, DWORD rop ) +{ + if (hbitmap) return X11DRV_PutImage( dev, hbitmap, clip, info, bits, src, dst, rop ); + dev = GET_NEXT_PHYSDEV( dev, pPutImage ); + return dev->funcs->pPutImage( dev, hbitmap, clip, info, bits, src, dst, rop ); +} + BOOL X11DRV_XRender_SetPhysBitmapDepth(X_PHYSBITMAP *physBitmap, int bits_pixel, const DIBSECTION *dib) { const WineXRenderFormat *fmt; @@ -1295,37 +1349,6 @@ BOOL X11DRV_XRender_SetPhysBitmapDepth(X_PHYSBITMAP *physBitmap, int bits_pixel, return TRUE; } -/*********************************************************************** - * X11DRV_XRender_UpdateDrawable - * - * Deletes the pict and tile when the drawable changes. - */ -void X11DRV_XRender_UpdateDrawable(X11DRV_PDEVICE *physDev) -{ - struct xrender_info *info = physDev->xrender; - - if (info->pict || info->pict_src) - { - wine_tsx11_lock(); - XFlush( gdi_display ); - if (info->pict) - { - TRACE("freeing pict = %lx dc = %p\n", info->pict, physDev->dev.hdc); - pXRenderFreePicture(gdi_display, info->pict); - info->pict = 0; - } - if(info->pict_src) - { - TRACE("freeing pict = %lx dc = %p\n", info->pict_src, physDev->dev.hdc); - pXRenderFreePicture(gdi_display, info->pict_src); - info->pict_src = 0; - } - wine_tsx11_unlock(); - } - - info->format = NULL; -} - /************************************************************************ * UploadGlyph * @@ -2516,11 +2539,11 @@ static const struct gdi_dc_funcs xrender_funcs = NULL, /* pChoosePixelFormat */ NULL, /* pChord */ NULL, /* pCloseFigure */ - NULL, /* pCreateBitmap */ + xrenderdrv_CreateBitmap, /* pCreateBitmap */ xrenderdrv_CreateCompatibleDC, /* pCreateCompatibleDC */ xrenderdrv_CreateDC, /* pCreateDC */ NULL, /* pCreateDIBSection */ - NULL, /* pDeleteBitmap */ + xrenderdrv_DeleteBitmap, /* pDeleteBitmap */ xrenderdrv_DeleteDC, /* pDeleteDC */ NULL, /* pDeleteObject */ NULL, /* pDescribePixelFormat */ @@ -2546,7 +2569,7 @@ static const struct gdi_dc_funcs xrender_funcs = NULL, /* pGetDeviceCaps */ NULL, /* pGetDeviceGammaRamp */ NULL, /* pGetICMProfile */ - NULL, /* pGetImage */ + xrenderdrv_GetImage, /* pGetImage */ NULL, /* pGetNearestColor */ NULL, /* pGetPixel */ NULL, /* pGetPixelFormat */ @@ -2572,7 +2595,7 @@ static const struct gdi_dc_funcs xrender_funcs = NULL, /* pPolygon */ NULL, /* pPolyline */ NULL, /* pPolylineTo */ - NULL, /* pPutImage */ + xrenderdrv_PutImage, /* pPutImage */ NULL, /* pRealizeDefaultPalette */ NULL, /* pRealizePalette */ NULL, /* pRectangle */ @@ -2582,7 +2605,7 @@ static const struct gdi_dc_funcs xrender_funcs = NULL, /* pSaveDC */ NULL, /* pScaleViewportExt */ NULL, /* pScaleWindowExt */ - NULL, /* pSelectBitmap */ + xrenderdrv_SelectBitmap, /* pSelectBitmap */ NULL, /* pSelectBrush */ NULL, /* pSelectClipPath */ NULL, /* pSelectFont */ @@ -2659,12 +2682,6 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag return FALSE; } -void X11DRV_XRender_UpdateDrawable(X11DRV_PDEVICE *physDev) -{ - assert(0); - return; -} - BOOL XRender_AlphaBlend( X11DRV_PDEVICE *devDst, struct bitblt_coords *dst, X11DRV_PDEVICE *devSrc, struct bitblt_coords *src, BLENDFUNCTION blendfn ) {
1
0
0
0
Alexandre Julliard : winex11: Add an ExtEscape entry point in the XRender driver.
by Alexandre Julliard
12 Sep '11
12 Sep '11
Module: wine Branch: master Commit: 89d8d1d427a322661970853026855fadc4dc317e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=89d8d1d427a32266197085302…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 12 12:04:41 2011 +0200 winex11: Add an ExtEscape entry point in the XRender driver. --- dlls/winex11.drv/init.c | 1 - dlls/winex11.drv/xrender.c | 31 ++++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index b0592fa..db430ec 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -358,7 +358,6 @@ static INT X11DRV_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in_d if (in_count >= sizeof(struct x11drv_escape_set_drawable)) { const struct x11drv_escape_set_drawable *data = in_data; - if(physDev->xrender) X11DRV_XRender_UpdateDrawable( physDev ); physDev->dc_rect = data->dc_rect; physDev->drawable = data->drawable; physDev->drawable_rect = data->drawable_rect; diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index f5c37fe..3b931b2 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -646,6 +646,13 @@ static void free_xrender_picture( struct xrender_physdev *dev ) dev->info.format = NULL; } +static void update_xrender_drawable( struct xrender_physdev *dev ) +{ + free_xrender_picture( dev ); + dev->info.format = get_xrender_format_from_color_shifts( dev->x11dev->depth, + dev->x11dev->color_shifts ); +} + /* return a mask picture used to force alpha to 0 */ static Picture get_no_alpha_mask(void) { @@ -1193,6 +1200,28 @@ static BOOL xrenderdrv_DeleteDC( PHYSDEV dev ) return TRUE; } +/********************************************************************** + * xrenderdrv_ExtEscape + */ +static INT xrenderdrv_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in_data, + INT out_count, LPVOID out_data ) +{ + struct xrender_physdev *physdev = get_xrender_dev( dev ); + + dev = GET_NEXT_PHYSDEV( dev, pExtEscape ); + + if (escape == X11DRV_ESCAPE && in_data && in_count >= sizeof(enum x11drv_escape_codes)) + { + if (*(const enum x11drv_escape_codes *)in_data == X11DRV_SET_DRAWABLE) + { + BOOL ret = dev->funcs->pExtEscape( dev, escape, in_count, in_data, out_count, out_data ); + if (ret) update_xrender_drawable( physdev ); + return ret; + } + } + return dev->funcs->pExtEscape( dev, escape, in_count, in_data, out_count, out_data ); +} + BOOL X11DRV_XRender_SetPhysBitmapDepth(X_PHYSBITMAP *physBitmap, int bits_pixel, const DIBSECTION *dib) { const WineXRenderFormat *fmt; @@ -2504,7 +2533,7 @@ static const struct gdi_dc_funcs xrender_funcs = NULL, /* pEnumICMProfiles */ NULL, /* pExcludeClipRect */ NULL, /* pExtDeviceMode */ - NULL, /* pExtEscape */ + xrenderdrv_ExtEscape, /* pExtEscape */ NULL, /* pExtFloodFill */ NULL, /* pExtSelectClipRgn */ NULL, /* pExtTextOut */
1
0
0
0
← Newer
1
...
59
60
61
62
63
64
65
...
100
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Results per page:
10
25
50
100
200