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
0e8b3050
Commit
0e8b3050
authored
Mar 28, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
Mar 29, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Draw surface region rects separately instead of clipping one big draw.
parent
f7406e74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
31 deletions
+35
-31
cocoa_window.m
dlls/winemac.drv/cocoa_window.m
+35
-31
No files found.
dlls/winemac.drv/cocoa_window.m
View file @
0e8b3050
...
...
@@ -186,51 +186,55 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
if
(
window
.
surface
&&
window
.
surface_mutex
&&
!
pthread_mutex_lock
(
window
.
surface_mutex
))
{
CGRect
bounds
;
const
CGRect
*
rects
;
int
count
;
if
(
!
get_surface_region_rects
(
window
.
surface
,
&
rects
,
&
count
)
||
count
)
if
(
!
get_surface_region_rects
(
window
.
surface
,
&
rects
,
&
count
))
{
CGRect
imageRect
;
CGImageRef
image
;
bounds
=
NSRectToCGRect
([
self
bounds
]);
rects
=
&
bounds
;
count
=
1
;
}
imageRect
=
NSRectToCGRect
(
rect
);
image
=
create_surface_image
(
window
.
surface
,
&
imageRect
,
FALSE
);
if
(
count
)
{
CGContextRef
context
;
int
i
;
if
(
image
)
{
CGContextRef
context
;
[
window
.
shape
addClip
];
if
(
rects
&&
count
)
{
NSBezierPath
*
surfaceClip
=
[
NSBezierPath
bezierPath
];
int
i
;
for
(
i
=
0
;
i
<
count
;
i
++
)
[
surfaceClip
appendBezierPathWithRect
:
NSRectFromCGRect
(
rects
[
i
])];
[
surfaceClip
addClip
];
}
context
=
(
CGContextRef
)[[
NSGraphicsContext
currentContext
]
graphicsPort
];
CGContextSetBlendMode
(
context
,
kCGBlendModeCopy
);
[
window
.
shape
addClip
];
for
(
i
=
0
;
i
<
count
;
i
++
)
{
CGRect
imageRect
;
CGImageRef
image
;
imageRect
=
CGRectIntersection
(
rects
[
i
],
NSRectToCGRect
(
rect
));
image
=
create_surface_image
(
window
.
surface
,
&
imageRect
,
FALSE
);
if
(
window
.
colorKeyed
)
if
(
image
)
{
CGImageRef
maskedImage
;
CGFloat
components
[]
=
{
window
.
colorKeyRed
-
0
.
5
,
window
.
colorKeyRed
+
0
.
5
,
window
.
colorKeyGreen
-
0
.
5
,
window
.
colorKeyGreen
+
0
.
5
,
window
.
colorKeyBlue
-
0
.
5
,
window
.
colorKeyBlue
+
0
.
5
};
maskedImage
=
CGImageCreateWithMaskingColors
(
image
,
components
);
if
(
maskedImage
)
if
(
window
.
colorKeyed
)
{
CGImageRelease
(
image
);
image
=
maskedImage
;
CGImageRef
maskedImage
;
CGFloat
components
[]
=
{
window
.
colorKeyRed
-
0
.
5
,
window
.
colorKeyRed
+
0
.
5
,
window
.
colorKeyGreen
-
0
.
5
,
window
.
colorKeyGreen
+
0
.
5
,
window
.
colorKeyBlue
-
0
.
5
,
window
.
colorKeyBlue
+
0
.
5
};
maskedImage
=
CGImageCreateWithMaskingColors
(
image
,
components
);
if
(
maskedImage
)
{
CGImageRelease
(
image
);
image
=
maskedImage
;
}
}
}
context
=
(
CGContextRef
)[[
NSGraphicsContext
currentContext
]
graphicsPort
];
CGContextSetBlendMode
(
context
,
kCGBlendModeCopy
);
CGContextDrawImage
(
context
,
imageRect
,
image
);
CGContextDrawImage
(
context
,
imageRect
,
image
);
CGImageRelease
(
image
);
CGImageRelease
(
image
);
}
}
}
...
...
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