Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
44c57121
Commit
44c57121
authored
Jul 07, 2011
by
Vincent Povirk
Committed by
Alexandre Julliard
Jul 08, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement GetDC for metafiles.
parent
fd747554
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
14 deletions
+60
-14
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+2
-0
graphics.c
dlls/gdiplus/graphics.c
+25
-11
metafile.c
dlls/gdiplus/metafile.c
+30
-0
metafile.c
dlls/gdiplus/tests/metafile.c
+3
-3
No files found.
dlls/gdiplus/gdiplus_private.h
View file @
44c57121
...
...
@@ -52,6 +52,8 @@ extern REAL convert_unit(REAL logpixels, GpUnit unit) DECLSPEC_HIDDEN;
extern
GpStatus
graphics_from_image
(
GpImage
*
image
,
GpGraphics
**
graphics
)
DECLSPEC_HIDDEN
;
extern
GpStatus
METAFILE_GetGraphicsContext
(
GpMetafile
*
metafile
,
GpGraphics
**
result
)
DECLSPEC_HIDDEN
;
extern
GpStatus
METAFILE_GetDC
(
GpMetafile
*
metafile
,
HDC
*
hdc
)
DECLSPEC_HIDDEN
;
extern
GpStatus
METAFILE_ReleaseDC
(
GpMetafile
*
metafile
,
HDC
hdc
)
DECLSPEC_HIDDEN
;
extern
GpStatus
METAFILE_GraphicsDeleted
(
GpMetafile
*
metafile
)
DECLSPEC_HIDDEN
;
extern
void
calc_curve_bezier
(
CONST
GpPointF
*
pts
,
REAL
tension
,
REAL
*
x1
,
...
...
dlls/gdiplus/graphics.c
View file @
44c57121
...
...
@@ -5311,6 +5311,8 @@ static const COLORREF DC_BACKGROUND_KEY = 0x0c0b0d;
GpStatus
WINGDIPAPI
GdipGetDC
(
GpGraphics
*
graphics
,
HDC
*
hdc
)
{
GpStatus
stat
=
Ok
;
TRACE
(
"(%p, %p)
\n
"
,
graphics
,
hdc
);
if
(
!
graphics
||
!
hdc
)
...
...
@@ -5319,13 +5321,16 @@ GpStatus WINGDIPAPI GdipGetDC(GpGraphics *graphics, HDC *hdc)
if
(
graphics
->
busy
)
return
ObjectBusy
;
if
(
!
graphics
->
hdc
||
if
(
graphics
->
image
&&
graphics
->
image
->
type
==
ImageTypeMetafile
)
{
stat
=
METAFILE_GetDC
((
GpMetafile
*
)
graphics
->
image
,
hdc
);
}
else
if
(
!
graphics
->
hdc
||
(
graphics
->
image
&&
graphics
->
image
->
type
==
ImageTypeBitmap
&&
((
GpBitmap
*
)
graphics
->
image
)
->
format
&
PixelFormatAlpha
))
{
/* Create a fake HDC and fill it with a constant color. */
HDC
temp_hdc
;
HBITMAP
hbitmap
;
GpStatus
stat
;
GpRectF
bounds
;
BITMAPINFOHEADER
bmih
;
int
i
;
...
...
@@ -5374,22 +5379,26 @@ GpStatus WINGDIPAPI GdipGetDC(GpGraphics *graphics, HDC *hdc)
*
hdc
=
graphics
->
hdc
;
}
graphics
->
busy
=
TRUE
;
if
(
stat
==
Ok
)
graphics
->
busy
=
TRUE
;
return
Ok
;
return
stat
;
}
GpStatus
WINGDIPAPI
GdipReleaseDC
(
GpGraphics
*
graphics
,
HDC
hdc
)
{
TRACE
(
"(%p, %p)
\n
"
,
graphics
,
hdc
)
;
GpStatus
stat
=
Ok
;
if
(
!
graphics
||
!
hdc
)
return
InvalidParameter
;
TRACE
(
"(%p, %p)
\n
"
,
graphics
,
hdc
);
if
(
(
graphics
->
hdc
!=
hdc
&&
graphics
->
temp_hdc
!=
hdc
)
||
!
(
graphics
->
busy
)
)
if
(
!
graphics
||
!
hdc
||
!
graphics
->
busy
)
return
InvalidParameter
;
if
(
graphics
->
temp_hdc
==
hdc
)
if
(
graphics
->
image
&&
graphics
->
image
->
type
==
ImageTypeMetafile
)
{
stat
=
METAFILE_ReleaseDC
((
GpMetafile
*
)
graphics
->
image
,
hdc
);
}
else
if
(
graphics
->
temp_hdc
==
hdc
)
{
DWORD
*
pos
;
int
i
;
...
...
@@ -5416,10 +5425,15 @@ GpStatus WINGDIPAPI GdipReleaseDC(GpGraphics *graphics, HDC hdc)
graphics
->
temp_hdc
=
NULL
;
graphics
->
temp_hbitmap
=
NULL
;
}
else
if
(
hdc
!=
graphics
->
hdc
)
{
stat
=
InvalidParameter
;
}
graphics
->
busy
=
FALSE
;
if
(
stat
==
Ok
)
graphics
->
busy
=
FALSE
;
return
Ok
;
return
stat
;
}
GpStatus
WINGDIPAPI
GdipGetClip
(
GpGraphics
*
graphics
,
GpRegion
*
region
)
...
...
dlls/gdiplus/metafile.c
View file @
44c57121
...
...
@@ -297,6 +297,36 @@ GpStatus METAFILE_GetGraphicsContext(GpMetafile* metafile, GpGraphics **result)
return
stat
;
}
GpStatus
METAFILE_GetDC
(
GpMetafile
*
metafile
,
HDC
*
hdc
)
{
if
(
metafile
->
metafile_type
==
MetafileTypeEmfPlusOnly
||
metafile
->
metafile_type
==
MetafileTypeEmfPlusDual
)
{
EmfPlusRecordHeader
*
record
;
GpStatus
stat
;
stat
=
METAFILE_AllocateRecord
(
metafile
,
sizeof
(
EmfPlusRecordHeader
),
(
void
**
)
&
record
);
if
(
stat
!=
Ok
)
return
stat
;
record
->
Type
=
EmfPlusRecordTypeGetDC
;
record
->
Flags
=
0
;
METAFILE_WriteRecords
(
metafile
);
}
*
hdc
=
metafile
->
record_dc
;
return
Ok
;
}
GpStatus
METAFILE_ReleaseDC
(
GpMetafile
*
metafile
,
HDC
hdc
)
{
if
(
hdc
!=
metafile
->
record_dc
)
return
InvalidParameter
;
return
Ok
;
}
GpStatus
METAFILE_GraphicsDeleted
(
GpMetafile
*
metafile
)
{
GpStatus
stat
;
...
...
dlls/gdiplus/tests/metafile.c
View file @
44c57121
...
...
@@ -278,9 +278,9 @@ static void test_empty(void)
static
const
emfplus_record
getdc_records
[]
=
{
{
0
,
EMR_HEADER
},
{
0
,
EmfPlusRecordTypeHeader
},
{
1
,
EmfPlusRecordTypeGetDC
},
{
1
,
EMR_CREATEBRUSHINDIRECT
},
{
1
,
EMR_SELECTOBJECT
},
{
0
,
EmfPlusRecordTypeGetDC
},
{
0
,
EMR_CREATEBRUSHINDIRECT
},
{
0
,
EMR_SELECTOBJECT
},
{
0
,
EMR_RECTANGLE
},
{
0
,
EMR_SELECTOBJECT
},
{
0
,
EMR_DELETEOBJECT
},
...
...
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