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
4124478b
Commit
4124478b
authored
Nov 27, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
Nov 28, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Clear OpenGL views to black the first time a context is attached.
This prevents VRAM garbage from being displayed before the program draws.
parent
fd04552f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
1 deletion
+47
-1
cocoa_opengl.h
dlls/winemac.drv/cocoa_opengl.h
+2
-0
cocoa_opengl.m
dlls/winemac.drv/cocoa_opengl.m
+32
-1
cocoa_window.m
dlls/winemac.drv/cocoa_window.m
+13
-0
No files found.
dlls/winemac.drv/cocoa_opengl.h
View file @
4124478b
...
...
@@ -25,8 +25,10 @@
{
NSView
*
latentView
;
BOOL
needsUpdate
;
BOOL
shouldClearToBlack
;
}
@property
BOOL
needsUpdate
;
@property
BOOL
shouldClearToBlack
;
@end
dlls/winemac.drv/cocoa_opengl.m
View file @
4124478b
...
...
@@ -30,7 +30,7 @@
@implementation
WineOpenGLContext
@synthesize
latentView
,
needsUpdate
;
@synthesize
latentView
,
needsUpdate
,
shouldClearToBlack
;
-
(
void
)
dealloc
{
...
...
@@ -63,6 +63,32 @@
[
self
clearDrawable
];
}
-
(
void
)
clearToBlackIfNeeded
{
if
(
shouldClearToBlack
)
{
NSOpenGLContext
*
origContext
=
[
NSOpenGLContext
currentContext
];
[
self
makeCurrentContext
];
glPushAttrib
(
GL_COLOR_BUFFER_BIT
|
GL_SCISSOR_BIT
);
glDrawBuffer
(
GL_FRONT_AND_BACK
);
glDisable
(
GL_SCISSOR_TEST
);
glColorMask
(
GL_TRUE
,
GL_TRUE
,
GL_TRUE
,
GL_TRUE
);
glClearColor
(
0
,
0
,
0
,
1
);
glClear
(
GL_COLOR_BUFFER_BIT
);
glPopAttrib
();
glFlush
();
if
(
origContext
)
[
origContext
makeCurrentContext
];
else
[
NSOpenGLContext
clearCurrentContext
];
shouldClearToBlack
=
FALSE
;
}
}
@end
...
...
@@ -135,6 +161,9 @@ void macdrv_make_context_current(macdrv_opengl_context c, macdrv_view v)
[
context
setLatentView
:
view
];
[
context
makeCurrentContext
];
if
([
context
view
])
[
context
clearToBlackIfNeeded
];
}
else
{
...
...
@@ -163,6 +192,8 @@ void macdrv_update_opengl_context(macdrv_opengl_context c)
{
[
context
setView
:
context
.
latentView
];
context
.
latentView
=
nil
;
[
context
clearToBlackIfNeeded
];
}
else
[
context
update
];
...
...
dlls/winemac.drv/cocoa_window.m
View file @
4124478b
...
...
@@ -154,6 +154,7 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
{
NSMutableArray
*
glContexts
;
NSMutableArray
*
pendingGlContexts
;
BOOL
clearedGlSurface
;
NSMutableAttributedString
*
markedText
;
NSRange
markedTextSelection
;
...
...
@@ -221,7 +222,14 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
WineWindow
*
window
=
(
WineWindow
*
)[
self
window
];
for
(
WineOpenGLContext
*
context
in
pendingGlContexts
)
{
if
(
!
clearedGlSurface
)
{
context
.
shouldClearToBlack
=
TRUE
;
clearedGlSurface
=
TRUE
;
}
context
.
needsUpdate
=
TRUE
;
}
[
glContexts
addObjectsFromArray
:
pendingGlContexts
];
[
pendingGlContexts
removeAllObjects
];
...
...
@@ -298,6 +306,11 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
if
([[
self
window
]
windowNumber
]
>
0
&&
!
NSIsEmptyRect
([
self
visibleRect
]))
{
[
glContexts
addObject
:
context
];
if
(
!
clearedGlSurface
)
{
context
.
shouldClearToBlack
=
TRUE
;
clearedGlSurface
=
TRUE
;
}
context
.
needsUpdate
=
TRUE
;
}
else
...
...
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