Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: ui/accelerated_widget_mac/ca_layer_tree_mac.mm

Issue 1901253002: Mac: Towards moving CALayerTree to the browser proc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove BUILD.gn Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "gpu/ipc/service/ca_layer_tree_mac.h" 5 #include "ui/accelerated_widget_mac/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 #include <GLES2/gl2extchromium.h>
10 11
11 #include "base/command_line.h" 12 #include "base/command_line.h"
12 #include "base/mac/sdk_forward_declarations.h" 13 #include "base/mac/sdk_forward_declarations.h"
13 #include "base/trace_event/trace_event.h" 14 #include "base/trace_event/trace_event.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"
16 #include "ui/base/cocoa/animation_utils.h" 16 #include "ui/base/cocoa/animation_utils.h"
17 #include "ui/base/ui_base_switches.h" 17 #include "ui/base/ui_base_switches.h"
18 #include "ui/gfx/geometry/dip_util.h" 18 #include "ui/gfx/geometry/dip_util.h"
19 19
20 #if !defined(MAC_OS_X_VERSION_10_8) || \ 20 #if !defined(MAC_OS_X_VERSION_10_8) || \
21 MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8 21 MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8
22 extern NSString* const AVLayerVideoGravityResize; 22 extern NSString* const AVLayerVideoGravityResize;
23 extern "C" void NSAccessibilityPostNotificationWithUserInfo( 23 extern "C" void NSAccessibilityPostNotificationWithUserInfo(
24 id object, 24 id object,
(...skipping 12 matching lines...) Expand all
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 gpu { 47 namespace ui {
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
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 gpu 571 } // namespace ui
OLDNEW
« no previous file with comments | « ui/accelerated_widget_mac/ca_layer_tree_mac.h ('k') | ui/accelerated_widget_mac/ca_layer_tree_unittest_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698