OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/host/video_frame_capturer.h" | 5 #include "remoting/host/video_frame_capturer.h" |
6 | 6 |
7 #include <ApplicationServices/ApplicationServices.h> | 7 #include <ApplicationServices/ApplicationServices.h> |
8 #include <Cocoa/Cocoa.h> | 8 #include <Cocoa/Cocoa.h> |
9 #include <dlfcn.h> | 9 #include <dlfcn.h> |
10 #include <IOKit/pwr_mgt/IOPMLib.h> | 10 #include <IOKit/pwr_mgt/IOPMLib.h> |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
672 }; | 672 }; |
673 CGLPixelFormatObj pixel_format = NULL; | 673 CGLPixelFormatObj pixel_format = NULL; |
674 GLint matching_pixel_format_count = 0; | 674 GLint matching_pixel_format_count = 0; |
675 CGLError err = CGLChoosePixelFormat(attributes, | 675 CGLError err = CGLChoosePixelFormat(attributes, |
676 &pixel_format, | 676 &pixel_format, |
677 &matching_pixel_format_count); | 677 &matching_pixel_format_count); |
678 DCHECK_EQ(err, kCGLNoError); | 678 DCHECK_EQ(err, kCGLNoError); |
679 err = CGLCreateContext(pixel_format, NULL, &cgl_context_); | 679 err = CGLCreateContext(pixel_format, NULL, &cgl_context_); |
680 DCHECK_EQ(err, kCGLNoError); | 680 DCHECK_EQ(err, kCGLNoError); |
681 CGLDestroyPixelFormat(pixel_format); | 681 CGLDestroyPixelFormat(pixel_format); |
682 CGLSetFullScreenOnDisplay(cgl_context_, | 682 #pragma clang diagnostic push |
683 CGDisplayIDToOpenGLDisplayMask(mainDevice)); | 683 #pragma clang diagnostic ignored "-Wdeprecated-declarations" |
684 CGLSetFullScreen(cgl_context_); | |
Lambros
2012/08/01 21:03:45
Can you add a comment explaining why you're using
Jamie
2012/08/01 21:11:48
Done.
| |
685 #pragma clang diagnostic pop | |
684 CGLSetCurrentContext(cgl_context_); | 686 CGLSetCurrentContext(cgl_context_); |
685 | 687 |
686 size_t buffer_size = width * height * sizeof(uint32_t); | 688 size_t buffer_size = width * height * sizeof(uint32_t); |
687 pixel_buffer_object_.Init(cgl_context_, buffer_size); | 689 pixel_buffer_object_.Init(cgl_context_, buffer_size); |
688 } | 690 } |
689 | 691 |
690 void VideoFrameCapturerMac::ScreenRefresh(CGRectCount count, | 692 void VideoFrameCapturerMac::ScreenRefresh(CGRectCount count, |
691 const CGRect* rect_array) { | 693 const CGRect* rect_array) { |
692 SkIRect skirect_array[count]; | 694 SkIRect skirect_array[count]; |
693 for (CGRectCount i = 0; i < count; ++i) { | 695 for (CGRectCount i = 0; i < count; ++i) { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
764 VideoFrameCapturer* VideoFrameCapturer::Create() { | 766 VideoFrameCapturer* VideoFrameCapturer::Create() { |
765 VideoFrameCapturerMac* capturer = new VideoFrameCapturerMac(); | 767 VideoFrameCapturerMac* capturer = new VideoFrameCapturerMac(); |
766 if (!capturer->Init()) { | 768 if (!capturer->Init()) { |
767 delete capturer; | 769 delete capturer; |
768 capturer = NULL; | 770 capturer = NULL; |
769 } | 771 } |
770 return capturer; | 772 return capturer; |
771 } | 773 } |
772 | 774 |
773 } // namespace remoting | 775 } // namespace remoting |
OLD | NEW |