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
df367c33
Commit
df367c33
authored
Oct 18, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Oct 18, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Reimplement GdipCloneBitmapArea without using GdipBitmapLockBits.
parent
5e78e0b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
29 deletions
+5
-29
image.c
dlls/gdiplus/image.c
+5
-28
image.c
dlls/gdiplus/tests/image.c
+0
-1
No files found.
dlls/gdiplus/image.c
View file @
df367c33
...
...
@@ -1224,9 +1224,6 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap,
GpStatus
WINGDIPAPI
GdipCloneBitmapArea
(
REAL
x
,
REAL
y
,
REAL
width
,
REAL
height
,
PixelFormat
format
,
GpBitmap
*
srcBitmap
,
GpBitmap
**
dstBitmap
)
{
BitmapData
lockeddata_src
,
lockeddata_dst
;
int
i
;
UINT
row_size
;
Rect
area
;
GpStatus
stat
;
...
...
@@ -1248,39 +1245,19 @@ GpStatus WINGDIPAPI GdipCloneBitmapArea(REAL x, REAL y, REAL width, REAL height,
area
.
Width
=
gdip_round
(
width
);
area
.
Height
=
gdip_round
(
height
);
stat
=
GdipBitmapLockBits
(
srcBitmap
,
&
area
,
ImageLockModeRead
,
format
,
&
lockeddata_src
);
if
(
stat
!=
Ok
)
return
stat
;
stat
=
GdipCreateBitmapFromScan0
(
lockeddata_src
.
Width
,
lockeddata_src
.
Height
,
0
,
lockeddata_src
.
PixelFormat
,
NULL
,
dstBitmap
);
stat
=
GdipCreateBitmapFromScan0
(
area
.
Width
,
area
.
Height
,
0
,
format
,
NULL
,
dstBitmap
);
if
(
stat
==
Ok
)
{
stat
=
GdipBitmapLockBits
(
*
dstBitmap
,
NULL
,
ImageLockModeWrite
,
lockeddata_src
.
PixelFormat
,
&
lockeddata_dst
);
if
(
stat
==
Ok
)
{
/* copy the image data */
row_size
=
(
lockeddata_src
.
Width
*
PIXELFORMATBPP
(
lockeddata_src
.
PixelFormat
)
+
7
)
/
8
;
for
(
i
=
0
;
i
<
lockeddata_src
.
Height
;
i
++
)
memcpy
((
BYTE
*
)
lockeddata_dst
.
Scan0
+
lockeddata_dst
.
Stride
*
i
,
(
BYTE
*
)
lockeddata_src
.
Scan0
+
lockeddata_src
.
Stride
*
i
,
row_size
);
GdipBitmapUnlockBits
(
*
dstBitmap
,
&
lockeddata_dst
);
}
stat
=
convert_pixels
(
area
.
Width
,
area
.
Height
,
(
*
dstBitmap
)
->
stride
,
(
*
dstBitmap
)
->
bits
,
(
*
dstBitmap
)
->
format
,
srcBitmap
->
stride
,
srcBitmap
->
bits
+
srcBitmap
->
stride
*
area
.
Y
+
PIXELFORMATBPP
(
srcBitmap
->
format
)
*
area
.
X
/
8
,
srcBitmap
->
format
,
srcBitmap
->
image
.
palette
);
if
(
stat
!=
Ok
)
GdipDisposeImage
((
GpImage
*
)
*
dstBitmap
);
}
GdipBitmapUnlockBits
(
srcBitmap
,
&
lockeddata_src
);
if
(
stat
!=
Ok
)
{
*
dstBitmap
=
NULL
;
}
return
stat
;
}
...
...
dlls/gdiplus/tests/image.c
View file @
df367c33
...
...
@@ -4257,7 +4257,6 @@ static void test_CloneBitmapArea(void)
expect
(
WrongState
,
status
);
status
=
GdipCloneBitmapAreaI
(
0
,
0
,
1
,
1
,
PixelFormat24bppRGB
,
bitmap
,
&
copy
);
todo_wine
expect
(
Ok
,
status
);
status
=
GdipBitmapUnlockBits
(
bitmap
,
&
data
);
...
...
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