Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
5178c8b1
Commit
5178c8b1
authored
Jul 22, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 22, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Update cached bitmap size on Resize() as well.
parent
a66ba895
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
8 deletions
+32
-8
gdiinterop.c
dlls/dwrite/gdiinterop.c
+8
-8
font.c
dlls/dwrite/tests/font.c
+24
-0
No files found.
dlls/dwrite/gdiinterop.c
View file @
5178c8b1
...
...
@@ -47,12 +47,15 @@ struct rendertarget {
HDC
hdc
;
};
static
HRESULT
create_target_dibsection
(
HDC
hdc
,
UINT32
width
,
UINT32
height
)
static
HRESULT
create_target_dibsection
(
struct
rendertarget
*
target
,
UINT32
width
,
UINT32
height
)
{
char
bmibuf
[
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
])];
BITMAPINFO
*
bmi
=
(
BITMAPINFO
*
)
bmibuf
;
HBITMAP
hbm
;
target
->
size
.
cx
=
width
;
target
->
size
.
cy
=
height
;
memset
(
bmi
,
0
,
sizeof
(
bmibuf
));
bmi
->
bmiHeader
.
biSize
=
sizeof
(
bmi
->
bmiHeader
);
bmi
->
bmiHeader
.
biHeight
=
-
height
;
...
...
@@ -61,11 +64,11 @@ static HRESULT create_target_dibsection(HDC hdc, UINT32 width, UINT32 height)
bmi
->
bmiHeader
.
biPlanes
=
1
;
bmi
->
bmiHeader
.
biCompression
=
BI_RGB
;
hbm
=
CreateDIBSection
(
hdc
,
bmi
,
DIB_RGB_COLORS
,
NULL
,
NULL
,
0
);
hbm
=
CreateDIBSection
(
target
->
hdc
,
bmi
,
DIB_RGB_COLORS
,
NULL
,
NULL
,
0
);
if
(
!
hbm
)
hbm
=
CreateBitmap
(
1
,
1
,
1
,
1
,
NULL
);
DeleteObject
(
SelectObject
(
hdc
,
hbm
));
DeleteObject
(
SelectObject
(
target
->
hdc
,
hbm
));
return
S_OK
;
}
...
...
@@ -199,7 +202,7 @@ static HRESULT WINAPI rendertarget_Resize(IDWriteBitmapRenderTarget1 *iface, UIN
if
(
This
->
size
.
cx
==
width
&&
This
->
size
.
cy
==
height
)
return
S_OK
;
return
create_target_dibsection
(
This
->
hdc
,
width
,
height
);
return
create_target_dibsection
(
This
,
width
,
height
);
}
static
DWRITE_TEXT_ANTIALIAS_MODE
WINAPI
rendertarget_GetTextAntialiasMode
(
IDWriteBitmapRenderTarget1
*
iface
)
...
...
@@ -251,11 +254,8 @@ static HRESULT create_rendertarget(HDC hdc, UINT32 width, UINT32 height, IDWrite
target
->
IDWriteBitmapRenderTarget1_iface
.
lpVtbl
=
&
rendertargetvtbl
;
target
->
ref
=
1
;
target
->
size
.
cx
=
width
;
target
->
size
.
cy
=
height
;
target
->
hdc
=
CreateCompatibleDC
(
hdc
);
hr
=
create_target_dibsection
(
target
->
hdc
,
width
,
height
);
hr
=
create_target_dibsection
(
target
,
width
,
height
);
if
(
FAILED
(
hr
))
{
IDWriteBitmapRenderTarget1_Release
(
&
target
->
IDWriteBitmapRenderTarget1_iface
);
return
hr
;
...
...
dlls/dwrite/tests/font.c
View file @
5178c8b1
...
...
@@ -849,18 +849,36 @@ if (0) /* crashes on native */
hr
=
IDWriteBitmapRenderTarget_Resize
(
target
,
5
,
5
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
size
.
cx
=
size
.
cy
=
-
1
;
hr
=
IDWriteBitmapRenderTarget_GetSize
(
target
,
&
size
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
size
.
cx
==
5
,
"got %d
\n
"
,
size
.
cx
);
ok
(
size
.
cy
==
5
,
"got %d
\n
"
,
size
.
cy
);
hbm2
=
GetCurrentObject
(
hdc
,
OBJ_BITMAP
);
ok
(
hbm2
!=
hbm
,
"got %p, %p
\n
"
,
hbm2
,
hbm
);
hr
=
IDWriteBitmapRenderTarget_Resize
(
target
,
20
,
5
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
size
.
cx
=
size
.
cy
=
-
1
;
hr
=
IDWriteBitmapRenderTarget_GetSize
(
target
,
&
size
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
size
.
cx
==
20
,
"got %d
\n
"
,
size
.
cx
);
ok
(
size
.
cy
==
5
,
"got %d
\n
"
,
size
.
cy
);
hbm2
=
GetCurrentObject
(
hdc
,
OBJ_BITMAP
);
ok
(
hbm2
!=
hbm
,
"got %p, %p
\n
"
,
hbm2
,
hbm
);
hr
=
IDWriteBitmapRenderTarget_Resize
(
target
,
1
,
5
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
size
.
cx
=
size
.
cy
=
-
1
;
hr
=
IDWriteBitmapRenderTarget_GetSize
(
target
,
&
size
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
size
.
cx
==
1
,
"got %d
\n
"
,
size
.
cx
);
ok
(
size
.
cy
==
5
,
"got %d
\n
"
,
size
.
cy
);
hbm2
=
GetCurrentObject
(
hdc
,
OBJ_BITMAP
);
ok
(
hbm2
!=
hbm
,
"got %p, %p
\n
"
,
hbm2
,
hbm
);
...
...
@@ -876,6 +894,12 @@ if (0) /* crashes on native */
hr
=
IDWriteBitmapRenderTarget_Resize
(
target
,
0
,
5
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
size
.
cx
=
size
.
cy
=
-
1
;
hr
=
IDWriteBitmapRenderTarget_GetSize
(
target
,
&
size
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
size
.
cx
==
0
,
"got %d
\n
"
,
size
.
cx
);
ok
(
size
.
cy
==
5
,
"got %d
\n
"
,
size
.
cy
);
hbm2
=
GetCurrentObject
(
hdc
,
OBJ_BITMAP
);
ok
(
hbm2
!=
hbm
,
"got %p, %p
\n
"
,
hbm2
,
hbm
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment