OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "content/common/gpu/ca_layer_tree_mac.h" | 5 #include "gpu/ipc/service/ca_layer_tree_mac.h" |
6 | 6 |
7 #include <AVFoundation/AVFoundation.h> | 7 #include <AVFoundation/AVFoundation.h> |
8 #include <CoreMedia/CoreMedia.h> | 8 #include <CoreMedia/CoreMedia.h> |
9 #include <CoreVideo/CoreVideo.h> | 9 #include <CoreVideo/CoreVideo.h> |
10 | 10 |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/mac/sdk_forward_declarations.h" | 12 #include "base/mac/sdk_forward_declarations.h" |
13 #include "base/trace_event/trace_event.h" | 13 #include "base/trace_event/trace_event.h" |
14 #include "gpu/GLES2/gl2extchromium.h" | 14 #include "gpu/GLES2/gl2extchromium.h" |
15 #include "third_party/skia/include/core/SkColor.h" | 15 #include "third_party/skia/include/core/SkColor.h" |
(...skipping 21 matching lines...) Expand all Loading... |
37 Boolean); | 37 Boolean); |
38 extern "C" OSStatus CMVideoFormatDescriptionCreateForImageBuffer( | 38 extern "C" OSStatus CMVideoFormatDescriptionCreateForImageBuffer( |
39 CFAllocatorRef, | 39 CFAllocatorRef, |
40 CVImageBufferRef, | 40 CVImageBufferRef, |
41 CMVideoFormatDescriptionRef*); | 41 CMVideoFormatDescriptionRef*); |
42 extern "C" CMTime CMTimeMake(int64_t, int32_t); | 42 extern "C" CMTime CMTimeMake(int64_t, int32_t); |
43 extern CFStringRef const kCMSampleAttachmentKey_DisplayImmediately; | 43 extern CFStringRef const kCMSampleAttachmentKey_DisplayImmediately; |
44 extern const CMTime kCMTimeInvalid; | 44 extern const CMTime kCMTimeInvalid; |
45 #endif // MAC_OS_X_VERSION_10_8 | 45 #endif // MAC_OS_X_VERSION_10_8 |
46 | 46 |
47 namespace content { | 47 namespace gpu { |
48 | 48 |
49 namespace { | 49 namespace { |
50 | 50 |
51 // This will enqueue |io_surface| to be drawn by |av_layer| by wrapping | 51 // This will enqueue |io_surface| to be drawn by |av_layer| by wrapping |
52 // |io_surface| in a CVPixelBuffer. This will increase the in-use count | 52 // |io_surface| in a CVPixelBuffer. This will increase the in-use count |
53 // of and retain |io_surface| until it is no longer being displayed. | 53 // of and retain |io_surface| until it is no longer being displayed. |
54 bool AVSampleBufferDisplayLayerEnqueueIOSurface( | 54 bool AVSampleBufferDisplayLayerEnqueueIOSurface( |
55 AVSampleBufferDisplayLayer* av_layer, | 55 AVSampleBufferDisplayLayer* av_layer, |
56 IOSurfaceRef io_surface) { | 56 IOSurfaceRef io_surface) { |
57 OSStatus os_status = noErr; | 57 OSStatus os_status = noErr; |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 } | 561 } |
562 } else { | 562 } else { |
563 // Grey represents a CALayer that has not changed. | 563 // Grey represents a CALayer that has not changed. |
564 color.reset(CGColorCreateGenericRGB(0, 0, 0, 0.1)); | 564 color.reset(CGColorCreateGenericRGB(0, 0, 0, 0.1)); |
565 } | 565 } |
566 [ca_layer setBorderWidth:1]; | 566 [ca_layer setBorderWidth:1]; |
567 [ca_layer setBorderColor:color]; | 567 [ca_layer setBorderColor:color]; |
568 } | 568 } |
569 } | 569 } |
570 | 570 |
571 } // namespace content | 571 } // namespace gpu |
OLD | NEW |