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
d87adf2a
Commit
d87adf2a
authored
Aug 28, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Aug 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Don't use IPicture to manage the HDC associated with a GpBitmap.
parent
e48524ce
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
12 deletions
+14
-12
brush.c
dlls/gdiplus/brush.c
+1
-1
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+1
-0
image.c
dlls/gdiplus/image.c
+12
-11
No files found.
dlls/gdiplus/brush.c
View file @
d87adf2a
...
@@ -672,7 +672,7 @@ GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage *image,
...
@@ -672,7 +672,7 @@ GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage *image,
hbm
=
((
GpBitmap
*
)
image
)
->
hbitmap
;
hbm
=
((
GpBitmap
*
)
image
)
->
hbitmap
;
if
(
!
hbm
)
return
GenericError
;
if
(
!
hbm
)
return
GenericError
;
IPicture_get_CurDC
(
image
->
picture
,
&
hdc
)
;
hdc
=
((
GpBitmap
*
)
image
)
->
hdc
;
bm_is_selected
=
(
hdc
!=
0
);
bm_is_selected
=
(
hdc
!=
0
);
pbmi
=
GdipAlloc
(
sizeof
(
BITMAPINFOHEADER
)
+
256
*
sizeof
(
RGBQUAD
));
pbmi
=
GdipAlloc
(
sizeof
(
BITMAPINFOHEADER
)
+
256
*
sizeof
(
RGBQUAD
));
...
...
dlls/gdiplus/gdiplus_private.h
View file @
d87adf2a
...
@@ -223,6 +223,7 @@ struct GpBitmap{
...
@@ -223,6 +223,7 @@ struct GpBitmap{
INT
numlocks
;
INT
numlocks
;
BYTE
*
bitmapbits
;
/* pointer to the buffer we passed in BitmapLockBits */
BYTE
*
bitmapbits
;
/* pointer to the buffer we passed in BitmapLockBits */
HBITMAP
hbitmap
;
HBITMAP
hbitmap
;
HDC
hdc
;
};
};
struct
GpCachedBitmap
{
struct
GpCachedBitmap
{
...
...
dlls/gdiplus/image.c
View file @
d87adf2a
...
@@ -168,7 +168,7 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect,
...
@@ -168,7 +168,7 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect,
return
WrongState
;
return
WrongState
;
hbm
=
bitmap
->
hbitmap
;
hbm
=
bitmap
->
hbitmap
;
IPicture_get_CurDC
(
bitmap
->
image
.
picture
,
&
hdc
)
;
hdc
=
bitmap
->
hdc
;
bm_is_selected
=
(
hdc
!=
0
);
bm_is_selected
=
(
hdc
!=
0
);
pbmi
=
GdipAlloc
(
sizeof
(
BITMAPINFOHEADER
)
+
256
*
sizeof
(
RGBQUAD
));
pbmi
=
GdipAlloc
(
sizeof
(
BITMAPINFOHEADER
)
+
256
*
sizeof
(
RGBQUAD
));
...
@@ -264,7 +264,7 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap,
...
@@ -264,7 +264,7 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap,
}
}
hbm
=
bitmap
->
hbitmap
;
hbm
=
bitmap
->
hbitmap
;
IPicture_get_CurDC
(
bitmap
->
image
.
picture
,
&
hdc
)
;
hdc
=
bitmap
->
hdc
;
bm_is_selected
=
(
hdc
!=
0
);
bm_is_selected
=
(
hdc
!=
0
);
pbmi
=
GdipAlloc
(
sizeof
(
BITMAPINFOHEADER
)
+
256
*
sizeof
(
RGBQUAD
));
pbmi
=
GdipAlloc
(
sizeof
(
BITMAPINFOHEADER
)
+
256
*
sizeof
(
RGBQUAD
));
...
@@ -588,6 +588,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHICON(HICON hicon, GpBitmap** bitmap)
...
@@ -588,6 +588,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHICON(HICON hicon, GpBitmap** bitmap)
(
*
bitmap
)
->
width
=
ipicture_pixel_width
((
*
bitmap
)
->
image
.
picture
);
(
*
bitmap
)
->
width
=
ipicture_pixel_width
((
*
bitmap
)
->
image
.
picture
);
(
*
bitmap
)
->
height
=
ipicture_pixel_height
((
*
bitmap
)
->
image
.
picture
);
(
*
bitmap
)
->
height
=
ipicture_pixel_height
((
*
bitmap
)
->
image
.
picture
);
(
*
bitmap
)
->
hbitmap
=
NULL
;
(
*
bitmap
)
->
hbitmap
=
NULL
;
(
*
bitmap
)
->
hdc
=
NULL
;
DeleteObject
(
iinfo
.
hbmColor
);
DeleteObject
(
iinfo
.
hbmColor
);
DeleteObject
(
iinfo
.
hbmMask
);
DeleteObject
(
iinfo
.
hbmMask
);
...
@@ -689,6 +690,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
...
@@ -689,6 +690,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
(
*
bitmap
)
->
height
=
height
;
(
*
bitmap
)
->
height
=
height
;
(
*
bitmap
)
->
format
=
format
;
(
*
bitmap
)
->
format
=
format
;
IPicture_get_Handle
((
*
bitmap
)
->
image
.
picture
,
(
OLE_HANDLE
*
)
&
(
*
bitmap
)
->
hbitmap
);
IPicture_get_Handle
((
*
bitmap
)
->
image
.
picture
,
(
OLE_HANDLE
*
)
&
(
*
bitmap
)
->
hbitmap
);
IPicture_get_CurDC
((
*
bitmap
)
->
image
.
picture
,
&
(
*
bitmap
)
->
hdc
);
return
Ok
;
return
Ok
;
}
}
...
@@ -786,18 +788,17 @@ GpStatus WINGDIPAPI GdipEmfToWmfBits(HENHMETAFILE hemf, UINT cbData16,
...
@@ -786,18 +788,17 @@ GpStatus WINGDIPAPI GdipEmfToWmfBits(HENHMETAFILE hemf, UINT cbData16,
GpStatus
WINGDIPAPI
GdipDisposeImage
(
GpImage
*
image
)
GpStatus
WINGDIPAPI
GdipDisposeImage
(
GpImage
*
image
)
{
{
HDC
hdc
;
TRACE
(
"%p
\n
"
,
image
);
TRACE
(
"%p
\n
"
,
image
);
if
(
!
image
)
if
(
!
image
)
return
InvalidParameter
;
return
InvalidParameter
;
IPicture_get_CurDC
(
image
->
picture
,
&
hdc
);
DeleteDC
(
hdc
);
IPicture_Release
(
image
->
picture
);
IPicture_Release
(
image
->
picture
);
if
(
image
->
type
==
ImageTypeBitmap
)
if
(
image
->
type
==
ImageTypeBitmap
)
{
GdipFree
(((
GpBitmap
*
)
image
)
->
bitmapbits
);
GdipFree
(((
GpBitmap
*
)
image
)
->
bitmapbits
);
DeleteDC
(((
GpBitmap
*
)
image
)
->
hdc
);
}
GdipFree
(
image
);
GdipFree
(
image
);
return
Ok
;
return
Ok
;
...
@@ -889,11 +890,12 @@ GpStatus WINGDIPAPI GdipGetImageGraphicsContext(GpImage *image,
...
@@ -889,11 +890,12 @@ GpStatus WINGDIPAPI GdipGetImageGraphicsContext(GpImage *image,
return
NotImplemented
;
return
NotImplemented
;
}
}
IPicture_get_CurDC
(
image
->
picture
,
&
hdc
)
;
hdc
=
((
GpBitmap
*
)
image
)
->
hdc
;
if
(
!
hdc
){
if
(
!
hdc
){
hdc
=
CreateCompatibleDC
(
0
);
hdc
=
CreateCompatibleDC
(
0
);
IPicture_SelectPicture
(
image
->
picture
,
hdc
,
NULL
,
NULL
);
SelectObject
(
hdc
,
((
GpBitmap
*
)
image
)
->
hbitmap
);
((
GpBitmap
*
)
image
)
->
hdc
=
hdc
;
}
}
return
GdipCreateFromHDC
(
hdc
,
graphics
);
return
GdipCreateFromHDC
(
hdc
,
graphics
);
...
@@ -1264,6 +1266,7 @@ static GpStatus decode_image_olepicture_bitmap(IStream* stream, REFCLSID clsid,
...
@@ -1264,6 +1266,7 @@ static GpStatus decode_image_olepicture_bitmap(IStream* stream, REFCLSID clsid,
IPicture_get_CurDC
(
pic
,
&
hdc
);
IPicture_get_CurDC
(
pic
,
&
hdc
);
(
*
((
GpBitmap
**
)
image
))
->
hbitmap
=
hbm
;
(
*
((
GpBitmap
**
)
image
))
->
hbitmap
=
hbm
;
(
*
((
GpBitmap
**
)
image
))
->
hdc
=
hdc
;
bmch
=
(
BITMAPCOREHEADER
*
)
(
&
pbmi
->
bmiHeader
);
bmch
=
(
BITMAPCOREHEADER
*
)
(
&
pbmi
->
bmiHeader
);
bmch
->
bcSize
=
sizeof
(
BITMAPCOREHEADER
);
bmch
->
bcSize
=
sizeof
(
BITMAPCOREHEADER
);
...
@@ -1583,9 +1586,7 @@ GpStatus WINGDIPAPI GdipSaveImageToStream(GpImage *image, IStream* stream,
...
@@ -1583,9 +1586,7 @@ GpStatus WINGDIPAPI GdipSaveImageToStream(GpImage *image, IStream* stream,
hbmp
=
((
GpBitmap
*
)
image
)
->
hbitmap
;
hbmp
=
((
GpBitmap
*
)
image
)
->
hbitmap
;
if
(
!
hbmp
)
if
(
!
hbmp
)
return
GenericError
;
return
GenericError
;
hr
=
IPicture_get_CurDC
(
image
->
picture
,
&
hdc
);
hdc
=
((
GpBitmap
*
)
image
)
->
hdc
;
if
(
FAILED
(
hr
))
return
GenericError
;
bm_is_selected
=
(
hdc
!=
0
);
bm_is_selected
=
(
hdc
!=
0
);
if
(
!
bm_is_selected
)
{
if
(
!
bm_is_selected
)
{
hdc
=
CreateCompatibleDC
(
0
);
hdc
=
CreateCompatibleDC
(
0
);
...
...
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