[vlc-commits] vout_ios2: take into account scale of attached screen

Gleb Pinigin git at videolan.org
Sat Aug 3 10:47:50 CEST 2013


vlc/vlc-2.1 | branch: master | Gleb Pinigin <gpinigin at gmail.com> | Fri Aug  2 19:41:55 2013 +0700| [795551b4e4327452badf2675f4884dd547134dbb] | committer: Felix Paul Kühne

vout_ios2: take into account scale of attached screen

As said in Apple documentation drawRect should not be implemented for view based on opengl es layer.
Instead contentScaleFactor should be changed manually if needed. Underlying opengl es layer will adjust its scale accordingly.

Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>
(cherry picked from commit 437aa16c7a99839889db6bcc4356a2789e71503c)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=795551b4e4327452badf2675f4884dd547134dbb
---

 modules/video_output/ios2.m |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/ios2.m b/modules/video_output/ios2.m
index 28369b4..397be6d 100644
--- a/modules/video_output/ios2.m
+++ b/modules/video_output/ios2.m
@@ -393,10 +393,10 @@ static void OpenglESSwap(vlc_gl_t *gl)
     [super dealloc];
 }
 
-/* we don't get the correct scale factor if we don't overwrite this method */
-- (void)drawRect:(CGRect) rect
+- (void)didMoveToWindow
 {
-    [super drawRect:rect];
+    self.contentScaleFactor = self.window.screen.scale;
+    _bufferNeedReset = YES;
 }
 
 - (void)createBuffers



More information about the vlc-commits mailing list