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
517059f3
Commit
517059f3
authored
Jul 02, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Aug 23, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Set bitmap has alpha flag based on format.
parent
18a4e243
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
113 additions
and
0 deletions
+113
-0
image.c
dlls/gdiplus/image.c
+4
-0
image.c
dlls/gdiplus/tests/image.c
+109
-0
No files found.
dlls/gdiplus/image.c
View file @
517059f3
...
...
@@ -1742,6 +1742,10 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
(
*
bitmap
)
->
stride
=
dib_stride
;
(
*
bitmap
)
->
own_bits
=
own_bits
;
/* set format-related flags */
if
(
format
&
(
PixelFormatAlpha
|
PixelFormatPAlpha
|
PixelFormatIndexed
))
(
*
bitmap
)
->
image
.
flags
|=
ImageFlagsHasAlpha
;
if
(
format
==
PixelFormat1bppIndexed
||
format
==
PixelFormat4bppIndexed
||
format
==
PixelFormat8bppIndexed
)
...
...
dlls/gdiplus/tests/image.c
View file @
517059f3
...
...
@@ -734,6 +734,115 @@ static void test_GdipGetImageFlags(void)
stat
=
GdipGetImageFlags
(
img
,
NULL
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat1bppIndexed
,
NULL
,
(
GpBitmap
**
)
&
img
);
expect
(
Ok
,
stat
);
stat
=
GdipGetImageFlags
(
img
,
&
flags
);
expect
(
Ok
,
stat
);
expect
(
ImageFlagsHasAlpha
,
flags
);
GdipDisposeImage
(
img
);
stat
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat4bppIndexed
,
NULL
,
(
GpBitmap
**
)
&
img
);
expect
(
Ok
,
stat
);
stat
=
GdipGetImageFlags
(
img
,
&
flags
);
expect
(
Ok
,
stat
);
expect
(
ImageFlagsHasAlpha
,
flags
);
GdipDisposeImage
(
img
);
stat
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat8bppIndexed
,
NULL
,
(
GpBitmap
**
)
&
img
);
expect
(
Ok
,
stat
);
stat
=
GdipGetImageFlags
(
img
,
&
flags
);
expect
(
Ok
,
stat
);
expect
(
ImageFlagsHasAlpha
,
flags
);
GdipDisposeImage
(
img
);
stat
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat16bppGrayScale
,
NULL
,
(
GpBitmap
**
)
&
img
);
expect
(
Ok
,
stat
);
stat
=
GdipGetImageFlags
(
img
,
&
flags
);
expect
(
Ok
,
stat
);
expect
(
ImageFlagsNone
,
flags
);
GdipDisposeImage
(
img
);
stat
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat16bppRGB555
,
NULL
,
(
GpBitmap
**
)
&
img
);
expect
(
Ok
,
stat
);
stat
=
GdipGetImageFlags
(
img
,
&
flags
);
expect
(
Ok
,
stat
);
expect
(
ImageFlagsNone
,
flags
);
GdipDisposeImage
(
img
);
stat
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat16bppRGB565
,
NULL
,
(
GpBitmap
**
)
&
img
);
expect
(
Ok
,
stat
);
stat
=
GdipGetImageFlags
(
img
,
&
flags
);
expect
(
Ok
,
stat
);
expect
(
ImageFlagsNone
,
flags
);
GdipDisposeImage
(
img
);
stat
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat16bppARGB1555
,
NULL
,
(
GpBitmap
**
)
&
img
);
expect
(
Ok
,
stat
);
stat
=
GdipGetImageFlags
(
img
,
&
flags
);
expect
(
Ok
,
stat
);
expect
(
ImageFlagsHasAlpha
,
flags
);
GdipDisposeImage
(
img
);
stat
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat24bppRGB
,
NULL
,
(
GpBitmap
**
)
&
img
);
expect
(
Ok
,
stat
);
stat
=
GdipGetImageFlags
(
img
,
&
flags
);
expect
(
Ok
,
stat
);
expect
(
ImageFlagsNone
,
flags
);
GdipDisposeImage
(
img
);
stat
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat32bppRGB
,
NULL
,
(
GpBitmap
**
)
&
img
);
expect
(
Ok
,
stat
);
stat
=
GdipGetImageFlags
(
img
,
&
flags
);
expect
(
Ok
,
stat
);
expect
(
ImageFlagsNone
,
flags
);
GdipDisposeImage
(
img
);
stat
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat32bppARGB
,
NULL
,
(
GpBitmap
**
)
&
img
);
expect
(
Ok
,
stat
);
stat
=
GdipGetImageFlags
(
img
,
&
flags
);
expect
(
Ok
,
stat
);
expect
(
ImageFlagsHasAlpha
,
flags
);
GdipDisposeImage
(
img
);
stat
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat32bppPARGB
,
NULL
,
(
GpBitmap
**
)
&
img
);
expect
(
Ok
,
stat
);
stat
=
GdipGetImageFlags
(
img
,
&
flags
);
expect
(
Ok
,
stat
);
expect
(
ImageFlagsHasAlpha
,
flags
);
GdipDisposeImage
(
img
);
stat
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat48bppRGB
,
NULL
,
(
GpBitmap
**
)
&
img
);
expect
(
Ok
,
stat
);
if
(
stat
==
Ok
)
{
stat
=
GdipGetImageFlags
(
img
,
&
flags
);
expect
(
Ok
,
stat
);
expect
(
ImageFlagsNone
,
flags
);
GdipDisposeImage
(
img
);
}
stat
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat64bppARGB
,
NULL
,
(
GpBitmap
**
)
&
img
);
expect
(
Ok
,
stat
);
if
(
stat
==
Ok
)
{
expect
(
Ok
,
stat
);
stat
=
GdipGetImageFlags
(
img
,
&
flags
);
expect
(
Ok
,
stat
);
expect
(
ImageFlagsHasAlpha
,
flags
);
GdipDisposeImage
(
img
);
}
stat
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat64bppPARGB
,
NULL
,
(
GpBitmap
**
)
&
img
);
expect
(
Ok
,
stat
);
if
(
stat
==
Ok
)
{
expect
(
Ok
,
stat
);
stat
=
GdipGetImageFlags
(
img
,
&
flags
);
expect
(
Ok
,
stat
);
expect
(
ImageFlagsHasAlpha
,
flags
);
GdipDisposeImage
(
img
);
}
}
static
void
test_GdipCloneImage
(
void
)
...
...
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