Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
af3a6904
Commit
af3a6904
authored
Jun 12, 2012
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vout_macosx: added HiDPI support
parent
080ff9ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
4 deletions
+28
-4
modules/video_output/macosx.m
modules/video_output/macosx.m
+28
-4
No files found.
modules/video_output/macosx.m
View file @
af3a6904
...
@@ -389,7 +389,12 @@ static int Control (vout_display_t *vd, int query, va_list ap)
...
@@ -389,7 +389,12 @@ static int Control (vout_display_t *vd, int query, va_list ap)
if
(
!
config_GetInt
(
vd
,
"macosx-video-autoresize"
))
if
(
!
config_GetInt
(
vd
,
"macosx-video-autoresize"
))
{
{
NSRect
bounds
=
[
sys
->
glView
bounds
];
NSRect
bounds
;
/* on HiDPI displays, the point bounds don't equal the actual pixel based bounds */
if
([
sys
->
glView
respondsToSelector
:
@selector
(
convertRectToBacking
:)])
bounds
=
[
sys
->
glView
convertRectToBacking
:[
sys
->
glView
bounds
]];
else
bounds
=
[
sys
->
glView
bounds
];
cfg_tmp
.
display
.
width
=
bounds
.
size
.
width
;
cfg_tmp
.
display
.
width
=
bounds
.
size
.
width
;
cfg_tmp
.
display
.
height
=
bounds
.
size
.
height
;
cfg_tmp
.
display
.
height
=
bounds
.
size
.
height
;
}
}
...
@@ -506,6 +511,10 @@ static void OpenglSwap (vlc_gl_t *gl)
...
@@ -506,6 +511,10 @@ static void OpenglSwap (vlc_gl_t *gl)
if
(
!
self
)
if
(
!
self
)
return
nil
;
return
nil
;
/* enable HiDPI support on OS X 10.7 and later */
if
([
self
respondsToSelector
:
@selector
(
setWantsBestResolutionOpenGLSurface
:)])
[
self
setWantsBestResolutionOpenGLSurface
:
YES
];
/* Swap buffers only during the vertical retrace of the monitor.
/* Swap buffers only during the vertical retrace of the monitor.
http://developer.apple.com/documentation/GraphicsImaging/
http://developer.apple.com/documentation/GraphicsImaging/
Conceptual/OpenGL/chap5/chapter_5_section_44.html */
Conceptual/OpenGL/chap5/chapter_5_section_44.html */
...
@@ -522,7 +531,13 @@ static void OpenglSwap (vlc_gl_t *gl)
...
@@ -522,7 +531,13 @@ static void OpenglSwap (vlc_gl_t *gl)
-
(
void
)
setFrameToBoundsOfView
:(
NSValue
*
)
value
-
(
void
)
setFrameToBoundsOfView
:(
NSValue
*
)
value
{
{
NSView
*
parentView
=
[
value
pointerValue
];
NSView
*
parentView
=
[
value
pointerValue
];
[
self
setFrame
:[
parentView
bounds
]];
NSRect
frame
;
/* on HiDPI displays, the point bounds don't equal the actual pixel based bounds */
if
([
parentView
respondsToSelector
:
@selector
(
convertRectToBacking
:)])
frame
=
[
parentView
convertRectToBacking
:[
parentView
bounds
]];
else
frame
=
[
parentView
bounds
];
[
self
setFrame
:
frame
];
}
}
/**
/**
...
@@ -618,7 +633,12 @@ static void OpenglSwap (vlc_gl_t *gl)
...
@@ -618,7 +633,12 @@ static void OpenglSwap (vlc_gl_t *gl)
{
{
VLCAssertMainThread
();
VLCAssertMainThread
();
NSRect
bounds
=
[
self
bounds
];
NSRect
bounds
;
/* on HiDPI displays, the point bounds don't equal the actual pixel based bounds */
if
([
self
respondsToSelector
:
@selector
(
convertRectToBacking
:)])
bounds
=
[
self
convertRectToBacking
:[
self
bounds
]];
else
bounds
=
[
self
bounds
];
vout_display_place_t
place
;
vout_display_place_t
place
;
@synchronized
(
self
)
{
@synchronized
(
self
)
{
...
@@ -752,7 +772,11 @@ static void OpenglSwap (vlc_gl_t *gl)
...
@@ -752,7 +772,11 @@ static void OpenglSwap (vlc_gl_t *gl)
NSRect
s_rect
;
NSRect
s_rect
;
BOOL
b_inside
;
BOOL
b_inside
;
s_rect
=
[
self
bounds
];
/* on HiDPI displays, the point bounds don't equal the actual pixel based bounds */
if
([
self
respondsToSelector
:
@selector
(
convertRectToBacking
:)])
s_rect
=
[
self
convertRectToBacking
:[
self
bounds
]];
else
s_rect
=
[
self
bounds
];
ml
=
[
self
convertPoint
:
[
o_event
locationInWindow
]
fromView
:
nil
];
ml
=
[
self
convertPoint
:
[
o_event
locationInWindow
]
fromView
:
nil
];
b_inside
=
[
self
mouse
:
ml
inRect
:
s_rect
];
b_inside
=
[
self
mouse
:
ml
inRect
:
s_rect
];
...
...
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