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
b72d236c
Commit
b72d236c
authored
Jun 25, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jun 26, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: When loading a bitmap frame save its IWICMetadataReader interface.
parent
b72ac222
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+2
-0
image.c
dlls/gdiplus/image.c
+23
-0
No files found.
dlls/gdiplus/gdiplus_private.h
View file @
b72d236c
...
...
@@ -29,6 +29,7 @@
#include "objbase.h"
#include "ocidl.h"
#include "wincodecsdk.h"
#include "wine/list.h"
#include "gdiplus.h"
...
...
@@ -309,6 +310,7 @@ struct GpBitmap{
INT
stride
;
/* stride of bits if this is a DIB */
BYTE
*
own_bits
;
/* image bits that need to be freed with this object */
INT
lockx
,
locky
;
/* X and Y coordinates of the rect when a bitmap is locked for writing. */
IWICMetadataReader
*
metadata_reader
;
/* NULL if there is no metadata */
};
struct
GpCachedBitmap
{
...
...
dlls/gdiplus/image.c
View file @
b72d236c
...
...
@@ -17,6 +17,7 @@
*/
#include <stdarg.h>
#include <assert.h>
#define NONAMELESSUNION
...
...
@@ -1785,6 +1786,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
(
*
bitmap
)
->
bits
=
bits
;
(
*
bitmap
)
->
stride
=
stride
;
(
*
bitmap
)
->
own_bits
=
own_bits
;
(
*
bitmap
)
->
metadata_reader
=
NULL
;
/* set format-related flags */
if
(
format
&
(
PixelFormatAlpha
|
PixelFormatPAlpha
|
PixelFormatIndexed
))
...
...
@@ -1967,6 +1969,11 @@ GpStatus WINGDIPAPI GdipEmfToWmfBits(HENHMETAFILE hemf, UINT cbData16,
* and free src. */
static
void
move_bitmap
(
GpBitmap
*
dst
,
GpBitmap
*
src
,
BOOL
clobber_palette
)
{
assert
(
src
->
image
.
type
==
ImageTypeBitmap
);
assert
(
dst
->
image
.
type
==
ImageTypeBitmap
);
assert
(
src
->
image
.
stream
==
NULL
);
assert
(
dst
->
image
.
stream
==
NULL
);
GdipFree
(
dst
->
bitmapbits
);
DeleteDC
(
dst
->
hdc
);
DeleteObject
(
dst
->
hbitmap
);
...
...
@@ -1991,7 +1998,11 @@ static void move_bitmap(GpBitmap *dst, GpBitmap *src, BOOL clobber_palette)
dst
->
bits
=
src
->
bits
;
dst
->
stride
=
src
->
stride
;
dst
->
own_bits
=
src
->
own_bits
;
if
(
dst
->
metadata_reader
)
IWICMetadataReader_Release
(
dst
->
metadata_reader
);
dst
->
metadata_reader
=
src
->
metadata_reader
;
src
->
image
.
type
=
~
0
;
GdipFree
(
src
);
}
...
...
@@ -2006,6 +2017,8 @@ static GpStatus free_image_data(GpImage *image)
GdipFree
(((
GpBitmap
*
)
image
)
->
own_bits
);
DeleteDC
(((
GpBitmap
*
)
image
)
->
hdc
);
DeleteObject
(((
GpBitmap
*
)
image
)
->
hbitmap
);
if
(((
GpBitmap
*
)
image
)
->
metadata_reader
)
IWICMetadataReader_Release
(((
GpBitmap
*
)
image
)
->
metadata_reader
);
}
else
if
(
image
->
type
==
ImageTypeMetafile
)
{
...
...
@@ -2588,6 +2601,7 @@ static GpStatus decode_image_wic(IStream* stream, REFCLSID clsid, UINT active_fr
IWICBitmapDecoder
*
decoder
;
IWICBitmapFrameDecode
*
frame
;
IWICBitmapSource
*
source
=
NULL
;
IWICMetadataBlockReader
*
block_reader
;
WICPixelFormatGUID
wic_format
;
PixelFormat
gdip_format
=
0
;
int
i
;
...
...
@@ -2685,6 +2699,15 @@ static GpStatus decode_image_wic(IStream* stream, REFCLSID clsid, UINT active_fr
IWICBitmapSource_Release
(
source
);
}
bitmap
->
metadata_reader
=
NULL
;
if
(
IWICBitmapFrameDecode_QueryInterface
(
frame
,
&
IID_IWICMetadataBlockReader
,
(
void
**
)
&
block_reader
)
==
S_OK
)
{
UINT
block_count
=
0
;
if
(
IWICMetadataBlockReader_GetCount
(
block_reader
,
&
block_count
)
==
S_OK
&&
block_count
)
IWICMetadataBlockReader_GetReaderByIndex
(
block_reader
,
0
,
&
bitmap
->
metadata_reader
);
IWICMetadataBlockReader_Release
(
block_reader
);
}
IWICBitmapFrameDecode_Release
(
frame
);
}
...
...
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