#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.h"
#import <Metal/Metal.h>
#include <algorithm>
#include "flutter/fml/logging.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterSurface.h"
Go to the source code of this file.
◆ GetBorderColorForLayer()
static NSColor * GetBorderColorForLayer |
( |
int |
layer | ) |
|
|
static |
Definition at line 48 of file FlutterSurfaceManager.mm.
48 {
50 [NSColor yellowColor],
51 [NSColor cyanColor],
52 [NSColor magentaColor],
53 [NSColor greenColor],
54 [NSColor purpleColor],
55 [NSColor orangeColor],
56 [NSColor blueColor],
57 ];
59}
PODArray< SkColor > colors
◆ UpdateContentSubLayers()
static void UpdateContentSubLayers |
( |
CALayer * |
layer, |
|
|
IOSurfaceRef |
surface, |
|
|
CGFloat |
scale, |
|
|
CGSize |
surfaceSize, |
|
|
NSColor * |
borderColor, |
|
|
const std::vector< FlutterRect > & |
paintRegion |
|
) |
| |
|
static |
Creates sublayers for given layer, each one displaying a portion of the of the surface determined by a rectangle in the provided paint region.
Definition at line 63 of file FlutterSurfaceManager.mm.
68 {
69
70 while (layer.sublayers.count > paintRegion.size()) {
71 [layer.sublayers.lastObject removeFromSuperlayer];
72 }
73
74 while (layer.sublayers.count < paintRegion.size()) {
75 CALayer* newLayer = [CALayer layer];
76 [layer addSublayer:newLayer];
77 }
78
79 for (
size_t i = 0;
i < paintRegion.size();
i++) {
80 CALayer* subLayer = [layer.sublayers objectAtIndex:
i];
81 const auto&
rect = paintRegion[
i];
84
85 double width = surfaceSize.width;
86 double height = surfaceSize.height;
87
88 subLayer.contentsRect =
91
92 if (borderColor != nil) {
93
94 subLayer.borderColor = borderColor.CGColor;
95 subLayer.borderWidth = 1.0;
96 }
97
99 }
100}
sk_sp< SkBlender > blender SkRect rect
◆ kIdleDelay
const double kIdleDelay = 1.0 |
|
static |
◆ kSurfaceEvictionAge
const int kSurfaceEvictionAge = 30 |
|
static |