| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/capturer.h" | 5 #include "remoting/host/capturer.h" |
| 6 | 6 |
| 7 #include <ApplicationServices/ApplicationServices.h> | 7 #include <ApplicationServices/ApplicationServices.h> |
| 8 #include <OpenGL/CGLMacro.h> | 8 #include <OpenGL/CGLMacro.h> |
| 9 #include <OpenGL/OpenGL.h> | 9 #include <OpenGL/OpenGL.h> |
| 10 | 10 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 ReleaseBuffers(); | 242 ReleaseBuffers(); |
| 243 InvalidRects rects; | 243 InvalidRects rects; |
| 244 helper_.SwapInvalidRects(rects); | 244 helper_.SwapInvalidRects(rects); |
| 245 last_buffer_ = NULL; | 245 last_buffer_ = NULL; |
| 246 | 246 |
| 247 CGDirectDisplayID mainDevice = CGMainDisplayID(); | 247 CGDirectDisplayID mainDevice = CGMainDisplayID(); |
| 248 int width = CGDisplayPixelsWide(mainDevice); | 248 int width = CGDisplayPixelsWide(mainDevice); |
| 249 int height = CGDisplayPixelsHigh(mainDevice); | 249 int height = CGDisplayPixelsHigh(mainDevice); |
| 250 InvalidateScreen(gfx::Size(width, height)); | 250 InvalidateScreen(gfx::Size(width, height)); |
| 251 | 251 |
| 252 if (CGDisplayIsBuiltin(mainDevice)) { | 252 if (!CGDisplayUsesOpenGLAcceleration(mainDevice)) { |
| 253 VLOG(3) << "OpenGL support not available."; | 253 VLOG(3) << "OpenGL support not available."; |
| 254 return; | 254 return; |
| 255 } | 255 } |
| 256 | 256 |
| 257 CGLPixelFormatAttribute attributes[] = { | 257 CGLPixelFormatAttribute attributes[] = { |
| 258 kCGLPFAFullScreen, | 258 kCGLPFAFullScreen, |
| 259 kCGLPFADisplayMask, | 259 kCGLPFADisplayMask, |
| 260 (CGLPixelFormatAttribute)CGDisplayIDToOpenGLDisplayMask(mainDevice), | 260 (CGLPixelFormatAttribute)CGDisplayIDToOpenGLDisplayMask(mainDevice), |
| 261 (CGLPixelFormatAttribute)0 | 261 (CGLPixelFormatAttribute)0 |
| 262 }; | 262 }; |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 } | 491 } |
| 492 | 492 |
| 493 } // namespace | 493 } // namespace |
| 494 | 494 |
| 495 // static | 495 // static |
| 496 Capturer* Capturer::Create() { | 496 Capturer* Capturer::Create() { |
| 497 return new CapturerMac(); | 497 return new CapturerMac(); |
| 498 } | 498 } |
| 499 | 499 |
| 500 } // namespace remoting | 500 } // namespace remoting |
| OLD | NEW |