text
stringlengths 6
13.6M
| id
stringlengths 13
176
| metadata
dict | __index_level_0__
int64 0
1.69k
|
---|---|---|---|
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app_shared/ui.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import '../../../../shared/charts/chart_controller.dart';
import '../../../../shared/common_widgets.dart';
import '../../../../shared/globals.dart';
import '../../../../shared/primitives/utils.dart';
import '../../../../shared/ui/colors.dart';
import '../../../../shared/utils.dart';
import '../../framework/connected/memory_controller.dart';
import '../../shared/primitives/painting.dart';
import 'chart_control_pane.dart';
import 'chart_pane_controller.dart';
import 'legend.dart';
import 'memory_android_chart.dart';
import 'memory_charts.dart';
import 'memory_events_pane.dart';
import 'memory_vm_chart.dart';
class MemoryChartPane extends StatefulWidget {
const MemoryChartPane({
Key? key,
required this.chartController,
required this.keyFocusNode,
}) : super(key: key);
final MemoryChartPaneController chartController;
/// Which widget's key press will be handled by chart.
final FocusNode keyFocusNode;
static final hoverKey = GlobalKey(debugLabel: 'Chart Hover');
@override
State<MemoryChartPane> createState() => _MemoryChartPaneState();
}
class _MemoryChartPaneState extends State<MemoryChartPane>
with
AutoDisposeMixin,
SingleTickerProviderStateMixin,
ProvidedControllerMixin<MemoryController, MemoryChartPane> {
OverlayEntry? _hoverOverlayEntry;
static const _hoverXOffset = 10;
static const _hoverYOffset = 0.0;
static double get _hoverWidth => scaleByFontFactor(225.0);
static const _hoverCardBorderWidth = 2.0;
// TODO(terry): Compute below heights dynamically.
static double get _hoverHeightMinimum => scaleByFontFactor(42.0);
static double get hoverItemHeight => scaleByFontFactor(17.0);
/// One extension event to display (4 lines).
static double get _hoverOneEventsHeight => scaleByFontFactor(82.0);
/// Many extension events to display.
static double get _hoverEventsHeight => scaleByFontFactor(120.0);
static double _computeHoverHeight(
int eventsCount,
int tracesCount,
int extensionEventsCount,
) =>
_hoverHeightMinimum +
(eventsCount * hoverItemHeight) +
_hoverCardBorderWidth +
(tracesCount * hoverItemHeight) +
(extensionEventsCount > 0
? (extensionEventsCount == 1
? _hoverOneEventsHeight
: _hoverEventsHeight)
: 0);
static int get _timestamp => DateTime.now().millisecondsSinceEpoch;
void _addTapLocationListener(
ValueNotifier<TapLocation?> tapLocation,
List<ValueNotifier<TapLocation?>> allLocations,
) {
addAutoDisposeListener(tapLocation, () {
final value = tapLocation.value;
if (value == null) return;
if (_hoverOverlayEntry != null) {
_hideHover();
return;
}
final details = value.tapDownDetails;
if (details == null) return;
final copied = TapLocation.copy(value);
for (var location in allLocations) {
if (location != tapLocation) location.value = copied;
}
final allValues = ChartsValues(
controller,
value.index,
value.timestamp ?? _timestamp,
);
_showHover(
context,
allValues,
details.globalPosition,
);
});
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (!initController()) return;
final allLocations = [
widget.chartController.event.tapLocation,
widget.chartController.vm.tapLocation,
widget.chartController.android.tapLocation,
];
for (var location in allLocations) {
_addTapLocationListener(location, allLocations);
}
addAutoDisposeListener(controller.refreshCharts, () {
setState(() {
widget.chartController.recomputeChartData();
});
});
// There is no listener passed, so SetState will be invoked.
addAutoDisposeListener(controller.isAndroidChartVisibleNotifier);
_updateListeningState();
}
void _updateListeningState() async {
await serviceConnection.serviceManager.onServiceAvailable;
if (!controller.hasStarted) {
controller.startTimeline();
// TODO(terry): Need to set the initial state of buttons.
/*
pauseButton.disabled = false;
resumeButton.disabled = true;
vmMemorySnapshotButton.disabled = false;
resetAccumulatorsButton.disabled = false;
gcNowButton.disabled = false;
memoryChart.disabled = false;
*/
}
}
@override
Widget build(BuildContext context) {
const memoryEventsPainHeight = 70.0;
return ValueListenableBuilder<bool>(
valueListenable: preferences.memory.showChart,
builder: (_, showChart, __) {
// TODO(https://github.com/flutter/devtools/issues/4576): animate
// showing and hiding the chart.
if (!showChart) return const SizedBox.shrink();
return KeyboardListener(
focusNode: widget.keyFocusNode,
onKeyEvent: (KeyEvent event) {
if (event.isKeyDownOrRepeat &&
event.logicalKey == LogicalKeyboardKey.escape) {
_hideHover();
}
},
autofocus: true,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// The chart.
Expanded(
child: Column(
children: [
SizedBox(
height: memoryEventsPainHeight,
child: MemoryEventsPane(widget.chartController.event),
),
MemoryVMChart(widget.chartController.vm),
if (controller.isAndroidChartVisibleNotifier.value)
SizedBox(
height: defaultChartHeight,
child: MemoryAndroidChart(
widget.chartController.android,
),
),
],
),
),
// The legend.
MultiValueListenableBuilder(
listenables: [
widget.chartController.legendVisibleNotifier,
controller.isAndroidChartVisibleNotifier,
],
builder: (_, values, __) {
final isLegendVisible = values.first as bool;
final isAndroidChartVisible = values.second as bool;
if (!isLegendVisible) return const SizedBox.shrink();
return Padding(
padding: const EdgeInsets.only(
right: denseSpacing,
bottom: denseSpacing,
),
child: MemoryChartLegend(
isAndroidVisible: isAndroidChartVisible,
chartController: widget.chartController,
),
);
},
),
// Chart control pane.
ChartControlPane(
chartController: widget.chartController,
),
],
),
);
},
);
}
@override
void dispose() {
_hideHover(); // hover will leak if not hide
controller.stopTimeLine();
super.dispose();
}
List<Widget> _displayVmDataInHover(ChartsValues chartsValues) =>
_dataToDisplay(
chartsValues.displayVmDataToDisplay(widget.chartController.vm.traces),
);
List<Widget> _displayAndroidDataInHover(ChartsValues chartsValues) {
const dividerLineVerticalSpace = 2.0;
const dividerLineHorizontalSpace = 20.0;
const totalDividerLineHorizontalSpace = dividerLineHorizontalSpace * 2;
if (!controller.isAndroidChartVisibleNotifier.value) return [];
final androidDataDisplayed = chartsValues
.androidDataToDisplay(widget.chartController.android.traces);
// Separator between Android data.
// TODO(terry): Why Center widget doesn't work (parent width is bigger/centered too far right).
// Is it centering on a too wide Overlay?
final width = _hoverWidth -
totalDividerLineHorizontalSpace -
DashedLine.defaultDashWidth;
final dashedColor = Colors.grey.shade600;
return _dataToDisplay(
androidDataDisplayed,
firstWidget: Align(
alignment: Alignment.topLeft,
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: dividerLineVerticalSpace,
horizontal: dividerLineHorizontalSpace,
),
child: CustomPaint(painter: DashedLine(width, dashedColor)),
),
),
);
}
void _showHover(
BuildContext context,
ChartsValues chartsValues,
Offset position,
) {
final theme = Theme.of(context);
final focusColor = theme.focusColor;
final colorScheme = theme.colorScheme;
final box = MemoryChartPane.hoverKey.currentContext!.findRenderObject()
as RenderBox;
final renderBoxWidth = box.size.width;
// Display hover to left of right side of position.
double xPosition = position.dx + _hoverXOffset;
if (xPosition + _hoverWidth > renderBoxWidth) {
xPosition = position.dx - _hoverWidth - _hoverXOffset;
}
double totalHoverHeight;
int totalTraces;
totalTraces = controller.isAndroidChartVisibleNotifier.value
? chartsValues.vmData.entries.length -
1 +
chartsValues.androidData.entries.length
: chartsValues.vmData.entries.length - 1;
totalHoverHeight = _computeHoverHeight(
chartsValues.eventCount,
totalTraces,
chartsValues.extensionEventsLength,
);
final displayTimestamp = prettyTimestamp(chartsValues.timestamp);
final OverlayState overlayState = Overlay.of(context);
_hoverOverlayEntry ??= OverlayEntry(
builder: (context) => Positioned(
top: position.dy + _hoverYOffset,
left: xPosition,
height: totalHoverHeight,
child: Container(
padding: const EdgeInsets.only(top: 5, bottom: 8),
decoration: BoxDecoration(
color: colorScheme.defaultBackgroundColor,
border: Border.all(
color: focusColor,
width: _hoverCardBorderWidth,
),
borderRadius: defaultBorderRadius,
),
width: _hoverWidth,
child: ListView(
children: [
Container(
width: _hoverWidth,
padding: const EdgeInsets.only(bottom: 4),
child: Text(
'Time $displayTimestamp',
style: theme.legendTextStyle,
textAlign: TextAlign.center,
),
),
..._displayEventsInHover(chartsValues),
..._displayVmDataInHover(chartsValues),
..._displayAndroidDataInHover(chartsValues),
..._displayExtensionEventsInHover(chartsValues),
],
),
),
),
);
overlayState.insert(_hoverOverlayEntry!);
}
List<Widget> _dataToDisplay(
Map<String, Map<String, Object?>> dataToDisplay, {
Widget? firstWidget,
}) {
final results = <Widget>[];
if (firstWidget != null) results.add(firstWidget);
for (var entry in dataToDisplay.entries) {
final keys = entry.value.keys;
final image = keys.contains(renderImage)
? entry.value[renderImage] as String?
: null;
final color =
keys.contains(renderLine) ? entry.value[renderLine] as Color? : null;
final dashedLine =
keys.contains(renderDashed) ? entry.value[renderDashed] : false;
results.add(
_hoverRow(
name: entry.key,
colorPatch: color,
dashed: dashedLine == true,
image: image,
hasNumeric: true,
scaleImage: true,
),
);
}
return results;
}
Widget _hoverRow({
required String name,
String? image,
Color? colorPatch,
bool dashed = false,
bool hasNumeric = false,
bool scaleImage = false,
}) {
final theme = Theme.of(context);
List<Widget> hoverPartImageLine(
String name, {
String? image,
Color? colorPatch,
bool dashed = false,
}) {
String displayName = name;
// Empty string overflows, default value space.
String displayValue = ' ';
if (hasNumeric) {
int startOfNumber = name.lastIndexOf(' ');
final unitOrValue = name.substring(startOfNumber + 1);
if (int.tryParse(unitOrValue) == null) {
// Got a unit.
startOfNumber = name.lastIndexOf(' ', startOfNumber - 1);
}
displayName = '${name.substring(0, startOfNumber)} ';
displayValue = name.substring(startOfNumber + 1);
}
Widget traceColor;
// Logic would be hard to read as a conditional expression.
// ignore: prefer-conditional-expression
if (colorPatch != null) {
traceColor =
dashed ? createDashWidget(colorPatch) : createSolidLine(colorPatch);
} else {
traceColor = image == null
? const SizedBox()
: scaleImage
? Image(
image: AssetImage(image),
width: 20,
height: 10,
)
: Image(
image: AssetImage(image),
);
}
return [
traceColor,
const PaddedDivider(
padding: EdgeInsets.only(left: denseRowSpacing),
),
Text(displayName, style: theme.legendTextStyle),
Text(displayValue, style: theme.legendTextStyle),
];
}
final rowChildren = <Widget>[];
rowChildren.addAll(
hoverPartImageLine(
name,
image: image,
colorPatch: colorPatch,
dashed: dashed,
),
);
return Container(
margin: const EdgeInsets.only(left: 5, bottom: 2),
child: Row(
children: rowChildren,
),
);
}
void _hideHover() {
if (_hoverOverlayEntry != null) {
widget.chartController.event.tapLocation.value = null;
widget.chartController.vm.tapLocation.value = null;
widget.chartController.android.tapLocation.value = null;
_hoverOverlayEntry?.remove();
_hoverOverlayEntry = null;
}
}
List<Widget> _displayExtensionEventsInHover(ChartsValues chartsValues) {
return [
if (chartsValues.hasExtensionEvents)
..._extensionEvents(
allEvents: chartsValues.extensionEvents,
),
];
}
List<Widget> _displayEventsInHover(ChartsValues chartsValues) {
final results = <Widget>[];
final colorScheme = Theme.of(context).colorScheme;
final eventsDisplayed = chartsValues.eventsToDisplay(colorScheme.isLight);
for (var entry in eventsDisplayed.entries) {
final widget = _hoverRow(name: ' ${entry.key}', image: entry.value);
results.add(widget);
}
return results;
}
List<Widget> _extensionEvents({
required List<Map<String, Object>> allEvents,
}) {
final theme = Theme.of(context);
final widgets = <Widget>[];
var index = 1;
for (var event in allEvents) {
late String? name;
if (event[eventName] == devToolsEvent && event.containsKey(customEvent)) {
final custom = event[customEvent] as Map<dynamic, dynamic>;
name = custom[customEventName];
} else {
name = event[eventName] as String?;
}
final output = _decodeEventValues(event);
widgets.add(
Padding(
padding: const EdgeInsets.only(left: intermediateSpacing),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
'$index. $name',
overflow: TextOverflow.ellipsis,
style: theme.legendTextStyle,
),
Padding(
padding: const EdgeInsets.only(left: densePadding),
child: Text(
output,
overflow: TextOverflow.ellipsis,
style: theme.legendTextStyle,
),
),
],
),
),
);
index++;
}
final eventsLength = allEvents.length;
final title = Row(
children: [
Container(
padding: const EdgeInsets.only(left: 6.0),
child: Image(
image: AssetImage(eventLegendAsset(eventsLength)),
),
),
const SizedBox(width: denseSpacing),
Text(
'$eventsLength ${pluralize('Event', eventsLength)}',
style: theme.legendTextStyle,
),
],
);
return [
title,
...widgets,
];
}
String _decodeEventValues(Map<String, Object> event) {
final output = StringBuffer();
if (event[eventName] == imageSizesForFrameEvent) {
// TODO(terry): Need a more generic event displayer.
// Flutter event emit the event name and value.
final data = (event[eventData] as Map).cast<String, Object>();
final key = data.keys.first;
output.writeln(_longValueToShort(key));
final values = data[key] as Map<dynamic, dynamic>;
final displaySize = values[displaySizeInBytesData];
final decodeSize = values[decodedSizeInBytesData];
final outputSizes = '$displaySize/$decodeSize';
if (outputSizes.length > 10) {
output.writeln('Display/Decode Size=');
output.write(' $outputSizes');
} else {
output.write('Display/Decode Size=$outputSizes');
}
} else if (event[eventName] == devToolsEvent &&
event.containsKey(customEvent)) {
final custom = event[customEvent] as Map<Object?, Object?>;
final data = custom[customEventData] as Map<Object?, Object?>;
for (var key in data.keys) {
output.write('$key=');
output.writeln(_longValueToShort(data[key] as String));
}
} else {
output.writeln('Unknown Event ${event[eventName]}');
}
return output.toString();
}
/// Long string need to show first part ... last part.
static const _longStringLength = 34;
static const _firstCharacters = 9;
static const _lastCharacters = 20;
// TODO(terry): Data could be long need better mechanism for long data e.g.,:
// const encoder = JsonEncoder.withIndent(' ');
// final displayData = encoder.convert(data);
String _longValueToShort(String longValue) {
var value = longValue;
if (longValue.length > _longStringLength) {
final firstPart = longValue.substring(0, _firstCharacters);
final endPart = longValue.substring(longValue.length - _lastCharacters);
value = '$firstPart...$endPart';
}
return value;
}
}
| devtools/packages/devtools_app/lib/src/screens/memory/panes/chart/chart_pane.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/memory/panes/chart/chart_pane.dart",
"repo_id": "devtools",
"token_count": 8245
} | 139 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import '../../../shared/heap/heap.dart';
String classesToCsv(Iterable<ClassData> classes) {
final csvBuffer = StringBuffer();
// Write the headers first.
csvBuffer.writeln(
[
'Class',
'Library',
'Instances',
'Shallow',
'Retained',
'Short Retaining Path',
'Full Retaining Path',
].map((e) => '"$e"').join(','),
);
for (var classStats in classes) {
for (var pathStats in classStats.statsByPathEntries) {
csvBuffer.writeln(
[
classStats.heapClass.className,
classStats.heapClass.library,
pathStats.value.instanceCount,
pathStats.value.shallowSize,
pathStats.value.retainedSize,
pathStats.key.toShortString(),
pathStats.key.toLongString(delimiter: ' | '),
].join(','),
);
}
}
return csvBuffer.toString();
}
| devtools/packages/devtools_app/lib/src/screens/memory/panes/diff/controller/utils.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/memory/panes/diff/controller/utils.dart",
"repo_id": "devtools",
"token_count": 437
} | 140 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:devtools_app_shared/utils.dart';
import 'package:flutter/foundation.dart';
import 'package:vm_service/vm_service.dart';
import '../../../../shared/config_specific/import_export/import_export.dart';
import '../../../../shared/globals.dart';
import '../../shared/heap/class_filter.dart';
import 'model.dart';
class ProfilePaneController extends DisposableController
with AutoDisposeControllerMixin {
final _exportController = ExportController();
/// The current profile being displayed.
ValueListenable<AdaptedProfile?> get currentAllocationProfile =>
_currentAllocationProfile;
final _currentAllocationProfile = ValueNotifier<AdaptedProfile?>(null);
/// Specifies if the allocation profile should be refreshed when a GC event
/// is received.
///
/// TODO(polina-c): set refresher on by default after resolving issue
/// with flickering
/// https://github.com/flutter/devtools/issues/5176
ValueListenable<bool> get refreshOnGc => _refreshOnGc;
final _refreshOnGc = ValueNotifier<bool>(false);
/// Current class filter.
ValueListenable<ClassFilter> get classFilter => _classFilter;
final _classFilter = ValueNotifier(ClassFilter.empty());
late final _rootPackage =
serviceConnection.serviceManager.rootInfoNow().package;
bool _initialized = false;
void initialize() {
if (_initialized) {
return;
}
autoDisposeStreamSubscription(
serviceConnection.serviceManager.service!.onGCEvent.listen((event) {
if (refreshOnGc.value) {
unawaited(refresh());
}
}),
);
addAutoDisposeListener(
serviceConnection.serviceManager.isolateManager.selectedIsolate,
() {
unawaited(refresh());
},
);
unawaited(refresh());
_initialized = true;
}
void setFilter(ClassFilter filter) {
if (filter.equals(_classFilter.value)) return;
_classFilter.value = filter;
final currentProfile = _currentAllocationProfile.value;
if (currentProfile == null) return;
_currentAllocationProfile.value = AdaptedProfile.withNewFilter(
currentProfile,
classFilter.value,
_rootPackage,
);
}
@visibleForTesting
void clearCurrentProfile() => _currentAllocationProfile.value = null;
/// Enable or disable refreshing the allocation profile when a GC event is
/// received.
void toggleRefreshOnGc() {
_refreshOnGc.value = !_refreshOnGc.value;
}
final selection = ValueNotifier<ProfileRecord?>(null);
/// Clear the current allocation profile and request an updated version from
/// the VM service.
Future<void> refresh() async {
final service = serviceConnection.serviceManager.service;
if (service == null) return;
_currentAllocationProfile.value = null;
final isolate =
serviceConnection.serviceManager.isolateManager.selectedIsolate.value;
if (isolate == null) return;
final allocationProfile = await service.getAllocationProfile(isolate.id!);
_currentAllocationProfile.value = AdaptedProfile.fromAllocationProfile(
allocationProfile,
classFilter.value,
_rootPackage,
);
_initializeSelection();
}
void _initializeSelection() {
final records = _currentAllocationProfile.value?.records;
if (records == null) return;
records.sort((a, b) => b.totalSize.compareTo(a.totalSize));
var recordToSelect = records.elementAtOrNull(0);
if (recordToSelect?.isTotal ?? false) {
recordToSelect = records.elementAtOrNull(1);
}
selection.value = recordToSelect;
}
/// Converts the current [AllocationProfile] to CSV format and downloads it.
///
/// The returned string is the name of the downloaded CSV file.
void downloadMemoryTableCsv(AdaptedProfile profile) {
final csvBuffer = StringBuffer();
// Write the headers first.
csvBuffer.writeln(
[
'Class',
'Library',
'Total Instances',
'Total Size',
'Total Dart Heap Size',
'Total External Size',
'New Space Instances',
'New Space Size',
'New Space Dart Heap Size',
'New Space External Size',
'Old Space Instances',
'Old Space Size',
'Old Space Dart Heap Size',
'Old Space External Size',
].map((e) => '"$e"').join(','),
);
// Write a row for each entry in the profile.
for (final member in profile.records) {
if (member.isTotal) continue;
csvBuffer.writeln(
[
member.heapClass.className,
member.heapClass.library,
member.totalInstances,
member.totalSize,
member.totalDartHeapSize,
member.totalExternalSize,
member.newSpaceInstances,
member.newSpaceSize,
member.newSpaceDartHeapSize,
member.newSpaceExternalSize,
member.oldSpaceInstances,
member.oldSpaceSize,
member.oldSpaceDartHeapSize,
member.oldSpaceExternalSize,
].join(','),
);
}
_exportController.downloadFile(
csvBuffer.toString(),
type: ExportFileType.csv,
);
}
}
| devtools/packages/devtools_app/lib/src/screens/memory/panes/profile/profile_pane_controller.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/memory/panes/profile/profile_pane_controller.dart",
"repo_id": "devtools",
"token_count": 1910
} | 141 |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
// TODO(polina-c): use the same constants as for dash in the chart.
const _dashHeight = 2.0;
const _dashWidth = 5.0;
const _spaceBetweenDash = 3.0;
Widget createDashWidget(Color color) {
final dash = Container(
width: _dashWidth,
height: _dashHeight,
color: color,
);
const space = SizedBox(
width: _spaceBetweenDash,
height: _dashHeight,
);
return Row(
children: [dash, space, dash, space, dash],
);
}
Widget createSolidLine(Color color) {
return Container(
height: 6,
width: 20,
color: color,
margin: const EdgeInsets.symmetric(horizontal: 1.0),
);
}
/// Draw a dashed line on the canvas.
class DashedLine extends CustomPainter {
DashedLine(
this._totalWidth, [
Color? color,
this._dashHeight = defaultDashHeight,
this._dashWidth = defaultDashWidth,
this._dashSpace = defaultDashSpace,
]) {
_color = color ?? (Colors.grey.shade500);
}
static const defaultDashHeight = 1.0;
static const defaultDashWidth = 5.0;
static const defaultDashSpace = 5.0;
final double _dashHeight;
final double _dashWidth;
final double _dashSpace;
double _totalWidth;
late Color _color;
@override
void paint(Canvas canvas, Size size) {
double startX = 0;
final paint = Paint()
..color = _color
..strokeWidth = _dashHeight;
while (_totalWidth >= 0) {
canvas.drawLine(Offset(startX, 0), Offset(startX + _dashWidth, 0), paint);
final space = _dashSpace + _dashWidth;
startX += space;
_totalWidth -= space;
}
}
@override
bool shouldRepaint(covariant CustomPainter oldDelegate) => true;
}
| devtools/packages/devtools_app/lib/src/screens/memory/shared/primitives/painting.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/memory/shared/primitives/painting.dart",
"repo_id": "devtools",
"token_count": 650
} | 142 |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app_shared/ui.dart';
import 'package:flutter/material.dart';
import '../../../../shared/common_widgets.dart';
import '../../../../shared/globals.dart';
import '../../performance_controller.dart';
import '../flutter_frames/flutter_frames_controller.dart';
class PerformanceSettingsDialog extends StatelessWidget {
const PerformanceSettingsDialog(this.controller, {super.key});
final PerformanceController controller;
@override
Widget build(BuildContext context) {
return DevToolsDialog(
title: const DialogTitleText('Performance Settings'),
includeDivider: false,
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (serviceConnection
.serviceManager.connectedApp!.isFlutterAppNow!) ...[
FlutterSettings(
flutterFramesController: controller.flutterFramesController,
),
],
],
),
actions: const [
DialogCloseButton(),
],
);
}
}
class FlutterSettings extends StatelessWidget {
const FlutterSettings({required this.flutterFramesController, super.key});
final FlutterFramesController flutterFramesController;
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CheckboxSetting(
notifier: flutterFramesController.badgeTabForJankyFrames
as ValueNotifier<bool?>,
title: 'Badge Performance tab when Flutter UI jank is detected',
),
],
);
}
}
| devtools/packages/devtools_app/lib/src/screens/performance/panes/controls/performance_settings.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/performance/panes/controls/performance_settings.dart",
"repo_id": "devtools",
"token_count": 658
} | 143 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:convert';
import 'dart:js_interop';
import 'dart:typed_data';
import 'package:devtools_app_shared/utils.dart';
import 'package:devtools_app_shared/web_utils.dart';
import 'package:flutter/material.dart';
import 'package:vm_service_protos/vm_service_protos.dart';
import 'package:web/web.dart';
import '../../../../../shared/analytics/analytics.dart' as ga;
import '../../../../../shared/analytics/constants.dart' as gac;
import '../../../../../shared/development_helpers.dart';
import '../../../../../shared/globals.dart';
import '../../../../../shared/primitives/utils.dart';
import '../../../performance_utils.dart';
import '_perfetto_controller_web.dart';
import 'perfetto_controller.dart';
class Perfetto extends StatefulWidget {
const Perfetto({
Key? key,
required this.perfettoController,
}) : super(key: key);
final PerfettoController perfettoController;
@override
State<Perfetto> createState() => _PerfettoState();
}
class _PerfettoState extends State<Perfetto> with AutoDisposeMixin {
late final PerfettoControllerImpl _perfettoController;
late final _PerfettoViewController _viewController;
@override
void initState() {
super.initState();
_perfettoController = widget.perfettoController as PerfettoControllerImpl;
_viewController = _PerfettoViewController(_perfettoController)..init();
// If [_perfettoController.activeTrace.trace] has a null value, the trace
// data has not yet been initialized.
if (_perfettoController.activeTrace.trace != null) {
_loadActiveTrace();
}
addAutoDisposeListener(_perfettoController.activeTrace, _loadActiveTrace);
_scrollToActiveTimeRange();
addAutoDisposeListener(
_perfettoController.activeScrollToTimeRange,
_scrollToActiveTimeRange,
);
}
void _loadActiveTrace() {
assert(_perfettoController.activeTrace.trace != null);
unawaited(
_viewController._loadPerfettoTrace(
_perfettoController.activeTrace.trace!,
),
);
}
void _scrollToActiveTimeRange() {
unawaited(
_viewController._scrollToTimeRange(
_perfettoController.activeScrollToTimeRange.value,
),
);
}
@override
Widget build(BuildContext context) {
return Container(
color: Theme.of(context).scaffoldBackgroundColor,
child: HtmlElementView(
viewType: _perfettoController.viewId,
),
);
}
@override
void dispose() {
_viewController.dispose();
super.dispose();
}
}
class _PerfettoViewController extends DisposableController
with AutoDisposeControllerMixin {
_PerfettoViewController(this.perfettoController);
final PerfettoControllerImpl perfettoController;
/// Completes when the perfetto iFrame has received the first event on the
/// 'onLoad' stream.
late final Completer<void> _perfettoIFrameReady;
/// Completes when the Perfetto postMessage handler is ready, which is
/// signaled by receiving a [_perfettoPong] event in response to sending a
/// [_perfettoPing] event.
late final Completer<void> _perfettoHandlerReady;
/// Completes when the DevTools theme postMessage handler is ready, which is
/// signaled by receiving a [_devtoolsThemePong] event in response to sending
/// a [_devtoolsThemePing] event.
late final Completer<void> _devtoolsThemeHandlerReady;
/// Timer that will poll until [_perfettoHandlerReady] is complete or until
/// [_pollUntilReadyTimeout] has passed.
Timer? _pollForPerfettoHandlerReady;
/// Timer that will poll until [_devtoolsThemeHandlerReady] is complete or
/// until [_pollUntilReadyTimeout] has passed.
Timer? _pollForThemeHandlerReady;
static const _pollUntilReadyTimeout = Duration(seconds: 10);
/// The listener that is added to DevTools' [window] to receive messages
/// from the Perfetto iFrame.
///
/// We need to store this in a variable so that the listener is properly
/// removed in [dispose].
EventListener? _handleMessageListener;
void init() {
_perfettoIFrameReady = Completer<void>();
_perfettoHandlerReady = Completer<void>();
_devtoolsThemeHandlerReady = Completer<void>();
unawaited(
perfettoController.perfettoIFrame.onLoad.first.then((_) {
_perfettoIFrameReady.complete();
}),
);
window.addEventListener(
'message',
_handleMessageListener = _handleMessage.toJS,
);
unawaited(_loadStyle(preferences.darkModeTheme.value));
addAutoDisposeListener(preferences.darkModeTheme, () async {
await _loadStyle(preferences.darkModeTheme.value);
reloadCssForThemeChange();
});
autoDisposeStreamSubscription(
perfettoController.perfettoPostEventStream.stream.listen((event) async {
if (event == EmbeddedPerfettoEvent.showHelp.event) {
await _showHelp();
}
}),
);
}
Future<void> _loadPerfettoTrace(Trace trace) async {
late Uint8List buffer;
debugTimeSync(
() => buffer = trace.writeToBuffer(),
debugName: 'Trace.writeToBuffer',
);
if (buffer.isEmpty) {
// TODO(kenz): is there a better way to create an empty data set using the
// protozero format? I think this is still using the legacy Chrome format.
// We can't use `Trace()` because the Perfetto post message handler throws
// an exception if an empty buffer is posted.
buffer = Uint8List.fromList(jsonEncode({'traceEvents': []}).codeUnits);
}
await _pingPerfettoUntilReady();
ga.select(gac.performance, gac.PerformanceEvents.perfettoLoadTrace.name);
_postMessage({
'perfetto': {
'buffer': buffer,
'title': 'DevTools timeline trace',
'keepApiOpen': true,
},
});
}
Future<void> _scrollToTimeRange(TimeRange? timeRange) async {
if (timeRange == null) return;
if (!timeRange.isWellFormed) {
pushNoTimelineEventsAvailableWarning();
return;
}
await _pingPerfettoUntilReady();
ga.select(
gac.performance,
gac.PerformanceEvents.perfettoScrollToTimeRange.name,
);
_postMessage({
'perfetto': {
// Pass the values to Perfetto in seconds.
'timeStart': timeRange.start!.inMicroseconds / 1000000,
'timeEnd': timeRange.end!.inMicroseconds / 1000000,
// The time range should take up 80% of the visible window.
'viewPercentage': 0.8,
},
});
}
Future<void> _loadStyle(bool darkMode) async {
// This message will be handled by [devtools_theme_handler.js], which is
// included in the Perfetto build inside [packages/perfetto_ui_compiled/dist].
await _pingDevToolsThemeHandlerUntilReady();
_postMessageWithId(
EmbeddedPerfettoEvent.devtoolsThemeChange.event,
perfettoIgnore: true,
args: {
'theme': darkMode ? 'dark' : 'light',
},
);
}
void reloadCssForThemeChange() {
const maxReloadCalls = 3;
var reloadCount = 0;
// Send this message [maxReloadCalls] times to ensure that the CSS has been
// updated by the time we ask Perfetto to reload the CSS constants.
late final Timer pollingTimer;
pollingTimer = Timer.periodic(const Duration(milliseconds: 200), (_) {
if (reloadCount++ < maxReloadCalls) {
_postMessage(EmbeddedPerfettoEvent.reloadCssConstants.event);
} else {
pollingTimer.cancel();
}
});
}
Future<void> _showHelp() async {
await _pingPerfettoUntilReady();
_postMessage(EmbeddedPerfettoEvent.showHelp.event);
}
void _postMessage(Object message) async {
await _perfettoIFrameReady.future;
assert(
perfettoController.perfettoIFrame.contentWindow != null,
'Something went wrong. The iFrame\'s contentWindow is null after the'
' _perfettoIFrameReady future completed.',
);
perfettoController.perfettoIFrame.contentWindow!.postMessage(
message.jsify(),
perfettoController.perfettoUrl.toJS,
);
}
void _postMessageWithId(
String id, {
Map<String, Object> args = const {},
bool perfettoIgnore = false,
}) {
final message = <String, Object>{
'msgId': id,
if (perfettoIgnore) 'perfettoIgnore': true,
}..addAll(args);
_postMessage(message);
}
void _handleMessage(Event e) {
if (e.isMessageEvent) {
final messageData = ((e as MessageEvent).data as JSString).toDart;
if (messageData == EmbeddedPerfettoEvent.pong.event &&
!_perfettoHandlerReady.isCompleted) {
_perfettoHandlerReady.complete();
}
if (messageData == EmbeddedPerfettoEvent.devtoolsThemePong.event &&
!_devtoolsThemeHandlerReady.isCompleted) {
_devtoolsThemeHandlerReady.complete();
}
}
}
Future<void> _pingPerfettoUntilReady() async {
if (!_perfettoHandlerReady.isCompleted) {
_pollForPerfettoHandlerReady =
Timer.periodic(const Duration(milliseconds: 200), (_) {
// Once the Perfetto UI is ready, Perfetto will receive this 'PING'
// message and return a 'PONG' message, handled in [_handleMessage].
_postMessage(EmbeddedPerfettoEvent.ping.event);
});
await _perfettoHandlerReady.future.timeout(
_pollUntilReadyTimeout,
onTimeout: () => _pollForPerfettoHandlerReady?.cancel(),
);
_pollForPerfettoHandlerReady?.cancel();
}
}
Future<void> _pingDevToolsThemeHandlerUntilReady() async {
if (!_devtoolsThemeHandlerReady.isCompleted) {
_pollForThemeHandlerReady =
Timer.periodic(const Duration(milliseconds: 200), (_) {
// Once [devtools_theme_handler.js] is ready, it will receive this
// 'PING-DEVTOOLS-THEME' message and return a 'PONG-DEVTOOLS-THEME'
// message, handled in [_handleMessage].
_postMessageWithId(
EmbeddedPerfettoEvent.devtoolsThemePing.event,
perfettoIgnore: true,
);
});
await _devtoolsThemeHandlerReady.future.timeout(
_pollUntilReadyTimeout,
onTimeout: () => _pollForThemeHandlerReady?.cancel(),
);
_pollForThemeHandlerReady?.cancel();
}
}
@override
void dispose() {
window.removeEventListener('message', _handleMessageListener);
_handleMessageListener = null;
_pollForPerfettoHandlerReady?.cancel();
_pollForThemeHandlerReady?.cancel();
super.dispose();
}
}
| devtools/packages/devtools_app/lib/src/screens/performance/panes/timeline_events/perfetto/_perfetto_web.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/performance/panes/timeline_events/perfetto/_perfetto_web.dart",
"repo_id": "devtools",
"token_count": 3885
} | 144 |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:vm_service/vm_service.dart';
import '../../service/vm_flags.dart' as vm_flags;
import '../../shared/globals.dart';
import '../vm_developer/vm_service_private_extensions.dart';
import 'cpu_profile_model.dart';
/// Manages interactions between the Cpu Profiler and the VmService.
extension CpuProfilerExtension on VmService {
Future<CpuProfilePair> getCpuProfile({
required int startMicros,
required int extentMicros,
}) async {
// Grab the value of this flag before doing asynchronous work.
final vmDeveloperModeEnabled = preferences.vmDeveloperModeEnabled.value;
final isolateId = serviceConnection
.serviceManager.isolateManager.selectedIsolate.value!.id!;
final cpuSamples =
await serviceConnection.serviceManager.service!.getCpuSamples(
isolateId,
startMicros,
extentMicros,
);
// If VM developer mode is enabled, getCpuSamples will also include code
// profile details automatically (e.g., code stacks and a list of code
// objects).
//
// If the samples contain a code stack, we should attach them to the
// `CpuSample` objects.
const kSamples = 'samples';
const kCodeStack = '_codeStack';
final rawSamples =
(cpuSamples.json![kSamples] as List).cast<Map<String, dynamic>>();
bool buildCodeProfile = false;
if (rawSamples.isNotEmpty && rawSamples.first.containsKey(kCodeStack)) {
// kCodeStack should not be present in the response if VM developer mode
// is not enabled.
assert(vmDeveloperModeEnabled);
buildCodeProfile = true;
final samples = cpuSamples.samples!;
for (int i = 0; i < samples.length; ++i) {
final cpuSample = samples[i];
final rawSample = rawSamples[i];
final codeStack = (rawSample[kCodeStack] as List).cast<int>();
cpuSample.setCodeStack(codeStack);
}
}
final functionProfile = await CpuProfileData.generateFromCpuSamples(
isolateId: isolateId,
cpuSamples: cpuSamples,
);
CpuProfileData? codeProfile;
if (buildCodeProfile) {
codeProfile = await CpuProfileData.generateFromCpuSamples(
isolateId: isolateId,
cpuSamples: cpuSamples,
buildCodeTree: true,
);
}
return CpuProfilePair(
functionProfile: functionProfile,
codeProfile: codeProfile,
);
}
Future clearSamples() {
return serviceConnection.serviceManager.service!.clearCpuSamples(
serviceConnection
.serviceManager.isolateManager.selectedIsolate.value!.id!,
);
}
Future<Response> setProfilePeriod(String value) {
return serviceConnection.serviceManager.service!
.setFlag(vm_flags.profilePeriod, value);
}
Future<Response> enableCpuProfiler() async {
return await serviceConnection.serviceManager.service!
.setFlag(vm_flags.profiler, 'true');
}
}
| devtools/packages/devtools_app/lib/src/screens/profiler/cpu_profile_service.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/profiler/cpu_profile_service.dart",
"repo_id": "devtools",
"token_count": 1089
} | 145 |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// Low 'profile_period' value.
///
/// When this value is applied to the 'profile_period' VM flag, the VM will
/// collect one sample every millisecond.
const lowProfilePeriod = '1000';
/// Medium 'profile_period' value.
///
/// When this value is applied to the 'profile_period' VM flag, the VM will
/// collect one sample every 250 microseconds.
const mediumProfilePeriod = '250';
/// High 'profile_period' value.
///
/// When this value is applied to the 'profile_period' VM flag, the VM will
/// collect one sample every 50 microseconds.
const highProfilePeriod = '50';
enum CpuSamplingRate {
low('CPU sampling rate: low', 'Low', lowProfilePeriod),
medium('CPU sampling rate: medium', 'Medium', mediumProfilePeriod),
high('CPU sampling rate: high', 'High', highProfilePeriod);
const CpuSamplingRate(this.display, this.displayShort, this.value);
final String display;
final String displayShort;
final String value;
}
extension CpuSamplingRateExtension on CpuSamplingRate {
static CpuSamplingRate fromValue(String value) {
switch (value) {
case lowProfilePeriod:
return CpuSamplingRate.low;
case highProfilePeriod:
return CpuSamplingRate.high;
case mediumProfilePeriod:
default:
return CpuSamplingRate.medium;
}
}
}
| devtools/packages/devtools_app/lib/src/screens/profiler/sampling_rate.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/profiler/sampling_rate.dart",
"repo_id": "devtools",
"token_count": 452
} | 146 |
// Copyright 2023 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import '../../../shared/common_widgets.dart';
import '../../../shared/tree.dart';
import '../vm_developer_common_widgets.dart';
import 'class_hierarchy_explorer_controller.dart';
import 'object_inspector_view_controller.dart';
/// A widget that displays the class hierarchy for the currently selected
/// isolate, providing links for navigating within the object inspector.
///
/// The class hierarchy represents the inheritance structure of all classes in
/// a program. For example, all classes in Dart extend `Object` by default, so
/// `Object` acts as the root of the hierarchy. If we have classes `A`, `B`,
/// and `C`, where `B extends A`, the class hierarchy will be the following:
///
/// - Object
/// - A
/// - B
/// - C
class ClassHierarchyExplorer extends StatelessWidget {
const ClassHierarchyExplorer({super.key, required this.controller});
final ObjectInspectorViewController controller;
@override
Widget build(BuildContext context) {
return TreeView<ClassHierarchyNode>(
dataRootsListenable:
controller.classHierarchyController.selectedIsolateClassHierarchy,
dataDisplayProvider: (node, onPressed) => VmServiceObjectLink(
object: node.cls,
onTap: controller.findAndSelectNodeForObject,
),
emptyTreeViewBuilder: () => const CenteredCircularProgressIndicator(),
);
}
}
| devtools/packages/devtools_app/lib/src/screens/vm_developer/object_inspector/class_hierarchy_explorer.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/vm_developer/object_inspector/class_hierarchy_explorer.dart",
"repo_id": "devtools",
"token_count": 484
} | 147 |
// Copyright 2023 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app_shared/ui.dart';
import 'package:flutter/material.dart';
import 'package:vm_service/vm_service.dart';
import '../../../shared/primitives/utils.dart';
import '../../../shared/table/table.dart';
import '../../../shared/table/table_data.dart';
import '../vm_developer_common_widgets.dart';
import '../vm_service_private_extensions.dart';
import 'object_inspector_view_controller.dart';
import 'vm_object_model.dart';
abstract class _ObjectPoolColumnData extends ColumnData<ObjectPoolEntry> {
_ObjectPoolColumnData(super.title, {required super.fixedWidthPx});
_ObjectPoolColumnData.wide(super.title) : super.wide();
@override
bool get supportsSorting => false;
}
class _AddressColumn extends _ObjectPoolColumnData {
_AddressColumn()
: super(
'Offset',
fixedWidthPx: 160,
);
@override
int getValue(ObjectPoolEntry dataObject) {
return dataObject.offset;
}
@override
String getDisplayValue(ObjectPoolEntry dataObject) {
final value = getValue(dataObject);
return '[PP + 0x${value.toRadixString(16).toUpperCase()}]';
}
}
class _DartObjectColumn extends _ObjectPoolColumnData
implements ColumnRenderer<ObjectPoolEntry> {
_DartObjectColumn({required this.controller}) : super.wide('Object');
final ObjectInspectorViewController controller;
@override
Object getValue(ObjectPoolEntry entry) => entry.value;
@override
Widget? build(
BuildContext context,
ObjectPoolEntry data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
}) {
if (data.value is int) return Text(data.value.toString());
return VmServiceObjectLink(
object: data.value as Response,
onTap: controller.findAndSelectNodeForObject,
);
}
}
/// A widget for the object inspector historyViewport displaying information
/// related to [ObjectPool] objects in the Dart VM.
class VmObjectPoolDisplay extends StatelessWidget {
const VmObjectPoolDisplay({
super.key,
required this.controller,
required this.objectPool,
});
final ObjectInspectorViewController controller;
final ObjectPoolObject objectPool;
@override
Widget build(BuildContext context) {
return SplitPane(
initialFractions: const [0.4, 0.6],
axis: Axis.vertical,
children: [
OutlineDecoration.onlyBottom(
child: VmObjectDisplayBasicLayout(
controller: controller,
object: objectPool,
generalDataRows: vmObjectGeneralDataRows(controller, objectPool),
),
),
OutlineDecoration.onlyTop(
child: ObjectPoolTable(
objectPool: objectPool,
controller: controller,
),
),
],
);
}
}
class ObjectPoolTable extends StatelessWidget {
ObjectPoolTable({
Key? key,
required this.objectPool,
required this.controller,
}) : super(key: key);
late final columns = <ColumnData<ObjectPoolEntry>>[
_AddressColumn(),
_DartObjectColumn(controller: controller),
];
final ObjectInspectorViewController controller;
final ObjectPoolObject objectPool;
@override
Widget build(BuildContext context) {
return FlatTable<ObjectPoolEntry>(
data: objectPool.obj.entries,
dataKey: 'vm-code-display',
keyFactory: (entry) => Key(entry.offset.toString()),
columnGroups: [
ColumnGroup.fromText(title: 'Entries', range: const Range(0, 2)),
],
columns: columns,
defaultSortColumn: columns[0],
defaultSortDirection: SortDirection.ascending,
);
}
}
| devtools/packages/devtools_app/lib/src/screens/vm_developer/object_inspector/vm_object_pool_display.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/screens/vm_developer/object_inspector/vm_object_pool_display.dart",
"repo_id": "devtools",
"token_count": 1345
} | 148 |
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:collection/collection.dart';
import 'package:devtools_app_shared/service.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:devtools_shared/devtools_shared.dart';
import 'package:logging/logging.dart';
import 'package:vm_service/vm_service.dart' hide Error;
import '../shared/analytics/analytics.dart' as ga;
import '../shared/connected_app.dart';
import '../shared/console/console_service.dart';
import '../shared/diagnostics/inspector_service.dart';
import '../shared/error_badge_manager.dart';
import '../shared/feature_flags.dart';
import '../shared/globals.dart';
import '../shared/server/server.dart' as server;
import '../shared/title.dart';
import '../shared/utils.dart';
import 'service_registrations.dart' as registrations;
import 'timeline_streams.dart';
import 'vm_flags.dart';
import 'vm_service_logger.dart';
import 'vm_service_wrapper.dart';
final _log = Logger('service_manager');
// Note: don't check this in enabled.
/// Used to debug service protocol traffic. All requests to to the VM service
/// connection are logged to the Logging page, as well as all responses and
/// events from the service protocol device.
const debugLogServiceProtocolEvents = false;
const defaultRefreshRate = 60.0;
/// The amount of time we will wait for the main isolate to become non-null when
/// calling [ServiceConnectionManager.rootLibraryForMainIsolate].
const _waitForRootLibraryTimeout = Duration(seconds: 3);
class ServiceConnectionManager {
ServiceConnectionManager() {
serviceManager = ServiceManager()
..registerLifecycleCallback(
ServiceManagerLifecycle.beforeOpenVmService,
_beforeOpenVmService,
)
..registerLifecycleCallback(
ServiceManagerLifecycle.afterOpenVmService,
_afterOpenVmService,
)
..registerLifecycleCallback(
ServiceManagerLifecycle.beforeCloseVmService,
_beforeCloseVmService,
)
..registerLifecycleCallback(
ServiceManagerLifecycle.afterCloseVmService,
_afterCloseVmService,
)
..registerOverride(
ServiceManagerOverride.initIsolates,
(service) async => await serviceManager.isolateManager.init(
serviceManager.vm?.isolatesForDevToolsMode() ?? <IsolateRef>[],
),
);
}
late final ServiceManager<VmServiceWrapper> serviceManager;
final vmFlagManager = VmFlagManager();
final timelineStreamManager = TimelineStreamManager();
final consoleService = ConsoleService();
InspectorServiceBase? get inspectorService => _inspectorService;
InspectorServiceBase? _inspectorService;
ErrorBadgeManager get errorBadgeManager => _errorBadgeManager;
final _errorBadgeManager = ErrorBadgeManager();
VmServiceTrafficLogger? serviceTrafficLogger;
// TODO (polina-c and kenzieschmoll): make appState member of ConnectedApp.
// https://github.com/flutter/devtools/pull/4993#discussion_r1061774726
AppState get appState => _appState!;
AppState? _appState;
Future<void> _beforeOpenVmService(VmServiceWrapper? service) async {
consoleService.vmServiceOpened(service!);
await vmFlagManager.vmServiceOpened(service);
timelineStreamManager.vmServiceOpened(
service,
serviceManager.connectedApp!,
);
// This needs to be called last in the above group of `vmServiceOpened`
// calls.
errorBadgeManager.vmServiceOpened(service);
_inspectorService?.dispose();
_inspectorService = null;
}
Future<void> _afterOpenVmService(VmServiceWrapper? service) async {
// Re-initialize isolates when VM developer mode is enabled/disabled to
// display/hide system isolates.
preferences.vmDeveloperModeEnabled
.addListener(_handleVmDeveloperModeChanged);
// This needs to be called before calling
// `ga.setupUserApplicationDimensions()` and before initializing
// [_inspectorService], since both require access to an initialized
// [serviceManager.connectedApp] object.
await serviceManager.connectedApp!
.initializeValues(onComplete: generateDevToolsTitle);
// Set up analytics dimensions for the connected app.
ga.setupUserApplicationDimensions();
if (FeatureFlags.devToolsExtensions) {
await extensionService.initialize();
}
_inspectorService = devToolsExtensionPoints.inspectorServiceProvider();
_appState?.dispose();
_appState = AppState(serviceManager.isolateManager.selectedIsolate);
if (debugLogServiceProtocolEvents) {
serviceTrafficLogger = VmServiceTrafficLogger(service!);
}
unawaited(
server.notifyForVmServiceConnection(
vmServiceUri: serviceManager.serviceUri!,
connected: true,
),
);
}
void _beforeCloseVmService(VmServiceWrapper? service) {
// Set [offlineController.previousConnectedApp] in case we need it for
// viewing data after disconnect. This must be done before resetting the
// rest of the service manager state.
final previousConnectedApp = serviceManager.connectedApp != null
? OfflineConnectedApp.parse(serviceManager.connectedApp!.toJson())
: null;
offlineController.previousConnectedApp = previousConnectedApp;
// This must be called before we close the VM service so that
// [serviceManager.serviceUri] is not null.
unawaited(
server.notifyForVmServiceConnection(
vmServiceUri: serviceManager.serviceUri!,
connected: false,
),
);
}
void _afterCloseVmService(VmServiceWrapper? service) {
generateDevToolsTitle();
vmFlagManager.vmServiceClosed();
timelineStreamManager.vmServiceClosed();
consoleService.handleVmServiceClosed();
_inspectorService?.onIsolateStopped();
_inspectorService?.dispose();
_inspectorService = null;
serviceTrafficLogger?.dispose();
preferences.vmDeveloperModeEnabled
.removeListener(_handleVmDeveloperModeChanged);
}
Future<void> _handleVmDeveloperModeChanged() async {
final vm = await serviceConnection.serviceManager.service!.getVM();
final isolates = vm.isolatesForDevToolsMode();
final vmDeveloperModeEnabled = preferences.vmDeveloperModeEnabled.value;
if (serviceManager.isolateManager.selectedIsolate.value!.isSystemIsolate! &&
!vmDeveloperModeEnabled) {
serviceManager.isolateManager
.selectIsolate(serviceManager.isolateManager.isolates.value.first);
}
await serviceManager.isolateManager.init(isolates);
}
// TODO(kenz): consider caching this value for the duration of the VM service
// connection.
Future<String?> rootLibraryForMainIsolate() async {
final mainIsolateRef = await whenValueNonNull(
serviceManager.isolateManager.mainIsolate,
timeout: _waitForRootLibraryTimeout,
);
if (mainIsolateRef == null) return null;
final isolateState =
serviceManager.isolateManager.isolateState(mainIsolateRef);
await isolateState.waitForIsolateLoad();
final rootLib = isolateState.rootInfo?.library;
if (rootLib == null) return null;
final selectedIsolateRefId = mainIsolateRef.id!;
await serviceManager.resolvedUriManager
.fetchFileUris(selectedIsolateRefId, [rootLib]);
final fileUriString = serviceManager.resolvedUriManager.lookupFileUri(
selectedIsolateRefId,
rootLib,
);
_log.fine('rootLibraryForMainIsolate: $fileUriString');
return fileUriString;
}
// TODO(kenz): consider caching this value for the duration of the VM service
// connection.
Future<String?> rootPackageDirectoryForMainIsolate() async {
final fileUriString = await serviceConnection.rootLibraryForMainIsolate();
final packageUriString = fileUriString != null
? packageRootFromFileUriString(fileUriString)
: null;
_log.fine('rootPackageDirectoryForMainIsolate: $packageUriString');
return packageUriString;
}
Future<Response> get adbMemoryInfo async {
return await serviceManager.callServiceOnMainIsolate(
registrations.flutterMemoryInfo.service,
);
}
/// Returns the view id for the selected isolate's 'FlutterView'.
///
/// Throws an Exception if no 'FlutterView' is present in this isolate.
Future<String> get flutterViewId async {
final flutterViewListResponse =
await serviceManager.callServiceExtensionOnMainIsolate(
registrations.flutterListViews,
);
final views = (flutterViewListResponse.json!['views'] as List)
.cast<Map<String, Object?>>();
// Each isolate should only have one FlutterView.
final flutterView = views.firstWhereOrNull(
(view) => view['type'] == 'FlutterView',
);
if (flutterView == null) {
final message =
'No Flutter Views to query: ${flutterViewListResponse.json}';
_log.shout(message);
throw Exception(message);
}
return flutterView['id'] as String;
}
/// Flutter engine returns estimate how much memory is used by layer/picture raster
/// cache entries in bytes.
///
/// Call to returns JSON payload 'EstimateRasterCacheMemory' with two entries:
/// layerBytes - layer raster cache entries in bytes
/// pictureBytes - picture raster cache entries in bytes
Future<Response?> get rasterCacheMetrics async {
if (serviceManager.connectedApp == null ||
!await serviceManager.connectedApp!.isFlutterApp) {
return null;
}
final viewId = await flutterViewId;
return await serviceManager.callServiceExtensionOnMainIsolate(
registrations.flutterEngineEstimateRasterCache,
args: {
'viewId': viewId,
},
);
}
Future<Response?> get renderFrameWithRasterStats async {
if (serviceManager.connectedApp == null ||
!await serviceManager.connectedApp!.isFlutterApp) {
return null;
}
final viewId = await flutterViewId;
return await serviceManager.callServiceExtensionOnMainIsolate(
registrations.renderFrameWithRasterStats,
args: {
'viewId': viewId,
},
);
}
Future<double?> get queryDisplayRefreshRate async {
if (serviceManager.connectedApp == null ||
!await serviceManager.connectedApp!.isFlutterApp) {
return null;
}
const unknownRefreshRate = 0.0;
final viewId = await flutterViewId;
final displayRefreshRateResponse =
await serviceManager.callServiceExtensionOnMainIsolate(
registrations.displayRefreshRate,
args: {'viewId': viewId},
);
final double fps = displayRefreshRateResponse.json!['fps'];
// The Flutter engine returns 0.0 if the refresh rate is unknown. Return
// [defaultRefreshRate] instead.
if (fps == unknownRefreshRate) {
return defaultRefreshRate;
}
return fps.roundToDouble();
}
Future<void> sendDwdsEvent({
required String screen,
required String action,
}) async {
final serviceRegistered = serviceManager.registeredMethodsForService
.containsKey(registrations.dwdsSendEvent);
if (!serviceRegistered) return;
await serviceManager.callServiceExtensionOnMainIsolate(
registrations.dwdsSendEvent,
args: {
'type': 'DevtoolsEvent',
'payload': {
'screen': screen,
'action': action,
},
},
);
}
}
| devtools/packages/devtools_app/lib/src/service/service_manager.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/service/service_manager.dart",
"repo_id": "devtools",
"token_count": 3876
} | 149 |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app_shared/ui.dart';
import 'package:flutter/material.dart';
/// Provides [animations] triggered by toggling the expanded and visible state
/// of a widget.
///
/// See also:
/// * [TreeNodeWidget], which uses this mixin to manage state for animations
/// on expand and collapse of tree nodes.
mixin CollapsibleAnimationMixin<T extends StatefulWidget>
on TickerProviderStateMixin<T> {
/// Animation controller for animating the expand/collapse icon.
late final AnimationController expandController;
/// An animation that rotates the expand arrow
/// from pointing right (0.75 full turns) to pointing down (1.0 full turns).
late final Animation<double> expandArrowAnimation;
/// A curved animation that matches [expandController], moving from 0.0 to 1.0
/// Useful for animating the size of a child that is appearing.
late final Animation<double> expandCurve;
/// Visibility state of the collapsible.
///
/// Implementations can be somewhat slow as the value is cached.
bool shouldShow();
/// Callback triggered when whether the collapsible is expanded changes.
void onExpandChanged(bool expanded);
/// Whether the collapsible is currently expanded.
bool get isExpanded;
@override
void initState() {
super.initState();
expandController = defaultAnimationController(this);
expandCurve = defaultCurvedAnimation(expandController);
expandArrowAnimation =
Tween<double>(begin: 0.75, end: 1.0).animate(expandCurve);
if (isExpanded) {
expandController.value = 1.0;
}
}
@override
void dispose() {
expandController.dispose();
super.dispose();
}
void setExpanded(bool expanded) {
setState(() {
if (expanded) {
expandController.forward();
} else {
expandController.reverse();
}
onExpandChanged(expanded);
});
}
@override
void didUpdateWidget(Widget oldWidget) {
super.didUpdateWidget(oldWidget as T);
if (isExpanded) {
expandController.forward();
} else {
expandController.reverse();
}
}
}
| devtools/packages/devtools_app/lib/src/shared/collapsible_mixin.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/shared/collapsible_mixin.dart",
"repo_id": "devtools",
"token_count": 702
} | 150 |
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app_shared/ui.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import '../../common_widgets.dart';
import '../../globals.dart';
import '../console.dart';
import '../console_service.dart';
import 'evaluate.dart';
import 'help_dialog.dart';
// TODO(devoncarew): Show some small UI indicator when we receive stdout/stderr.
class ConsolePaneHeader extends AreaPaneHeader {
ConsolePaneHeader({super.key})
: super(
title: const Text('Console'),
roundedTopBorder: true,
actions: [
const ConsoleHelpLink(),
const SizedBox(width: densePadding),
CopyToClipboardControl(
dataProvider: () =>
serviceConnection.consoleService.stdio.value.join('\n'),
buttonKey: ConsolePane.copyToClipboardButtonKey,
),
const SizedBox(width: densePadding),
DeleteControl(
buttonKey: ConsolePane.clearStdioButtonKey,
tooltip: 'Clear console output',
onPressed: () => serviceConnection.consoleService.clearStdio(),
),
],
);
}
/// Display the stdout and stderr output from the process under debug.
class ConsolePane extends StatelessWidget {
const ConsolePane({
Key? key,
}) : super(key: key);
static const copyToClipboardButtonKey =
Key('console_copy_to_clipboard_button');
static const clearStdioButtonKey = Key('console_clear_stdio_button');
ValueListenable<List<ConsoleLine>> get stdio =>
serviceConnection.consoleService.stdio;
@override
Widget build(BuildContext context) {
final Widget? footer;
// Eval is disabled for profile mode.
if (serviceConnection.serviceManager.connectedApp!.isProfileBuildNow!) {
footer = null;
} else {
footer = const ExpressionEvalField();
}
return Column(
children: [
Expanded(
child: Console(
lines: stdio,
footer: footer,
),
),
],
);
}
}
| devtools/packages/devtools_app/lib/src/shared/console/widgets/console_pane.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/shared/console/widgets/console_pane.dart",
"repo_id": "devtools",
"token_count": 909
} | 151 |
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// Reference to a Dart object.
///
/// This class is similar to the Observatory protocol InstanceRef with the
/// difference that InspectorInstanceRef objects do not expire and all
/// instances of the same Dart object are guaranteed to have the same
/// InspectorInstanceRef id. The tradeoff is the consumer of
/// InspectorInstanceRef objects is responsible for managing their lifecycles.
class InspectorInstanceRef {
const InspectorInstanceRef(this.id);
@override
bool operator ==(Object other) {
if (other is InspectorInstanceRef) {
return id == other.id;
}
return false;
}
@override
int get hashCode => id.hashCode;
@override
String toString() => '$id';
final String? id;
}
| devtools/packages/devtools_app/lib/src/shared/diagnostics/primitives/instance_ref.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/shared/diagnostics/primitives/instance_ref.dart",
"repo_id": "devtools",
"token_count": 239
} | 152 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'primitives/utils.dart';
/// Class that tracks whether work defined by when futures complete is still in
/// progress.
///
/// Work is added by calling [track] and completed when the [Future]s tracked
/// complete or when [clear] is called.
class FutureWorkTracker {
final _inProgress = <Future<Object?>>{};
/// ValueNotifier that returns whether any of the futures added since last
/// [clear] are still in progress.
ValueListenable<bool> get active => _active;
final _active = ValueNotifier<bool>(false);
/// Clears all currently in progress work.
///
/// The work tracker now operates as if that in progress work was never added.
void clear() {
_inProgress.clear();
_active.value = false;
}
/// Adds [future] to the work being tracked.
///
/// Unless [clear] is called, [active] will now return true until [future]
/// completes either with a value or an error.
Future<Object?> track(Future<Object?> Function() futureCallback) async {
_active.value = true;
// Release the UI thread so that listeners of the [_active] notifier can
// react before [futureCallback] is called.
await delayToReleaseUiThread();
final future = futureCallback();
_inProgress.add(future);
unawaited(
future.whenComplete(() {
_inProgress.remove(future);
if (_inProgress.isEmpty) {
_active.value = false;
}
}),
);
return future;
}
}
| devtools/packages/devtools_app/lib/src/shared/future_work_tracker.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/shared/future_work_tracker.dart",
"repo_id": "devtools",
"token_count": 521
} | 153 |
// Copyright 2024 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:collection/collection.dart';
import '../primitives/utils.dart';
import 'adapted_heap_data.dart';
import 'class_name.dart';
/// Heap path represented by classes only, without object details.
class PathFromRoot {
PathFromRoot(HeapPath heapPath)
: classes =
heapPath.objects.map((o) => o.heapClass).toList(growable: false);
final List<HeapClassName> classes;
String toShortString({String? delimiter, bool inverted = false}) => _asString(
data: classes.map((e) => e.className).toList(),
delimiter: _delimiter(
delimiter: delimiter,
inverted: inverted,
isLong: false,
),
inverted: inverted,
skipObject: true,
);
String toLongString({
String? delimiter,
bool inverted = false,
bool hideStandard = false,
}) {
final List<String> data;
bool justAddedEllipsis = false;
if (hideStandard) {
data = [];
for (var item in classes.asMap().entries) {
if (item.key == 0 ||
item.key == classes.length - 1 ||
!item.value.isCreatedByGoogle) {
data.add(item.value.fullName);
justAddedEllipsis = false;
} else if (!justAddedEllipsis) {
data.add('...');
justAddedEllipsis = true;
}
}
} else {
data = classes.map((e) => e.fullName).toList();
}
return _asString(
data: data,
delimiter: _delimiter(
delimiter: delimiter,
inverted: inverted,
isLong: true,
),
inverted: inverted,
);
}
static String _delimiter({
required String? delimiter,
required bool inverted,
required bool isLong,
}) {
if (delimiter != null) return delimiter;
if (isLong) {
return inverted ? '\n← ' : '\n→ ';
}
return inverted ? ' ← ' : ' → ';
}
static String _asString({
required List<String> data,
required String delimiter,
required bool inverted,
bool skipObject = false,
}) {
data = data.joinWith(delimiter).toList();
if (skipObject) data.removeAt(data.length - 1);
if (inverted) data = data.reversed.toList();
return data.join().trim();
}
late final _listEquality = const ListEquality<HeapClassName>().equals;
@override
bool operator ==(Object other) {
if (other.runtimeType != runtimeType) {
return false;
}
return other is PathFromRoot && _listEquality(classes, other.classes);
}
@override
late final int hashCode = Object.hashAll(classes);
}
| devtools/packages/devtools_app/lib/src/shared/memory/retaining_path.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/shared/memory/retaining_path.dart",
"repo_id": "devtools",
"token_count": 1082
} | 154 |
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:math' as math;
import 'package:collection/collection.dart' as collection;
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'custom_pointer_scroll_view.dart';
class _ExtentDelegateChangeNotifier extends ChangeNotifier {
void onChanged() {
notifyListeners();
}
}
/// Base class for delegate providing extent information for items in a list.
abstract class ExtentDelegate {
/// Optional callback to execute after the layout of the extents is modified.
Listenable get layoutDirty => _layoutDirty;
final _ExtentDelegateChangeNotifier _layoutDirty =
_ExtentDelegateChangeNotifier();
int get length;
/// The main-axis extent of each item.
double itemExtent(int index);
/// The layout offset for the child with the given index.
double layoutOffset(int? index);
/// The minimum child index that is visible at the given scroll offset.
///
/// Implementations should take no more than O(log n) time.
int minChildIndexForScrollOffset(double scrollOffset);
/// The maximum child index that is visible at the given end scroll offset.
///
/// Implementations should take no more than O(log n) time.
/// Surprisingly, getMaxChildIndexForScrollOffset should be 1 less than
/// getMinChildIndexForScrollOffset if the scrollOffset is right at the
/// boundary between two items.
int maxChildIndexForScrollOffset(double endScrollOffset);
@mustCallSuper
void recompute() {
_layoutDirty.onChanged();
}
}
/// [ExtentDelegate] implementation for the case where sizes for each
/// item are known but absolute positions are not known.
abstract class FixedExtentDelegateBase extends ExtentDelegate {
FixedExtentDelegateBase() {
recompute();
}
// The _offsets list is intentionally one element larger than the length of
// the list as it includes an offset at the end that is the offset after all
// items in the list.
late List<double> _offsets;
@override
int get length => _offsets.length - 1;
@protected
double computeExtent(int index);
@protected
int computeLength();
@override
void recompute() {
final length = computeLength();
// The offsets list is one longer than the length of the list as we
// want to query for _offsets(length) to cheaply determine the total size
// of the list. Additionally, the logic for binary search assumes that we
// have one offset past the end of the list.
_offsets = List.filled(length + 1, 0.0);
double offset = 0;
// The first item in the list is at offset zero.
// TODO(jacobr): remove this line once we have NNBD lists.
_offsets[0] = 0;
for (int i = 0; i < length; ++i) {
offset += computeExtent(i);
_offsets[i + 1] = offset;
}
super.recompute();
}
@override
double itemExtent(int index) {
if (index >= length) return 0;
return _offsets[index + 1] - _offsets[index];
}
@override
double layoutOffset(int? index) {
if (index! >= _offsets.length) return _offsets.last;
return _offsets[index];
}
@override
int minChildIndexForScrollOffset(double scrollOffset) {
int index = collection.lowerBound(_offsets, scrollOffset);
if (index == 0) return 0;
if (index >= _offsets.length ||
(_offsets[index] - scrollOffset).abs() > precisionErrorTolerance) {
index--;
}
assert(_offsets[index] <= scrollOffset + precisionErrorTolerance);
return index;
}
@override
int maxChildIndexForScrollOffset(double endScrollOffset) {
int index = collection.lowerBound(_offsets, endScrollOffset);
if (index == 0) return 0;
index--;
assert(_offsets[index] < endScrollOffset);
return index;
}
}
class FixedExtentDelegate extends FixedExtentDelegateBase {
FixedExtentDelegate({
required double Function(int index) computeExtent,
required int Function() computeLength,
}) : _computeExtent = computeExtent,
_computeLength = computeLength {
recompute();
}
final double Function(int index) _computeExtent;
final int Function() _computeLength;
@override
double computeExtent(int index) => _computeExtent(index);
@override
int computeLength() => _computeLength();
}
/// A scrollable list of widgets arranged linearly where each item has an extent
/// specified by the [extentDelegate].
///
/// This class is inspired by the functionality in [ListView] where
/// `itemExtent` is specified. The difference is the extentDelegate provided
/// here specifies different extents for each item in the list and provides
/// the ability to animate extents without rebuilding the list. You should use
/// ListView instead for the simpler case where all items have the same extent.
///
/// Using this class is more efficient than using a ListView without specifying
/// itemExtent as only items visible on screen need to be built and laid out.
/// This class is more robust than ListView for cases where ListView items off
/// screen need to be animated.
class ExtentDelegateListView extends CustomPointerScrollView {
const ExtentDelegateListView({
Key? key,
Axis scrollDirection = Axis.vertical,
bool reverse = false,
ScrollController? controller,
bool? primary,
ScrollPhysics? physics,
bool shrinkWrap = false,
EdgeInsetsGeometry? padding,
required this.childrenDelegate,
required this.extentDelegate,
int? semanticChildCount,
void Function(PointerSignalEvent event)? customPointerSignalHandler,
}) : super(
key: key,
scrollDirection: scrollDirection,
reverse: reverse,
controller: controller,
primary: primary,
physics: physics,
shrinkWrap: shrinkWrap,
padding: padding,
semanticChildCount: semanticChildCount,
customPointerSignalHandler: customPointerSignalHandler,
);
/// A delegate that provides the children for the [ExtentDelegateListView].
final SliverChildDelegate childrenDelegate;
/// A delegate that provides item extents for the children of the
/// [ExtentDelegateListView].
final ExtentDelegate? extentDelegate;
@override
Widget buildChildLayout(BuildContext context) {
return SliverExtentDelegateList(
delegate: childrenDelegate,
extentDelegate: extentDelegate,
);
}
}
/// A sliver that places multiple box children in a linear array.
///
/// The main axis extents on each child are specified by a delegate.
///
/// This class is inspired by [SliverFixedExtentList] which provides similar
/// functionality for the case where all items have the same extent.
class SliverExtentDelegateList extends SliverMultiBoxAdaptorWidget {
/// Creates a sliver that places box children with the same main axis extent
/// in a linear array.
const SliverExtentDelegateList({
Key? key,
required SliverChildDelegate delegate,
required this.extentDelegate,
}) : super(key: key, delegate: delegate);
/// The extent the children are forced to have in the main axis.
final ExtentDelegate? extentDelegate;
@override
RenderSliverExtentDelegateBoxAdaptor createRenderObject(
BuildContext context,
) {
final SliverMultiBoxAdaptorElement element =
context as SliverMultiBoxAdaptorElement;
return RenderSliverExtentDelegateBoxAdaptor(
childManager: element,
extentDelegate: extentDelegate,
);
}
@override
void updateRenderObject(
BuildContext context,
RenderSliverExtentDelegateBoxAdaptor renderObject,
) {
renderObject.markNeedsLayout();
renderObject.extentDelegate = extentDelegate;
}
}
/// A sliver that contains multiple box children that each have known extent
/// along the main axis.
///
/// This class is inspired by [RenderSliverFixedExtentBoxAdaptor] which provides
/// similar functionality for the case where all items have the same extent.
class RenderSliverExtentDelegateBoxAdaptor extends RenderSliverMultiBoxAdaptor {
/// Creates a sliver that contains multiple box children each of which have
/// extent along the main axis provided by [extentDelegate].
///
/// The [childManager] argument must not be null.
RenderSliverExtentDelegateBoxAdaptor({
required RenderSliverBoxChildManager childManager,
required ExtentDelegate? extentDelegate,
}) : super(childManager: childManager) {
_markNeedsLayout = markNeedsLayout;
this.extentDelegate = extentDelegate;
}
set extentDelegate(ExtentDelegate? delegate) {
if (delegate == _extentDelegate) return;
assert(_markNeedsLayout != null);
// Unregister from the previous delegate if there was one.
if (_extentDelegate != null) {
_extentDelegate!.layoutDirty.removeListener(_markNeedsLayout!);
}
// We need to listen for when the delegate changes its layout.
delegate!.layoutDirty.addListener(_markNeedsLayout!);
_extentDelegate = delegate;
}
ExtentDelegate? _extentDelegate;
VoidCallback? _markNeedsLayout;
/// Called to estimate the total scrollable extents of this object.
///
/// Must return the total distance from the start of the child with the
/// earliest possible index to the end of the child with the last possible
/// index.
///
/// By default, defers to [RenderSliverBoxChildManager.estimateMaxScrollOffset].
@protected
double estimateMaxScrollOffset(
SliverConstraints constraints, {
int? firstIndex,
int? lastIndex,
double? leadingScrollOffset,
double? trailingScrollOffset,
}) {
return childManager.estimateMaxScrollOffset(
constraints,
firstIndex: firstIndex,
lastIndex: lastIndex,
leadingScrollOffset: leadingScrollOffset,
trailingScrollOffset: trailingScrollOffset,
);
}
int _calculateLeadingGarbage(int firstIndex) {
RenderBox? walker = firstChild;
int leadingGarbage = 0;
while (walker != null && indexOf(walker) < firstIndex) {
leadingGarbage += 1;
walker = childAfter(walker);
}
return leadingGarbage;
}
int _calculateTrailingGarbage(int? targetLastIndex) {
RenderBox? walker = lastChild;
int trailingGarbage = 0;
while (walker != null && indexOf(walker) > targetLastIndex!) {
trailingGarbage += 1;
walker = childBefore(walker);
}
return trailingGarbage;
}
BoxConstraints buildChildConstraints(int index) {
final currentItemExtent = _extentDelegate!.itemExtent(index);
assert(currentItemExtent >= 0);
return constraints.asBoxConstraints(
minExtent: currentItemExtent,
maxExtent: currentItemExtent,
);
}
// This method is is a fork of RenderSliverFixedExtentBoxAdaptor.performLayout
// where we defer computations about offsets to the _extendDelegate and try
// to avoid logic only applicable if all children have the same extent.
@override
void performLayout() {
childManager.didStartLayout();
childManager.setDidUnderflow(false);
final double scrollOffset =
constraints.scrollOffset + constraints.cacheOrigin;
assert(scrollOffset >= 0.0);
final double remainingExtent = constraints.remainingCacheExtent;
assert(remainingExtent >= 0.0);
final double targetEndScrollOffset = scrollOffset + remainingExtent;
final int firstIndex =
_extentDelegate!.minChildIndexForScrollOffset(scrollOffset);
final int? targetLastIndex = targetEndScrollOffset.isFinite
? _extentDelegate!.maxChildIndexForScrollOffset(targetEndScrollOffset)
: null;
if (firstChild != null) {
final int leadingGarbage = _calculateLeadingGarbage(firstIndex);
final int trailingGarbage = _calculateTrailingGarbage(targetLastIndex);
collectGarbage(leadingGarbage, trailingGarbage);
} else {
collectGarbage(0, 0);
}
if (firstChild == null) {
if (!addInitialChild(
index: firstIndex,
layoutOffset: _extentDelegate!.layoutOffset(firstIndex),
)) {
// There are either no children, or we are past the end of all our children.
// If it is the latter, we will need to find the first available child.
final double max =
_extentDelegate!.layoutOffset(childManager.childCount);
assert(max >= 0.0);
geometry = SliverGeometry(
scrollExtent: _extentDelegate!.layoutOffset(_extentDelegate!.length),
maxPaintExtent: max,
);
childManager.didFinishLayout();
return;
}
}
RenderBox? trailingChildWithLayout;
for (int index = indexOf(firstChild!) - 1; index >= firstIndex; --index) {
final RenderBox? child =
insertAndLayoutLeadingChild(buildChildConstraints(index));
if (child == null) {
// Items before the previously first child are no longer present.
// Reset the scroll offset to offset all items prior and up to the
// missing item. Let parent re-layout everything.
geometry = SliverGeometry(
scrollOffsetCorrection: _extentDelegate!.layoutOffset(index),
);
return;
}
final SliverMultiBoxAdaptorParentData childParentData =
child.parentData as SliverMultiBoxAdaptorParentData;
childParentData.layoutOffset = _extentDelegate!.layoutOffset(index);
assert(childParentData.index == index);
trailingChildWithLayout ??= child;
}
if (trailingChildWithLayout == null) {
firstChild!.layout(buildChildConstraints(firstIndex));
final SliverMultiBoxAdaptorParentData childParentData =
firstChild!.parentData as SliverMultiBoxAdaptorParentData;
childParentData.layoutOffset = _extentDelegate!.layoutOffset(firstIndex);
trailingChildWithLayout = firstChild;
}
double estimatedMaxScrollOffset =
_extentDelegate!.layoutOffset(_extentDelegate!.length);
for (int index = indexOf(trailingChildWithLayout!) + 1;
targetLastIndex == null || index <= targetLastIndex;
++index) {
RenderBox? child = childAfter(trailingChildWithLayout!);
if (child == null || indexOf(child) != index) {
child = insertAndLayoutChild(
buildChildConstraints(index),
after: trailingChildWithLayout,
);
if (child == null) {
// We have run out of children.
estimatedMaxScrollOffset = _extentDelegate!.layoutOffset(index + 1);
break;
}
} else {
child.layout(buildChildConstraints(index));
}
trailingChildWithLayout = child;
final SliverMultiBoxAdaptorParentData childParentData =
child.parentData as SliverMultiBoxAdaptorParentData;
assert(childParentData.index == index);
childParentData.layoutOffset =
_extentDelegate!.layoutOffset(childParentData.index);
}
final int lastIndex = indexOf(lastChild!);
final double leadingScrollOffset =
_extentDelegate!.layoutOffset(firstIndex);
final double trailingScrollOffset =
_extentDelegate!.layoutOffset(lastIndex + 1);
assert(
firstIndex == 0 ||
childScrollOffset(firstChild!)! - scrollOffset <=
precisionErrorTolerance,
);
assert(debugAssertChildListIsNonEmptyAndContiguous());
assert(indexOf(firstChild!) == firstIndex);
assert(targetLastIndex == null || lastIndex <= targetLastIndex);
estimatedMaxScrollOffset = math.min(
estimatedMaxScrollOffset,
estimateMaxScrollOffset(
constraints,
firstIndex: firstIndex,
lastIndex: lastIndex,
leadingScrollOffset: leadingScrollOffset,
trailingScrollOffset: trailingScrollOffset,
),
);
final double paintExtent = calculatePaintOffset(
constraints,
from: leadingScrollOffset,
to: trailingScrollOffset,
);
final double cacheExtent = calculateCacheOffset(
constraints,
from: leadingScrollOffset,
to: trailingScrollOffset,
);
final double targetEndScrollOffsetForPaint =
constraints.scrollOffset + constraints.remainingPaintExtent;
final int? targetLastIndexForPaint = targetEndScrollOffsetForPaint.isFinite
? _extentDelegate!
.maxChildIndexForScrollOffset(targetEndScrollOffsetForPaint)
: null;
assert(paintExtent <= estimatedMaxScrollOffset);
geometry = SliverGeometry(
scrollExtent: _extentDelegate!.layoutOffset(_extentDelegate!.length),
paintExtent: paintExtent,
cacheExtent: cacheExtent,
maxPaintExtent: estimatedMaxScrollOffset,
// Conservative to avoid flickering away the clip during scroll.
hasVisualOverflow: (targetLastIndexForPaint != null &&
lastIndex >= targetLastIndexForPaint) ||
constraints.scrollOffset > 0.0,
);
// We may have started the layout while scrolled to the end, which would not
// expose a new child.
if (estimatedMaxScrollOffset == trailingScrollOffset) {
childManager.setDidUnderflow(true);
}
childManager.didFinishLayout();
}
}
| devtools/packages/devtools_app/lib/src/shared/primitives/extent_delegate_list.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/shared/primitives/extent_delegate_list.dart",
"repo_id": "devtools",
"token_count": 5682
} | 155 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app_shared/ui.dart';
import 'package:flutter/material.dart';
import '../screens/debugger/codeview_controller.dart';
import '../screens/debugger/debugger_screen.dart';
import '../screens/vm_developer/vm_developer_common_widgets.dart';
import 'globals.dart';
import 'primitives/trees.dart';
import 'primitives/utils.dart';
import 'routing.dart';
mixin ProfilableDataMixin<T extends TreeNode<T>> on TreeNode<T> {
ProfileMetaData get profileMetaData;
String get displayName;
/// How many cpu samples for which this frame is a leaf.
int exclusiveSampleCount = 0;
int get inclusiveSampleCount {
final inclusiveSampleCountLocal = _inclusiveSampleCount;
if (inclusiveSampleCountLocal != null) {
return inclusiveSampleCountLocal;
}
return calculateInclusiveSampleCount();
}
/// How many cpu samples this frame is included in.
int? _inclusiveSampleCount;
set inclusiveSampleCount(int? count) => _inclusiveSampleCount = count;
late double totalTimeRatio =
safeDivide(inclusiveSampleCount, profileMetaData.sampleCount);
late Duration totalTime = Duration(
microseconds:
(totalTimeRatio * profileMetaData.time!.duration.inMicroseconds)
.round(),
);
late double selfTimeRatio =
safeDivide(exclusiveSampleCount, profileMetaData.sampleCount);
late Duration selfTime = Duration(
microseconds:
(selfTimeRatio * profileMetaData.time!.duration.inMicroseconds).round(),
);
double get inclusiveSampleRatio => safeDivide(
inclusiveSampleCount,
profileMetaData.sampleCount,
);
double get exclusiveSampleRatio => safeDivide(
exclusiveSampleCount,
profileMetaData.sampleCount,
);
/// Returns the number of samples this data node is a part of.
///
/// This will be equal to the number of leaf nodes under this data node.
int calculateInclusiveSampleCount() {
int count = exclusiveSampleCount;
for (int i = 0; i < children.length; i++) {
final child = children[i] as ProfilableDataMixin<T>;
count += child.inclusiveSampleCount;
}
_inclusiveSampleCount = count;
return _inclusiveSampleCount!;
}
T deepCopy();
@visibleForTesting
String profileAsString() {
final buf = StringBuffer();
_format(buf, ' ');
return buf.toString();
}
void _format(StringBuffer buf, String indent) {
buf.writeln(
'$indent$displayName - children: ${children.length} - excl: '
'$exclusiveSampleCount - incl: $inclusiveSampleCount'
.trimRight(),
);
for (T child in children) {
(child as ProfilableDataMixin<T>)._format(buf, ' $indent');
}
}
}
class ProfileMetaData {
const ProfileMetaData({
required this.sampleCount,
required this.time,
});
final int sampleCount;
final TimeRange? time;
}
/// Process for converting a [ProfilableDataMixin] into a bottom-up
/// representation of the profile.
///
/// [rootedAtTags] specifies whether or not the top-down tree is rooted
/// at synthetic nodes representing user / VM tags.
class BottomUpTransformer<T extends ProfilableDataMixin<T>> {
List<T> bottomUpRootsFor({
required T topDownRoot,
required void Function(List<T>) mergeSamples,
// TODO(bkonyi): can this take a list instead of a single root?
required bool rootedAtTags,
}) {
List<T> bottomUpRoots;
// If the top-down tree has synthetic tag nodes as its roots, we need to
// skip the synthetic nodes when inverting the tree and re-insert them at
// the root.
if (rootedAtTags) {
bottomUpRoots = <T>[];
for (final tagRoot in topDownRoot.children) {
final root = tagRoot.shallowCopy() as T;
// Generate bottom up roots for each child of the synthetic tag node
// and insert them into the new synthetic tag node, [root].
for (final child in tagRoot.children) {
root.addAllChildren(
generateBottomUpRoots(
node: child,
currentBottomUpRoot: null,
bottomUpRoots: <T>[],
),
);
}
// Cascade sample counts only for the non-tag nodes as the tag nodes
// are synthetic and we'll calculate the counts for the tag nodes
// later.
root.children.forEach(cascadeSampleCounts);
mergeSamples(root.children);
bottomUpRoots.add(root);
}
} else {
bottomUpRoots = generateBottomUpRoots(
node: topDownRoot,
currentBottomUpRoot: null,
bottomUpRoots: <T>[],
skipRoot: true,
);
// Set the bottom up sample counts for each sample.
bottomUpRoots.forEach(cascadeSampleCounts);
// Merge samples when possible starting at the root (the leaf node of the
// original sample).
mergeSamples(bottomUpRoots);
}
if (rootedAtTags) {
// Calculate the total time for each tag root. The sum of the exclusive
// times for each child for the tag node is the total time spent with the
// given tag active.
for (final tagRoot in bottomUpRoots) {
tagRoot.inclusiveSampleCount = tagRoot.children.fold<int>(
0,
(prev, e) => prev + e.exclusiveSampleCount,
);
}
}
return bottomUpRoots;
}
/// Returns the roots for a bottom up representation of a
/// [ProfilableDataMixin] node.
///
/// Each root is a leaf from the original [ProfilableDataMixin] tree, and its
/// children will be the reverse stack of the original profile sample. The
/// stack returned will not be merged to combine common roots, and the sample
/// counts will not reflect the bottom up sample counts. These steps will
/// occur later in the bottom-up conversion process.
@visibleForTesting
List<T> generateBottomUpRoots({
required T node,
required T? currentBottomUpRoot,
required List<T> bottomUpRoots,
bool skipRoot = false,
}) {
if (skipRoot && node.isRoot) {
// When [skipRoot] is true, do not include the root node at the leaf of
// each bottom up tree. This is to avoid having the 'all' node at the
// at the bottom of each bottom up path.
} else {
// Inclusive and exclusive sample counts are copied by default.
final copy = node.shallowCopy() as T;
if (currentBottomUpRoot != null) {
copy.addChild(currentBottomUpRoot.deepCopy());
}
// [copy] is the new root of the bottom up stack.
currentBottomUpRoot = copy;
if (node.exclusiveSampleCount > 0) {
// This node is a leaf node, meaning that one or more CPU samples
// contain [currentBottomUpRoot] as the top stack frame. This means it
// is a bottom up root.
bottomUpRoots.add(currentBottomUpRoot);
} else {
// If [currentBottomUpRoot] is not a bottom up root, the inclusive count
// should be set to null. This will allow the inclusive count to be
// recalculated now that this node is part of its parent's bottom up
// tree, not its own.
currentBottomUpRoot.inclusiveSampleCount = null;
}
}
for (final child in node.children.cast<T>()) {
generateBottomUpRoots(
node: child,
currentBottomUpRoot: currentBottomUpRoot,
bottomUpRoots: bottomUpRoots,
);
}
return bottomUpRoots;
}
/// Cascades the [exclusiveSampleCount] and [inclusiveSampleCount] of [node]
/// to all of its children (recursive).
///
/// This is necessary for the transformation of a [ProfilableDataMixin] to its
/// bottom-up representation. This is an intermediate step between
/// [generateBottomUpRoots] and the [mergeSamples] callback passed to
/// [bottomUpRootsFor].
@visibleForTesting
void cascadeSampleCounts(T node) {
for (final child in node.children.cast<T>()) {
child.exclusiveSampleCount = node.exclusiveSampleCount;
child.inclusiveSampleCount = node.inclusiveSampleCount;
cascadeSampleCounts(child);
}
}
}
class MethodAndSourceDisplay extends StatelessWidget {
const MethodAndSourceDisplay({
required this.methodName,
required this.packageUri,
required this.sourceLine,
this.displayInRow = true,
super.key,
});
static const separator = ' - ';
final String methodName;
final String packageUri;
final int? sourceLine;
final bool displayInRow;
@override
Widget build(BuildContext context) {
final fontStyle = Theme.of(context).regularTextStyle;
final sourceTextSpans = <TextSpan>[];
final packageUriWithSourceLine = uriWithSourceLine(packageUri, sourceLine);
if (packageUriWithSourceLine.isNotEmpty) {
sourceTextSpans.add(const TextSpan(text: separator));
final sourceDisplay = '($packageUriWithSourceLine)';
final script = scriptManager.scriptRefForUri(packageUri);
final showSourceAsLink =
script != null && !offlineController.offlineMode.value;
if (showSourceAsLink) {
sourceTextSpans.add(
VmServiceObjectLink(
object: script,
textBuilder: (_) => sourceDisplay,
onTap: (e) {
DevToolsRouterDelegate.of(context).navigate(
DebuggerScreen.id,
const {},
CodeViewSourceLocationNavigationState(
script: script,
line: sourceLine!,
),
);
},
).buildTextSpan(context),
);
} else {
sourceTextSpans.add(
TextSpan(
text: sourceDisplay,
style: fontStyle,
),
);
}
}
final richText = RichText(
maxLines: 1,
overflow: TextOverflow.ellipsis,
text: TextSpan(
text: methodName,
style: fontStyle,
children: sourceTextSpans,
),
);
if (displayInRow) {
// Include this [Row] so that the clickable [VmServiceObjectLink]
// does not extend all the way to the end of the row.
return Row(
mainAxisSize: MainAxisSize.min,
children: [
Flexible(child: richText),
],
);
}
return richText;
}
}
String uriWithSourceLine(String uri, int? sourceLine) =>
'$uri${sourceLine != null ? ':$sourceLine' : ''}';
| devtools/packages/devtools_app/lib/src/shared/profiler_utils.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/shared/profiler_utils.dart",
"repo_id": "devtools",
"token_count": 3908
} | 156 |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of 'table.dart';
/// If a [ColumnData] implements this interface, it can override how that cell
/// is rendered.
abstract class ColumnRenderer<T> {
/// Render the given [data] to a [Widget].
///
/// This method can return `null` to indicate that the default rendering
/// should be used instead.
/// `isRowHovered` is only used when `enableHoverHandling` is `true` on the table
/// that this column belongs to.
Widget? build(
BuildContext context,
T data, {
bool isRowSelected = false,
bool isRowHovered = false,
VoidCallback? onPressed,
});
}
/// If a [ColumnData] implements this interface, it can override how that column
/// header is rendered.
abstract class ColumnHeaderRenderer<T> {
/// Render the column header to a [Widget].
///
/// This method can return `null` to indicate that the default rendering
/// should be used instead.
Widget? buildHeader(
BuildContext context,
Widget Function() defaultHeaderRenderer,
);
}
class _ColumnHeader<T> extends StatelessWidget {
const _ColumnHeader({
Key? key,
required this.column,
required this.isSortColumn,
required this.sortDirection,
required this.onSortChanged,
this.secondarySortColumn,
}) : super(key: key);
final ColumnData<T> column;
final ColumnData<T>? secondarySortColumn;
final bool isSortColumn;
final SortDirection sortDirection;
final void Function(
ColumnData<T> column,
SortDirection direction, {
ColumnData<T>? secondarySortColumn,
})? onSortChanged;
@override
Widget build(BuildContext context) {
late Widget content;
final title = Text(
column.title,
overflow: TextOverflow.ellipsis,
textAlign: column.headerAlignment,
);
final headerContent = Row(
mainAxisAlignment: column.mainAxisAlignment,
children: [
if (isSortColumn && column.supportsSorting) ...[
Icon(
sortDirection == SortDirection.ascending
? Icons.expand_less
: Icons.expand_more,
size: defaultIconSize,
),
const SizedBox(width: densePadding),
],
Expanded(
child: column.titleTooltip != null
? DevToolsTooltip(
message: column.titleTooltip,
padding: const EdgeInsets.all(denseSpacing),
child: title,
)
: title,
),
],
);
content = column.includeHeader
? InkWell(
canRequestFocus: false,
onTap: column.supportsSorting
? () => _handleSortChange(
column,
secondarySortColumn: secondarySortColumn,
)
: null,
child: headerContent,
)
: headerContent;
return content;
}
void _handleSortChange(
ColumnData<T> columnData, {
ColumnData<T>? secondarySortColumn,
}) {
SortDirection direction;
if (isSortColumn) {
direction = sortDirection.reverse();
} else if (columnData.numeric) {
direction = SortDirection.descending;
} else {
direction = SortDirection.ascending;
}
onSortChanged?.call(
columnData,
direction,
secondarySortColumn: secondarySortColumn,
);
}
}
class _ColumnGroupHeaderRow extends StatelessWidget {
const _ColumnGroupHeaderRow({
required this.groups,
required this.columnWidths,
required this.scrollController,
Key? key,
}) : super(key: key);
final List<ColumnGroup> groups;
final List<double> columnWidths;
final ScrollController scrollController;
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: defaultSpacing),
decoration: BoxDecoration(
border: Border(
bottom: defaultBorderSide(Theme.of(context)),
),
),
child: ListView.builder(
scrollDirection: Axis.horizontal,
controller: scrollController,
itemCount: groups.length + groups.numSpacers,
itemBuilder: (context, int i) {
if (i % 2 == 1) {
return const _ColumnGroupSpacer();
}
final group = groups[i ~/ 2];
final groupRange = group.range;
double groupWidth = 0.0;
for (int j = groupRange.begin as int; j < groupRange.end; j++) {
final columnWidth = columnWidths[j];
groupWidth += columnWidth;
if (j < groupRange.end - 1) {
groupWidth += columnSpacing;
}
}
return Container(
alignment: Alignment.center,
width: groupWidth,
child: group.title,
);
},
),
);
}
}
class _ColumnGroupSpacer extends StatelessWidget {
const _ColumnGroupSpacer({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.symmetric(
horizontal: (columnGroupSpacingWithPadding - columnGroupSpacing) / 2,
),
child: Container(
width: columnGroupSpacing,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Colors.black,
Theme.of(context).focusColor,
Colors.black,
],
),
),
),
);
}
}
| devtools/packages/devtools_app/lib/src/shared/table/_table_column.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/shared/table/_table_column.dart",
"repo_id": "devtools",
"token_count": 2327
} | 157 |
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app_shared/ui.dart';
import 'package:flutter/material.dart';
import '../analytics/analytics.dart' as ga;
double get _tabHeight => scaleByFontFactor(46.0);
double get _textAndIconTabHeight => scaleByFontFactor(72.0);
class DevToolsTab extends Tab {
/// Creates a material design [TabBar] tab styled for DevTools.
///
/// The only difference is this tab makes more of an effort to reflect
/// changes in font and icon sizes.
DevToolsTab._({
required Key key,
String? text,
Icon? icon,
EdgeInsets iconMargin = const EdgeInsets.only(bottom: 10.0),
required this.gaId,
this.trailing,
Widget? child,
}) : assert(text != null || child != null || icon != null),
assert(text == null || child == null),
super(
key: key,
text: text,
icon: icon,
iconMargin: iconMargin,
height: calculateHeight(icon, text, child),
child: child,
);
factory DevToolsTab.create({
Key? key,
required String tabName,
required String gaPrefix,
Widget? trailing,
}) {
return DevToolsTab._(
key: key ?? ValueKey<String>(tabName),
gaId: '${gaPrefix}_$tabName',
trailing: trailing,
child: Text(
tabName,
overflow: TextOverflow.ellipsis,
),
);
}
static double calculateHeight(Icon? icon, String? text, Widget? child) {
return icon == null || (text == null && child == null)
? _tabHeight
: _textAndIconTabHeight;
}
/// Tab id for google analytics.
final String gaId;
final Widget? trailing;
@override
Widget build(BuildContext context) {
return DefaultTextStyle(
style: Theme.of(context).textTheme.titleSmall!,
child: super.build(context),
);
}
}
/// A combined [TabBar] and [TabBarView] implementation that tracks tab changes
/// to our analytics.
///
/// To avoid unnecessary analytics events, ensure [analyticsSessionIdentifier] represents
/// the object being shown in the [AnalyticsTabbedView]. If the data in that
/// object is being updated then it is expected that the
/// [analyticsSessionIdentifier] remains the same. If a new object is being
/// shown, it is expected that the [analyticsSessionIdentifier] has a unique
/// value. This ensures that data being refreshed, or widget tree rebuilds don't
/// send spurious analytics events.
class AnalyticsTabbedView extends StatefulWidget {
AnalyticsTabbedView({
Key? key,
required this.tabs,
required this.gaScreen,
this.sendAnalytics = true,
this.onTabChanged,
this.initialSelectedIndex,
this.analyticsSessionIdentifier,
}) : trailingWidgets = List.generate(
tabs.length,
(index) => tabs[index].tab.trailing ?? const SizedBox(),
),
super(key: key);
final List<({DevToolsTab tab, Widget tabView})> tabs;
final String gaScreen;
final List<Widget> trailingWidgets;
final int? initialSelectedIndex;
/// A value that represents the data object being presented by
/// [AnalyticsTabbedView].
///
/// This value should represent the object being shown in the
/// [AnalyticsTabbedView]. If the data in that object is being updated then it
/// is expected that the [analyticsSessionIdentifier] remains the same. If a
/// new object is being shown, it is expected that the
/// [analyticsSessionIdentifier] has a unique value. This ensures that data
/// being refreshed, or widget tree rebuilds don't send spurious analytics
/// events.
final String? analyticsSessionIdentifier;
/// Whether to send analytics events to GA.
///
/// Only set this to false if [AnalyticsTabbedView] is being used for
/// experimental code we do not want to send GA events for yet.
final bool sendAnalytics;
final void Function(int)? onTabChanged;
@override
State<AnalyticsTabbedView> createState() => _AnalyticsTabbedViewState();
}
class _AnalyticsTabbedViewState extends State<AnalyticsTabbedView>
with TickerProviderStateMixin {
TabController? _tabController;
int _currentTabControllerIndex = 0;
void _initTabController({required bool isNewSession}) {
_tabController?.removeListener(_onTabChanged);
_tabController?.dispose();
_tabController = TabController(
length: widget.tabs.length,
vsync: this,
);
final initialIndex = widget.initialSelectedIndex;
if (initialIndex != null) {
_currentTabControllerIndex = initialIndex;
}
if (_currentTabControllerIndex >= _tabController!.length) {
_currentTabControllerIndex = 0;
}
_tabController!
..index = _currentTabControllerIndex
..addListener(_onTabChanged);
// Record a selection for the visible tab, if this is a new session being
// initialized.
if (widget.sendAnalytics && isNewSession) {
ga.select(
widget.gaScreen,
widget.tabs[_currentTabControllerIndex].tab.gaId,
nonInteraction: true,
);
}
}
void _onTabChanged() {
final newIndex = _tabController!.index;
if (_currentTabControllerIndex != newIndex) {
setState(() {
_currentTabControllerIndex = newIndex;
widget.onTabChanged?.call(newIndex);
});
if (widget.sendAnalytics) {
ga.select(
widget.gaScreen,
widget.tabs[_currentTabControllerIndex].tab.gaId,
);
}
}
}
@override
void initState() {
super.initState();
_initTabController(isNewSession: true);
}
@override
void didUpdateWidget(AnalyticsTabbedView oldWidget) {
super.didUpdateWidget(oldWidget);
if (oldWidget.tabs != widget.tabs ||
oldWidget.gaScreen != widget.gaScreen) {
final isNewSession = oldWidget.analyticsSessionIdentifier !=
widget.analyticsSessionIdentifier &&
widget.analyticsSessionIdentifier != null;
_initTabController(isNewSession: isNewSession);
}
}
@override
void dispose() {
_tabController?.removeListener(_onTabChanged);
_tabController?.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final tabBar = OutlineDecoration.onlyBottom(
child: SizedBox(
height: defaultHeaderHeight,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: TabBar(
labelColor: Theme.of(context).textTheme.bodyLarge?.color,
controller: _tabController,
tabs: widget.tabs.map((t) => t.tab).toList(),
isScrollable: true,
),
),
widget.trailingWidgets[_currentTabControllerIndex],
],
),
),
);
return RoundedOutlinedBorder(
clip: true,
child: Column(
children: [
tabBar,
Expanded(
child: TabBarView(
physics: defaultTabBarViewPhysics,
controller: _tabController,
children: widget.tabs.map((t) => t.tabView).toList(),
),
),
],
),
);
}
}
| devtools/packages/devtools_app/lib/src/shared/ui/tab.dart/0 | {
"file_path": "devtools/packages/devtools_app/lib/src/shared/ui/tab.dart",
"repo_id": "devtools",
"token_count": 2703
} | 158 |
//
// Generated file. Do not edit.
//
import FlutterMacOS
import Foundation
import file_selector_macos
import shared_preferences_foundation
import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
}
| devtools/packages/devtools_app/macos/Flutter/GeneratedPluginRegistrant.swift/0 | {
"file_path": "devtools/packages/devtools_app/macos/Flutter/GeneratedPluginRegistrant.swift",
"repo_id": "devtools",
"token_count": 154
} | 159 |
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:convert';
import 'package:devtools_app/devtools_app.dart';
import 'package:devtools_app/src/screens/app_size/app_size_table.dart';
import 'package:devtools_app/src/shared/file_import.dart';
import 'package:devtools_app_shared/ui.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:devtools_shared/devtools_test_utils.dart';
import 'package:devtools_test/devtools_test.dart';
import 'package:devtools_test/helpers.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/mockito.dart';
import '../test_infra/test_data/app_size/deferred_app.dart';
import '../test_infra/test_data/app_size/diff_deferred_app.dart';
import '../test_infra/test_data/app_size/diff_no_deferred_app.dart';
import '../test_infra/test_data/app_size/new_v8.dart';
import '../test_infra/test_data/app_size/old_v8.dart';
import '../test_infra/test_data/app_size/sizes.dart';
import '../test_infra/test_data/app_size/unsupported_file.dart';
void main() {
setUp(() {
setGlobal(ServiceConnectionManager, FakeServiceConnectionManager());
setGlobal(
DevToolsEnvironmentParameters,
ExternalDevToolsEnvironmentParameters(),
);
setGlobal(PreferencesController, PreferencesController());
setGlobal(IdeTheme, IdeTheme());
setGlobal(NotificationService, NotificationService());
});
final lastModifiedTime = DateTime.parse('2020-07-28 13:29:00');
final oldV8JsonFile = DevToolsJsonFile(
name: 'lib/src/app_size/stub_data/old_v8.dart',
lastModifiedTime: lastModifiedTime,
data: json.decode(oldV8),
);
final newV8JsonFile = DevToolsJsonFile(
name: 'lib/src/app_size/stub_data/new_v8.dart',
lastModifiedTime: lastModifiedTime,
data: json.decode(newV8),
);
final deferredAppFile = DevToolsJsonFile(
name: 'lib/src/app_size/stub_data/deferred_app.dart',
lastModifiedTime: lastModifiedTime,
data: json.decode(deferredApp),
);
DevToolsJsonFile(
name: 'lib/src/app_size/stub_data/diff_deferred_app.dart',
lastModifiedTime: lastModifiedTime,
data: json.decode(diffDeferredApp),
);
DevToolsJsonFile(
name: 'lib/src/app_size/stub_data/diff_no_deferred_app.dart',
lastModifiedTime: lastModifiedTime,
data: json.decode(diffNonDeferredApp),
);
late AppSizeScreen screen;
late AppSizeTestController appSizeController;
FakeServiceConnectionManager fakeServiceConnection;
const windowSize = Size(2560.0, 1338.0);
Future<void> pumpAppSizeScreen(
WidgetTester tester, {
required AppSizeTestController controller,
}) async {
await tester.pumpWidget(
wrapWithControllers(
const AppSizeBody(),
appSize: controller,
),
);
deferredLoadingSupportEnabled = true;
await tester.pumpAndSettle(const Duration(seconds: 1));
expect(find.byType(AppSizeBody), findsOneWidget);
}
Future<void> loadDataAndPump(
WidgetTester tester, {
DevToolsJsonFile? data,
}) async {
data ??= newV8JsonFile;
appSizeController.loadTreeFromJsonFile(
jsonFile: data,
onError: (error) => {},
);
await tester.pumpAndSettle();
}
group('AppSizeScreen', () {
setUp(() {
screen = AppSizeScreen();
appSizeController = AppSizeTestController();
fakeServiceConnection = FakeServiceConnectionManager();
setGlobal(ServiceConnectionManager, fakeServiceConnection);
when(
fakeServiceConnection.errorBadgeManager.errorCountNotifier('app-size'),
).thenReturn(ValueNotifier<int>(0));
});
testWidgets('builds its tab', (WidgetTester tester) async {
await tester.pumpWidget(
wrapWithControllers(
Builder(builder: screen.buildTab),
appSize: appSizeController,
),
);
expect(find.text('App Size'), findsOneWidget);
});
testWidgetsWithWindowSize(
'builds initial content',
windowSize,
(WidgetTester tester) async {
await pumpAppSizeScreen(
tester,
controller: appSizeController,
);
expect(find.byType(AppSizeBody), findsOneWidget);
expect(find.byType(TabBar), findsOneWidget);
expect(find.byKey(AppSizeScreen.analysisTabKey), findsOneWidget);
expect(find.byKey(AppSizeScreen.diffTabKey), findsOneWidget);
await loadDataAndPump(tester);
// Verify the state of the splitter.
final splitFinder = find.byType(SplitPane);
expect(splitFinder, findsOneWidget);
final SplitPane splitter = tester.widget(splitFinder);
expect(splitter.initialFractions[0], equals(0.67));
expect(splitter.initialFractions[1], equals(0.33));
},
);
testWidgetsWithWindowSize(
'builds deferred content',
windowSize,
(WidgetTester tester) async {
await pumpAppSizeScreen(
tester,
controller: appSizeController,
);
await loadDataAndPump(tester, data: deferredAppFile);
// Verify the dropdown for selecting app units exists.
final appUnitDropdownFinder = _findDropdownButton<AppUnit>();
expect(appUnitDropdownFinder, findsOneWidget);
// Verify the entire app is shown.
final breadcrumbs = _fetchBreadcrumbs(tester);
expect(breadcrumbs.length, 1);
expect(breadcrumbs.first.text, equals('Entire App [39.8 MB]'));
expect(find.richText('Main [39.5 MB]'), findsOneWidget);
// Open the dropdown.
await tester.tap(appUnitDropdownFinder);
await tester.pumpAndSettle();
// Verify the menu items in the dropdown are expected.
final entireAppMenuItemFinder =
_findMenuItemWithText<AppUnit>('Entire App');
expect(entireAppMenuItemFinder, findsOneWidget);
final mainMenuItemFinder = _findMenuItemWithText<AppUnit>('Main');
expect(mainMenuItemFinder, findsOneWidget);
final deferredMenuItemFinder =
_findMenuItemWithText<AppUnit>('Deferred');
expect(deferredMenuItemFinder, findsOneWidget);
// Select the main unit.
await tester.tap(find.text('Main').hitTestable());
await tester.pumpAndSettle();
// Verify the main unit is shown.
final mainBreadcrumbs = _fetchBreadcrumbs(tester);
expect(mainBreadcrumbs.length, 1);
expect(mainBreadcrumbs.first.text, equals('Main [39.5 MB]'));
expect(find.richText('appsize_app.app [39.5 MB]'), findsOneWidget);
// Open the dropdown.
await tester.tap(appUnitDropdownFinder);
await tester.pumpAndSettle();
// Select the deferred units.
await tester.tap(find.text('Deferred').hitTestable());
await tester.pumpAndSettle();
// Verify the deferred units are shown.
final deferredBreadcrumbs = _fetchBreadcrumbs(tester);
expect(deferredBreadcrumbs.length, 1);
expect(deferredBreadcrumbs.first.text, equals('Deferred [344.3 KB]'));
expect(
find.richText('flutter_assets [344.3 KB] (Deferred)'),
findsOneWidget,
);
},
);
});
group('SnapshotView', () {
setUp(() {
screen = AppSizeScreen();
appSizeController = AppSizeTestController();
});
testWidgetsWithWindowSize(
'imports file and loads data',
windowSize,
(WidgetTester tester) async {
await pumpAppSizeScreen(
tester,
controller: appSizeController,
);
expect(find.byKey(AppSizeScreen.diffTypeDropdownKey), findsNothing);
expect(find.byType(ClearButton), findsOneWidget);
expect(find.byType(FileImportContainer), findsOneWidget);
expect(find.text(AnalysisView.importInstructions), findsOneWidget);
expect(find.text('No File Selected'), findsOneWidget);
appSizeController.loadTreeFromJsonFile(
jsonFile: newV8JsonFile,
onError: (error) => {},
delayed: true,
);
await tester.pump(const Duration(milliseconds: 500));
expect(find.text(AppSizeScreen.loadingMessage), findsOneWidget);
await tester.pumpAndSettle();
expect(find.byType(FileImportContainer), findsNothing);
expect(find.text(AnalysisView.importInstructions), findsNothing);
expect(find.text('No File Selected'), findsNothing);
expect(find.byType(AnalysisView), findsOneWidget);
expect(
find.text(
'Dart AOT snapshot: lib/src/app_size/stub_data/new_v8.dart - 7/28/2020 1:29 PM',
),
findsOneWidget,
);
expect(
find.byKey(AppSizeScreen.analysisViewTreemapKey),
findsOneWidget,
);
final breadcrumbs = _fetchBreadcrumbs(tester);
expect(breadcrumbs.length, 1);
expect(breadcrumbs.first.text, equals('Root [6.0 MB]'));
expect(find.byType(BreadcrumbNavigator), findsOneWidget);
expect(find.richText('package:flutter'), findsOneWidget);
expect(find.richText('dart:core'), findsOneWidget);
expect(find.byType(AppSizeAnalysisTable), findsOneWidget);
expect(find.byType(AppSizeDiffTable), findsNothing);
},
);
testWidgetsWithWindowSize(
'clears data',
windowSize,
(WidgetTester tester) async {
await pumpAppSizeScreen(
tester,
controller: appSizeController,
);
await loadDataAndPump(tester);
await tester.tap(find.byType(ClearButton));
await tester.pumpAndSettle();
expect(find.byType(FileImportContainer), findsOneWidget);
expect(find.text(AnalysisView.importInstructions), findsOneWidget);
expect(find.text('No File Selected'), findsOneWidget);
},
);
});
group('DiffView', () {
setUp(() {
screen = AppSizeScreen();
appSizeController = AppSizeTestController();
});
Future<void> loadDiffTabAndSettle(WidgetTester tester) async {
await pumpAppSizeScreen(
tester,
controller: appSizeController,
);
await tester.tap(find.byKey(AppSizeScreen.diffTabKey));
await tester.pumpAndSettle();
}
Future<void> loadDiffDataAndPump(
WidgetTester tester,
DevToolsJsonFile oldJsonFile,
DevToolsJsonFile newJsonFile,
) async {
appSizeController.loadDiffTreeFromJsonFiles(
oldFile: oldJsonFile,
newFile: newJsonFile,
onError: (error) => {},
);
await tester.pumpAndSettle();
}
testWidgetsWithWindowSize(
'builds initial content',
windowSize,
(WidgetTester tester) async {
await loadDiffTabAndSettle(tester);
expect(find.byKey(AppSizeScreen.diffTypeDropdownKey), findsOneWidget);
expect(find.byKey(AppSizeScreen.appUnitDropdownKey), findsNothing);
expect(find.byType(ClearButton), findsOneWidget);
expect(find.byType(DualFileImportContainer), findsOneWidget);
expect(find.byType(FileImportContainer), findsNWidgets(2));
expect(find.text(DiffView.importOldInstructions), findsOneWidget);
expect(find.text(DiffView.importNewInstructions), findsOneWidget);
expect(find.text('No File Selected'), findsNWidgets(2));
},
);
testWidgetsWithWindowSize(
'imports files and loads data',
windowSize,
(WidgetTester tester) async {
await loadDiffTabAndSettle(tester);
appSizeController.loadDiffTreeFromJsonFiles(
oldFile: oldV8JsonFile,
newFile: newV8JsonFile,
onError: (error) => {},
delayed: true,
);
await tester.pump(const Duration(milliseconds: 500));
expect(find.text(AppSizeScreen.loadingMessage), findsOneWidget);
await tester.pumpAndSettle();
expect(find.byType(FileImportContainer), findsNothing);
expect(find.text(DiffView.importOldInstructions), findsNothing);
expect(find.text(DiffView.importNewInstructions), findsNothing);
expect(find.text('No File Selected'), findsNothing);
expect(find.byType(DiffView), findsOneWidget);
expect(
find.text(
'Diffing Dart AOT snapshots: lib/src/app_size/stub_data/old_v8.dart - 7/28/2020 1:29 PM (OLD) vs (NEW) lib/src/app_size/stub_data/new_v8.dart - 7/28/2020 1:29 PM',
),
findsOneWidget,
);
expect(
find.byKey(AppSizeScreen.diffViewTreemapKey),
findsOneWidget,
);
expect(
find.byKey(AppSizeScreen.analysisViewTreemapKey),
findsNothing,
);
final breadcrumbs = _fetchBreadcrumbs(tester);
expect(breadcrumbs.length, 1);
expect(breadcrumbs.first.text, equals('Root [+1.5 MB]'));
expect(find.richText('package:pointycastle'), findsOneWidget);
expect(find.richText('package:flutter'), findsOneWidget);
expect(find.byType(AppSizeAnalysisTable), findsNothing);
expect(find.byType(AppSizeDiffTable), findsOneWidget);
},
);
testWidgetsWithWindowSize(
'loads data and shows different tree types',
windowSize,
(WidgetTester tester) async {
await loadDiffTabAndSettle(tester);
await loadDiffDataAndPump(tester, oldV8JsonFile, newV8JsonFile);
await tester.tap(find.byKey(AppSizeScreen.diffTypeDropdownKey));
await tester.pumpAndSettle();
await tester.tap(find.text('Increase Only').hitTestable());
await tester.pumpAndSettle();
final breadcrumbs = _fetchBreadcrumbs(tester);
expect(breadcrumbs.length, 1);
expect(breadcrumbs.first.text, equals('Root [+1.6 MB]'));
expect(find.richText('package:pointycastle'), findsOneWidget);
expect(find.richText('package:flutter'), findsOneWidget);
await tester.tap(find.byKey(AppSizeScreen.diffTypeDropdownKey));
await tester.pumpAndSettle();
await tester.tap(find.text('Decrease Only').hitTestable());
await tester.pumpAndSettle();
expect(find.richText('Root'), findsOneWidget);
expect(find.richText('package:memory'), findsOneWidget);
expect(find.richText('package:flutter'), findsOneWidget);
},
);
testWidgetsWithWindowSize(
'clears data',
windowSize,
(WidgetTester tester) async {
await loadDiffTabAndSettle(tester);
await loadDiffDataAndPump(tester, oldV8JsonFile, newV8JsonFile);
await tester.tap(find.byType(ClearButton));
await tester.pumpAndSettle();
expect(find.byType(DualFileImportContainer), findsOneWidget);
expect(find.byType(FileImportContainer), findsNWidgets(2));
expect(find.text(DiffView.importOldInstructions), findsOneWidget);
expect(find.text(DiffView.importNewInstructions), findsOneWidget);
expect(find.text('No File Selected'), findsNWidgets(2));
},
);
});
group('AppSizeController', () {
setUp(() {
screen = AppSizeScreen();
appSizeController = AppSizeTestController();
});
Future<void> pumpAppSizeScreenWithContext(
WidgetTester tester, {
required AppSizeTestController controller,
}) async {
await tester.pumpWidget(
wrapWithControllers(
MaterialApp(
builder: (context, child) => child!,
home: Builder(
builder: (context) {
return const AppSizeBody();
},
),
),
appSize: controller,
),
);
deferredLoadingSupportEnabled = true;
await tester.pumpAndSettle(const Duration(seconds: 1));
expect(find.byType(AppSizeBody), findsOneWidget);
}
Future<void> loadDiffTreeAndPump(
WidgetTester tester,
String firstFile,
String secondFile,
) async {
appSizeController.loadDiffTreeFromJsonFiles(
oldFile: DevToolsJsonFile(
name: '',
lastModifiedTime: lastModifiedTime,
data: json.decode(firstFile),
),
newFile: DevToolsJsonFile(
name: '',
lastModifiedTime: lastModifiedTime,
data: json.decode(secondFile),
),
onError: (error) => notificationService.push(error),
);
await tester.pumpAndSettle();
}
testWidgetsWithWindowSize(
'outputs error notifications for invalid input on the snapshot tab',
windowSize,
(WidgetTester tester) async {
await pumpAppSizeScreenWithContext(
tester,
controller: appSizeController,
);
appSizeController.loadTreeFromJsonFile(
jsonFile: DevToolsJsonFile(
name: 'unsupported_file.json',
lastModifiedTime: lastModifiedTime,
data: unsupportedFile,
),
onError: (error) => notificationService.push(error),
);
await tester.pumpAndSettle();
expect(
find.text(AppSizeController.unsupportedFileTypeError),
findsOneWidget,
);
},
);
testWidgetsWithWindowSize(
'outputs error notifications for invalid input on the diff tab',
windowSize,
(WidgetTester tester) async {
await pumpAppSizeScreenWithContext(
tester,
controller: appSizeController,
);
await tester.tap(find.byKey(AppSizeScreen.diffTabKey));
await tester.pumpAndSettle();
await loadDiffTreeAndPump(tester, newV8, newV8);
expect(
find.text(AppSizeController.identicalFilesError),
findsOneWidget,
);
await loadDiffTreeAndPump(tester, instructionSizes, newV8);
expect(
find.text(AppSizeController.differentTypesError),
findsOneWidget,
);
await loadDiffTreeAndPump(tester, unsupportedFile, unsupportedFile);
expect(
find.text(AppSizeController.unsupportedFileTypeError),
findsOneWidget,
);
},
);
testWidgetsWithWindowSize(
'builds deferred content for diff table',
windowSize,
(WidgetTester tester) async {
await pumpAppSizeScreen(
tester,
controller: appSizeController,
);
await tester.tap(find.byKey(AppSizeScreen.diffTabKey));
await tester.pumpAndSettle();
await loadDiffTreeAndPump(tester, diffNonDeferredApp, diffDeferredApp);
// Verify the dropdown for selecting app units exists.
final appUnitDropdownFinder = _findDropdownButton<AppUnit>();
expect(appUnitDropdownFinder, findsOneWidget);
// Open the app unit dropdown.
await tester.tap(appUnitDropdownFinder);
await tester.pumpAndSettle();
// Verify the menu items in the dropdown are expected.
final entireAppMenuItemFinder =
_findMenuItemWithText<AppUnit>('Entire App');
expect(entireAppMenuItemFinder, findsOneWidget);
final mainMenuItemFinder = _findMenuItemWithText<AppUnit>('Main');
expect(mainMenuItemFinder, findsOneWidget);
final deferredMenuItemFinder =
_findMenuItemWithText<AppUnit>('Deferred');
expect(deferredMenuItemFinder, findsOneWidget);
// Select the main unit.
await tester.tap(find.richText('Main').hitTestable());
await tester.pumpAndSettle();
// Verify the main unit is shown for entire app.
final mainBreadcrumbs = _fetchBreadcrumbs(tester);
expect(mainBreadcrumbs.length, 1);
expect(
mainBreadcrumbs.first.text,
equals(
'/Main/appsize_app.app/Contents/Frameworks/App.framework/Resources/flutter_assets [-344.3 KB]',
),
);
expect(
find.richText('packages/cupertino_icons/assets [-276.8 KB]'),
findsOneWidget,
);
// Open the diffType dropdown.
await tester.tap(find.byKey(AppSizeScreen.diffTypeDropdownKey));
await tester.pumpAndSettle();
// Select increase only.
await tester.tap(find.text('Increase Only').hitTestable());
await tester.pumpAndSettle();
// Verify the main unit is shown for increase only.
final mainIncreaseBreadcrumbs = _fetchBreadcrumbs(tester);
expect(mainIncreaseBreadcrumbs.length, 1);
expect(
mainIncreaseBreadcrumbs.first.text,
equals(
'/Main/appsize_app.app/Contents/Frameworks/App.framework/Resources/flutter_assets [0 B]',
),
);
// Open the diffType dropdown.
await tester.tap(find.byKey(AppSizeScreen.diffTypeDropdownKey));
await tester.pumpAndSettle();
// Select decrease only.
await tester.tap(find.text('Decrease Only').hitTestable());
await tester.pumpAndSettle();
// Verify the main unit is shown for decrease only.
final mainDecreaseBreadcrumbs = _fetchBreadcrumbs(tester);
expect(mainDecreaseBreadcrumbs.length, 1);
expect(
mainDecreaseBreadcrumbs.first.text,
equals(
'/Main/appsize_app.app/Contents/Frameworks/App.framework/Resources/flutter_assets [-344.3 KB]',
),
);
expect(
find.richText('packages/cupertino_icons/assets [-276.8 KB]'),
findsOneWidget,
);
// Open the diffType dropdown.
await tester.tap(find.byKey(AppSizeScreen.diffTypeDropdownKey));
await tester.pumpAndSettle();
// Select entire app.
await tester.tap(find.text('Combined').hitTestable());
await tester.pumpAndSettle();
// Open the app unit dropdown.
await tester.tap(appUnitDropdownFinder);
await tester.pumpAndSettle();
// Select the deferred units.
await tester.tap(find.text('Deferred').hitTestable());
await tester.pumpAndSettle();
// Verify the deferred units are shown for entire app.
final deferredBreadcrumbs = _fetchBreadcrumbs(tester);
expect(deferredBreadcrumbs.length, 1);
expect(
deferredBreadcrumbs.first.text,
equals('/Deferred/flutter_assets [+344.3 KB]'),
);
expect(
find.richText('packages/cupertino_icons/assets [+276.8 KB]'),
findsOneWidget,
);
// Open the diffType dropdown.
await tester.tap(find.byKey(AppSizeScreen.diffTypeDropdownKey));
await tester.pumpAndSettle();
// Select increase only.
await tester.tap(find.text('Increase Only').hitTestable());
await tester.pumpAndSettle();
// Verify the deferred unit is shown for increase only.
final deferredIncreaseBreadcrumbs = _fetchBreadcrumbs(tester);
expect(deferredIncreaseBreadcrumbs.length, 1);
expect(
deferredIncreaseBreadcrumbs.first.text,
equals(
'/Deferred/flutter_assets [+344.3 KB]',
),
);
expect(
find.richText('packages/cupertino_icons/assets [+276.8 KB]'),
findsOneWidget,
);
// Open the diffType dropdown.
await tester.tap(find.byKey(AppSizeScreen.diffTypeDropdownKey));
await tester.pumpAndSettle();
// Select decrease only.
await tester.tap(find.text('Decrease Only').hitTestable());
await tester.pumpAndSettle();
// Verify the main unit is shown for decrease only.
final deferredDecreaseBreadcrumbs = _fetchBreadcrumbs(tester);
expect(deferredDecreaseBreadcrumbs.length, 1);
expect(
deferredDecreaseBreadcrumbs.first.text,
equals(
'/Deferred/flutter_assets [0 B]',
),
);
},
);
});
}
class AppSizeTestController extends AppSizeController {
@override
void loadTreeFromJsonFile({
required DevToolsJsonFile jsonFile,
required void Function(String error) onError,
bool delayed = false,
}) async {
if (delayed) {
await delay();
}
super.loadTreeFromJsonFile(jsonFile: jsonFile, onError: onError);
}
@override
void loadDiffTreeFromJsonFiles({
required DevToolsJsonFile oldFile,
required DevToolsJsonFile newFile,
required void Function(String error) onError,
bool delayed = false,
}) async {
if (delayed) {
await delay();
}
super.loadDiffTreeFromJsonFiles(
oldFile: oldFile,
newFile: newFile,
onError: onError,
);
}
}
List<Breadcrumb> _fetchBreadcrumbs(WidgetTester tester) {
return tester
.widgetList(find.byType(Breadcrumb))
.map((widget) => widget as Breadcrumb)
.toList();
}
Finder _findDropdownButton<T>() {
return find.byType(DropdownButton<T>);
}
Finder _findMenuItemWithText<T>(String text) {
return find.descendant(
of: find.byType(DropdownMenuItem<T>),
matching: find.richText(text).hitTestable(),
);
}
| devtools/packages/devtools_app/test/app_size/app_size_screen_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/app_size/app_size_screen_test.dart",
"repo_id": "devtools",
"token_count": 10536
} | 160 |
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app/src/screens/debugger/codeview_controller.dart';
import 'package:devtools_app/src/service/service_manager.dart';
import 'package:devtools_app/src/shared/console/primitives/eval_history.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:devtools_test/devtools_test.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:vm_service/vm_service.dart';
void main() {
setGlobal(ServiceConnectionManager, FakeServiceConnectionManager());
group('ScriptsHistory', () {
late ScriptsHistory history;
final ScriptRef ref1 = ScriptRef(uri: 'package:foo/foo.dart', id: 'id-1');
final ScriptRef ref2 = ScriptRef(uri: 'package:bar/bar.dart', id: 'id-2');
final ScriptRef ref3 = ScriptRef(uri: 'package:baz/baz.dart', id: 'id-3');
setUp(() {
history = ScriptsHistory();
});
test('initial values', () {
expect(history.hasNext, false);
expect(history.hasPrevious, false);
expect(history.current.value, isNull);
expect(history.hasScripts, false);
});
test('moveBack', () {
history.pushEntry(ref1);
history.pushEntry(ref2);
history.pushEntry(ref3);
expect(history.hasNext, false);
expect(history.hasPrevious, true);
expect(history.current.value, ref3);
history.moveBack();
expect(history.hasNext, true);
expect(history.hasPrevious, true);
expect(history.current.value, ref2);
history.moveBack();
expect(history.hasNext, true);
expect(history.hasPrevious, false);
expect(history.current.value, ref1);
});
test('moveForward', () {
history.pushEntry(ref1);
history.pushEntry(ref2);
expect(history.hasNext, false);
expect(history.hasPrevious, true);
expect(history.current.value, ref2);
history.moveBack();
expect(history.hasNext, true);
expect(history.hasPrevious, false);
expect(history.current.value, ref1);
history.moveForward();
expect(history.hasNext, false);
expect(history.hasPrevious, true);
expect(history.current.value, ref2);
});
test('openedScripts', () {
history.pushEntry(ref1);
history.pushEntry(ref2);
history.pushEntry(ref3);
expect(history.openedScripts, orderedEquals([ref3, ref2, ref1]));
// verify that pushing re-orders
history.pushEntry(ref2);
expect(history.openedScripts, orderedEquals([ref2, ref3, ref1]));
});
test('ref can be in history twice', () {
history.pushEntry(ref1);
history.pushEntry(ref2);
history.pushEntry(ref1);
history.pushEntry(ref2);
expect(history.current.value, ref2);
history.moveBack();
expect(history.current.value, ref1);
history.moveBack();
expect(history.current.value, ref2);
history.moveBack();
expect(history.current.value, ref1);
});
test('pushEntry removes next entries', () {
history.pushEntry(ref1);
history.pushEntry(ref2);
expect(history.current.value, ref2);
expect(history.hasNext, isFalse);
history.moveBack();
expect(history.current.value, ref1);
expect(history.hasNext, isTrue);
history.pushEntry(ref3);
expect(history.current.value, ref3);
expect(history.hasNext, isFalse);
});
});
group('EvalHistory', () {
late EvalHistory evalHistory;
setUp(() {
evalHistory = EvalHistory();
});
test('starts empty', () {
expect(evalHistory.evalHistory, <Object?>[]);
expect(evalHistory.currentText, null);
expect(evalHistory.canNavigateDown, false);
expect(evalHistory.canNavigateUp, false);
});
test('pushEvalHistory', () {
evalHistory.pushEvalHistory('aaa');
evalHistory.pushEvalHistory('bbb');
evalHistory.pushEvalHistory('ccc');
expect(evalHistory.currentText, null);
evalHistory.navigateUp();
expect(evalHistory.currentText, 'ccc');
evalHistory.navigateUp();
expect(evalHistory.currentText, 'bbb');
evalHistory.navigateUp();
expect(evalHistory.currentText, 'aaa');
});
test('navigateUp', () {
expect(evalHistory.canNavigateUp, false);
expect(evalHistory.currentText, null);
evalHistory.pushEvalHistory('aaa');
evalHistory.pushEvalHistory('bbb');
expect(evalHistory.canNavigateUp, true);
expect(evalHistory.currentText, null);
evalHistory.navigateUp();
expect(evalHistory.canNavigateUp, true);
expect(evalHistory.currentText, 'bbb');
evalHistory.navigateUp();
expect(evalHistory.canNavigateUp, false);
expect(evalHistory.currentText, 'aaa');
evalHistory.navigateUp();
expect(evalHistory.currentText, 'aaa');
});
test('navigateDown', () {
expect(evalHistory.canNavigateDown, false);
expect(evalHistory.currentText, null);
evalHistory.pushEvalHistory('aaa');
evalHistory.pushEvalHistory('bbb');
expect(evalHistory.canNavigateDown, false);
evalHistory.navigateUp();
evalHistory.navigateUp();
expect(evalHistory.canNavigateDown, true);
expect(evalHistory.currentText, 'aaa');
evalHistory.navigateDown();
expect(evalHistory.canNavigateDown, true);
expect(evalHistory.currentText, 'bbb');
evalHistory.navigateDown();
expect(evalHistory.canNavigateDown, false);
expect(evalHistory.currentText, null);
evalHistory.navigateDown();
expect(evalHistory.canNavigateDown, false);
expect(evalHistory.currentText, null);
});
test('pushEvalHistory reset position', () {
evalHistory.pushEvalHistory('aaa');
evalHistory.pushEvalHistory('bbb');
expect(evalHistory.currentText, null);
expect(evalHistory.canNavigateDown, false);
evalHistory.navigateUp();
expect(evalHistory.currentText, 'bbb');
expect(evalHistory.canNavigateDown, true);
evalHistory.pushEvalHistory('ccc');
expect(evalHistory.currentText, null);
expect(evalHistory.canNavigateDown, false);
});
});
group('search', () {
late CodeViewController debuggerController;
setUp(() {
debuggerController = TestCodeViewController();
debuggerController.parsedScript.value = ParsedScript(
script: testScript,
highlighter: mockSyntaxHighlighter,
executableLines: const {},
sourceReport: const ProcessedSourceReport.empty(),
);
});
test('matchesForSearch', () {
expect(
debuggerController.matchesForSearch('import').toString(),
equals('[0:0-6, 1:0-6, 2:0-6]'),
);
expect(
debuggerController.matchesForSearch('foo').toString(),
equals('[1:8-11, 2:8-11]'),
);
expect(
debuggerController.matchesForSearch('bar').toString(),
equals('[0:8-11, 2:11-14]'),
);
expect(
debuggerController.matchesForSearch('hello world').toString(),
equals('[5:28-39, 6:9-20]'),
);
expect(
debuggerController.matchesForSearch('').toString(),
equals('[]'),
);
});
});
}
final testScript = Script(
source: '''
import 'bar.dart';
import 'foo.dart';
import 'foobar.dart';
void main() {
// This is a comment in a hello world app.
print('hello world');
}
''',
id: 'test-script',
uri: 'debugger/test/script.dart',
library: LibraryRef(
id: 'debugger-test-lib',
name: 'debugger-test',
uri: 'debugger/test',
),
);
| devtools/packages/devtools_app/test/debugger/debugger_controller_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/debugger/debugger_controller_test.dart",
"repo_id": "devtools",
"token_count": 3004
} | 161 |
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:convert';
import 'dart:typed_data';
import 'package:devtools_app/devtools_app.dart';
import 'package:devtools_app/src/shared/diagnostics/dart_object_node.dart';
import 'package:devtools_app/src/shared/diagnostics/tree_builder.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:devtools_test/devtools_test.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/mockito.dart';
import 'package:vm_service/vm_service.dart';
const isolateId = '1';
const objectId = '123';
final isolateRef = IsolateRef(
id: isolateId,
number: '2',
name: 'main',
isSystemIsolate: false,
);
void main() {
late ServiceConnectionManager manager;
setUp(() {
final service = createMockVmServiceWrapperWithDefaults();
manager = FakeServiceConnectionManager(service: service);
setGlobal(ServiceConnectionManager, manager);
});
test('Creates bound variables for Uint8ClampedList instance', () async {
final bytes = Uint8ClampedList.fromList([0, 1, 2, 3]);
final instance = Instance(
kind: InstanceKind.kUint8ClampedList,
id: objectId,
bytes: base64.encode(bytes.buffer.asUint8List()),
length: 4,
);
final variable = DartObjectNode.create(
BoundVariable(
name: 'test',
value: instance,
),
isolateRef,
);
when(manager.serviceManager.service!.getObject(isolateId, objectId))
.thenAnswer((_) async {
return instance;
});
await buildVariablesTree(variable);
expect(variable.children, [
matchesVariable(name: '[0]', value: 0),
matchesVariable(name: '[1]', value: 1),
matchesVariable(name: '[2]', value: 2),
matchesVariable(name: '[3]', value: 3),
]);
});
test('Creates bound variables for Uint8List instance', () async {
final bytes = Uint8List.fromList([0, 1, 2, 3]);
final instance = Instance(
kind: InstanceKind.kUint8List,
id: objectId,
bytes: base64.encode(bytes.buffer.asUint8List()),
length: 4,
);
final variable = DartObjectNode.create(
BoundVariable(
name: 'test',
value: instance,
),
isolateRef,
);
when(manager.serviceManager.service!.getObject(isolateId, objectId))
.thenAnswer((_) async {
return instance;
});
await buildVariablesTree(variable);
expect(variable.children, [
matchesVariable(name: '[0]', value: 0),
matchesVariable(name: '[1]', value: 1),
matchesVariable(name: '[2]', value: 2),
matchesVariable(name: '[3]', value: 3),
]);
});
test('Creates bound variables for Uint16List instance', () async {
final bytes = Uint16List.fromList([0, 513, 514, 515]);
final instance = Instance(
kind: InstanceKind.kUint16List,
id: objectId,
bytes: base64.encode(bytes.buffer.asUint8List()),
length: 4,
);
final variable = DartObjectNode.create(
BoundVariable(
name: 'test',
value: instance,
),
isolateRef,
);
when(manager.serviceManager.service!.getObject(isolateId, objectId))
.thenAnswer((_) async {
return instance;
});
await buildVariablesTree(variable);
expect(variable.children, [
matchesVariable(name: '[0]', value: 0),
matchesVariable(name: '[1]', value: 513),
matchesVariable(name: '[2]', value: 514),
matchesVariable(name: '[3]', value: 515),
]);
});
test('Creates bound variables for Uint32List instance', () async {
final bytes = Uint32List.fromList([0, 131072, 131073, 131074]);
final instance = Instance(
kind: InstanceKind.kUint32List,
id: objectId,
bytes: base64.encode(bytes.buffer.asUint8List()),
length: 4,
);
final variable = DartObjectNode.create(
BoundVariable(
name: 'test',
value: instance,
),
isolateRef,
);
when(manager.serviceManager.service!.getObject(isolateId, objectId))
.thenAnswer((_) async {
return instance;
});
await buildVariablesTree(variable);
expect(variable.children, [
matchesVariable(name: '[0]', value: 0),
matchesVariable(name: '[1]', value: 131072),
matchesVariable(name: '[2]', value: 131073),
matchesVariable(name: '[3]', value: 131074),
]);
});
test(
'Creates bound variables for Uint64List instance',
() async {
final bytes =
Uint64List.fromList([0, 4294967296, 4294967297, 4294967298]);
final instance = Instance(
kind: InstanceKind.kUint64List,
id: objectId,
bytes: base64.encode(bytes.buffer.asUint8List()),
length: 4,
);
final variable = DartObjectNode.create(
BoundVariable(
name: 'test',
value: instance,
),
isolateRef,
);
when(manager.serviceManager.service!.getObject(isolateId, objectId))
.thenAnswer((_) async {
return instance;
});
await buildVariablesTree(variable);
expect(variable.children, [
matchesVariable(name: '[0]', value: 0),
matchesVariable(name: '[1]', value: 4294967296),
matchesVariable(name: '[2]', value: 4294967297),
matchesVariable(name: '[3]', value: 4294967298),
]);
},
skip: kIsWeb,
);
test('Creates bound variables for Int8List instance', () async {
final bytes = Int8List.fromList([0, 1, -2, 3]);
final instance = Instance(
kind: InstanceKind.kInt8List,
id: objectId,
bytes: base64.encode(bytes.buffer.asUint8List()),
length: 4,
);
final variable = DartObjectNode.create(
BoundVariable(
name: 'test',
value: instance,
),
isolateRef,
);
when(manager.serviceManager.service!.getObject(isolateId, objectId))
.thenAnswer((_) async {
return instance;
});
await buildVariablesTree(variable);
expect(variable.children, [
matchesVariable(name: '[0]', value: 0),
matchesVariable(name: '[1]', value: 1),
matchesVariable(name: '[2]', value: -2),
matchesVariable(name: '[3]', value: 3),
]);
});
test('Creates bound variables for Int16List instance', () async {
final bytes = Int16List.fromList([0, 513, -514, 515]);
final instance = Instance(
kind: InstanceKind.kInt16List,
id: objectId,
bytes: base64.encode(bytes.buffer.asUint8List()),
length: 4,
);
final variable = DartObjectNode.create(
BoundVariable(
name: 'test',
value: instance,
),
isolateRef,
);
when(manager.serviceManager.service!.getObject(isolateId, objectId))
.thenAnswer((_) async {
return instance;
});
await buildVariablesTree(variable);
expect(variable.children, [
matchesVariable(name: '[0]', value: 0),
matchesVariable(name: '[1]', value: 513),
matchesVariable(name: '[2]', value: -514),
matchesVariable(name: '[3]', value: 515),
]);
});
test('Creates bound variables for Int32List instance', () async {
final bytes = Int32List.fromList([0, 131072, -131073, 131074]);
final instance = Instance(
kind: InstanceKind.kInt32List,
id: objectId,
bytes: base64.encode(bytes.buffer.asUint8List()),
length: 4,
);
final variable = DartObjectNode.create(
BoundVariable(
name: 'test',
value: instance,
),
isolateRef,
);
when(manager.serviceManager.service!.getObject(isolateId, objectId))
.thenAnswer((_) async {
return instance;
});
await buildVariablesTree(variable);
expect(variable.children, [
matchesVariable(name: '[0]', value: 0),
matchesVariable(name: '[1]', value: 131072),
matchesVariable(name: '[2]', value: -131073),
matchesVariable(name: '[3]', value: 131074),
]);
});
test(
'Creates bound variables for Int64List instance',
() async {
final bytes =
Int64List.fromList([0, 4294967296, -4294967297, 4294967298]);
final instance = Instance(
kind: InstanceKind.kInt64List,
id: objectId,
bytes: base64.encode(bytes.buffer.asUint8List()),
length: 4,
);
final variable = DartObjectNode.create(
BoundVariable(
name: 'test',
value: instance,
),
isolateRef,
);
when(manager.serviceManager.service!.getObject(isolateId, objectId))
.thenAnswer((_) async {
return instance;
});
await buildVariablesTree(variable);
expect(variable.children, [
matchesVariable(name: '[0]', value: 0),
matchesVariable(name: '[1]', value: 4294967296),
matchesVariable(name: '[2]', value: -4294967297),
matchesVariable(name: '[3]', value: 4294967298),
]);
},
skip: kIsWeb,
); // Int64List cannot be instantiated on the web.
test('Creates bound variables for Float32List instance', () async {
final bytes =
Float32List.fromList([0, 2.2300031185150146, -4.610400199890137]);
final instance = Instance(
kind: InstanceKind.kFloat32List,
id: objectId,
bytes: base64.encode(bytes.buffer.asUint8List()),
length: 4,
);
final variable = DartObjectNode.create(
BoundVariable(
name: 'test',
value: instance,
),
isolateRef,
);
when(manager.serviceManager.service!.getObject(isolateId, objectId))
.thenAnswer((_) async {
return instance;
});
await buildVariablesTree(variable);
expect(variable.children, [
matchesVariable(name: '[0]', value: 0),
matchesVariable(name: '[1]', value: 2.2300031185150146),
matchesVariable(name: '[2]', value: -4.610400199890137),
]);
});
test('Creates bound variables for Float64List instance', () async {
final bytes = Float64List.fromList([0, 5532.130793, -7532.130793]);
final instance = Instance(
kind: InstanceKind.kFloat64List,
id: objectId,
bytes: base64.encode(bytes.buffer.asUint8List()),
length: 4,
);
final variable = DartObjectNode.create(
BoundVariable(
name: 'test',
value: instance,
),
isolateRef,
);
when(manager.serviceManager.service!.getObject(isolateId, objectId))
.thenAnswer((_) async {
return instance;
});
await buildVariablesTree(variable);
expect(variable.children, [
matchesVariable(name: '[0]', value: 0),
matchesVariable(name: '[1]', value: 5532.130793),
matchesVariable(name: '[2]', value: -7532.130793),
]);
});
test('Creates bound variables for Int32x4List instance', () async {
final bytes =
Int32x4List.fromList([Int32x4.bool(true, false, true, false)]);
final instance = Instance(
kind: InstanceKind.kInt32x4List,
id: objectId,
bytes: base64.encode(bytes.buffer.asUint8List()),
length: 4,
);
final variable = DartObjectNode.create(
BoundVariable(
name: 'test',
value: instance,
),
isolateRef,
);
when(manager.serviceManager.service!.getObject(isolateId, objectId))
.thenAnswer((_) async {
return instance;
});
await buildVariablesTree(variable);
expect(
variable.children.first.displayValue,
'[ffffffff, 00000000, ffffffff, 00000000]',
skip: kIsWeb,
);
// Formatting is different on the web.
expect(
variable.children.first.displayValue,
'[-1, 0, -1, 0]',
skip: !kIsWeb,
);
});
test('Creates bound variables for Float32x4List instance', () async {
final bytes = Float32x4List.fromList(
[Float32x4(0.0, -232.1999969482422, 2.3299999237060547, 9.0)],
);
final instance = Instance(
kind: InstanceKind.kFloat32x4List,
id: objectId,
bytes: base64.encode(bytes.buffer.asUint8List()),
length: 4,
);
final variable = DartObjectNode.create(
BoundVariable(
name: 'test',
value: instance,
),
isolateRef,
);
when(manager.serviceManager.service!.getObject(isolateId, objectId))
.thenAnswer((_) async {
return instance;
});
await buildVariablesTree(variable);
expect(
variable.children.first.displayValue,
'[0.000000, -232.199997, 2.330000, 9.000000]',
skip: kIsWeb,
);
expect(
variable.children.first.displayValue,
'[0, -232.1999969482422, 2.3299999237060547, 9]',
skip: !kIsWeb,
);
});
test('Creates bound variables for Float64x2List instance', () async {
final bytes = Float64x2List.fromList([Float64x2(0, -1232.222)]);
final instance = Instance(
kind: InstanceKind.kFloat64x2List,
id: objectId,
bytes: base64.encode(bytes.buffer.asUint8List()),
length: 4,
);
final variable = DartObjectNode.create(
BoundVariable(
name: 'test',
value: instance,
),
isolateRef,
);
when(manager.serviceManager.service!.getObject(isolateId, objectId))
.thenAnswer((_) async {
return instance;
});
await buildVariablesTree(variable);
expect(
variable.children.first.displayValue,
'[0.000000, -1232.222000]',
skip: kIsWeb,
);
expect(
variable.children.first.displayValue,
'[0, -1232.222]',
skip: !kIsWeb,
);
});
test(
'Creates bound variable with groupings for children for a large Uint8ClampedList instance',
() async {
final instance = Instance(
kind: InstanceKind.kUint8ClampedList,
id: objectId,
length: 332,
);
final variable = DartObjectNode.create(
BoundVariable(
name: 'test',
value: instance,
),
isolateRef,
);
await buildVariablesTree(variable);
expect(variable.children, [
matchesVariableGroup(start: 0, end: 99),
matchesVariableGroup(start: 100, end: 199),
matchesVariableGroup(start: 200, end: 299),
matchesVariableGroup(start: 300, end: 331),
]);
},
);
test(
'Creates groupings of exactly 100 if the length is a multiple of 100',
() async {
final instance = Instance(
kind: InstanceKind.kUint8ClampedList,
id: objectId,
length: 300,
);
final variable = DartObjectNode.create(
BoundVariable(
name: 'test',
value: instance,
),
isolateRef,
);
await buildVariablesTree(variable);
expect(variable.children, [
matchesVariableGroup(start: 0, end: 99),
matchesVariableGroup(start: 100, end: 199),
matchesVariableGroup(start: 200, end: 299),
]);
},
);
}
Matcher matchesVariable({
required String name,
required Object value,
}) {
return const TypeMatcher<DartObjectNode>().having(
(v) => v,
'boundVar',
const TypeMatcher<DartObjectNode>()
.having((v) => v.name, 'name', equals(name))
.having((v) => v.ref!.value, 'value', equals(value)),
);
}
Matcher matchesVariableGroup({
required int start,
required int end,
}) {
return const TypeMatcher<DartObjectNode>().having(
(v) => v,
'boundVar',
const TypeMatcher<DartObjectNode>()
.having((v) => v.text, 'text', equals('[$start - $end]')),
);
}
| devtools/packages/devtools_app/test/debugger/typed_data_variable_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/debugger/typed_data_variable_test.dart",
"repo_id": "devtools",
"token_count": 6498
} | 162 |
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@TestOn('vm')
import 'dart:io';
import 'package:flutter_test/flutter_test.dart';
import 'app.dart';
import 'debugger.dart';
import 'integration.dart';
import 'logging.dart';
void main() {
group('integration', () {
// TODO(#1965): fix and re-enable integration tests.
// ignore: dead_code
if (false) {
setUpAll(() async {
final bool testInReleaseMode =
Platform.environment['WEBDEV_RELEASE'] == 'true';
webBuildFixture = await WebBuildFixture.serve(
release: testInReleaseMode,
verbose: true,
);
browserManager = await BrowserManager.create();
});
tearDownAll(() async {
browserManager.teardown();
await webBuildFixture.teardown();
});
group('app', appTests, skip: true);
group('logging', loggingTests, skip: true);
// Temporarily skip tests. See https://github.com/flutter/devtools/issues/1343.
group('debugging', debuggingTests, skip: true);
}
});
}
| devtools/packages/devtools_app/test/legacy_integration_tests/integration_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/legacy_integration_tests/integration_test.dart",
"repo_id": "devtools",
"token_count": 457
} | 163 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app/src/screens/memory/framework/connected/memory_tabs.dart';
import 'package:devtools_app/src/screens/memory/framework/memory_screen.dart';
import 'package:devtools_app/src/screens/memory/panes/profile/model.dart';
import 'package:devtools_app/src/screens/memory/panes/profile/profile_pane_controller.dart';
import 'package:devtools_app/src/screens/vm_developer/vm_service_private_extensions.dart';
import 'package:devtools_app/src/shared/globals.dart';
import 'package:devtools_app/src/shared/primitives/byte_utils.dart';
import 'package:devtools_app/src/shared/primitives/utils.dart';
import 'package:devtools_app/src/shared/table/table.dart';
import 'package:devtools_test/devtools_test.dart';
import 'package:devtools_test/helpers.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import '../../test_infra/scenes/memory/default.dart';
import '../../test_infra/scenes/scene_test_extensions.dart';
void main() {
late MemoryDefaultScene scene;
setUp(() async {
scene = MemoryDefaultScene();
await scene.setUp();
});
Future<void> pumpMemoryScreen(WidgetTester tester) async {
await tester.pumpScene(scene);
// Delay to ensure the memory profiler has collected data.
await tester.pumpAndSettle(const Duration(seconds: 1));
expect(find.byType(MemoryBody), findsOneWidget);
}
// Set a wide enough screen width that we do not run into overflow.
const windowSize = Size(2225.0, 1200.0);
//setGlobal(NotificationService, NotificationService());
group('Allocation Profile Table', () {
Future<void> navigateToAllocationProfile(
WidgetTester tester,
ProfilePaneController allocationProfileController,
) async {
await tester.tap(find.byKey(MemoryScreenKeys.dartHeapTableProfileTab));
await tester.pumpAndSettle();
// We should have requested an allocation profile by navigating to the tab.
expect(
allocationProfileController.currentAllocationProfile.value,
isNotNull,
);
}
testWidgetsWithWindowSize(
'respects VM Developer Mode setting',
windowSize,
(WidgetTester tester) async {
await pumpMemoryScreen(tester);
final allocationProfileController =
scene.controller.controllers.profile;
preferences.toggleVmDeveloperMode(false);
await navigateToAllocationProfile(tester, allocationProfileController);
// Only "total" statistics are shown when VM Developer Mode is disabled.
expect(preferences.vmDeveloperModeEnabled.value, isFalse);
expect(find.text('Class'), findsOneWidget);
expect(find.text('Instances'), findsOneWidget);
expect(find.text('Total Size'), findsOneWidget);
expect(find.text('Dart Heap'), findsOneWidget);
expect(find.text('External'), findsNothing);
expect(find.text('Old Space'), findsNothing);
expect(find.text('New Space'), findsNothing);
expect(find.text('Usage'), findsNothing);
expect(find.text('Capacity'), findsNothing);
expect(find.text('Collections'), findsNothing);
expect(find.text('Latency'), findsNothing);
// Enable VM Developer Mode to display new/old space column groups as
// well as GC statistics.
preferences.toggleVmDeveloperMode(true);
await tester.pumpAndSettle();
expect(preferences.vmDeveloperModeEnabled.value, isTrue);
expect(find.text('Class'), findsOneWidget);
expect(find.text('Instances'), findsNWidgets(3));
expect(find.text('Total Size'), findsNWidgets(3));
expect(find.text('Dart Heap'), findsNWidgets(3));
expect(find.text('External'), findsNWidgets(3));
expect(find.text('Total'), findsOneWidget);
expect(find.text('Old Space'), findsOneWidget);
expect(find.text('New Space'), findsOneWidget);
expect(find.text('Usage'), findsNWidgets(3));
expect(find.text('Capacity'), findsNWidgets(3));
expect(find.text('Collections'), findsNWidgets(3));
expect(find.text('Latency'), findsNWidgets(3));
final currentProfile =
allocationProfileController.currentAllocationProfile.value!;
void checkGCStats(GCStats stats) {
// Usage
expect(
find.text(
prettyPrintBytes(
stats.usage,
includeUnit: true,
)!,
findRichText: true,
),
findsWidgets,
);
// Capacity
expect(
find.text(
prettyPrintBytes(
stats.capacity,
includeUnit: true,
)!,
findRichText: true,
),
findsWidgets,
);
// Average collection time
expect(
find.text(
durationText(
Duration(milliseconds: stats.averageCollectionTime.toInt()),
fractionDigits: 2,
),
findRichText: true,
),
findsWidgets,
);
// # of collections
expect(
find.text(
stats.collections.toString(),
findRichText: true,
),
findsWidgets,
);
}
checkGCStats(currentProfile.newSpaceGCStats);
checkGCStats(currentProfile.oldSpaceGCStats);
checkGCStats(currentProfile.totalGCStats);
},
);
testWidgetsWithWindowSize(
'manually refreshes',
windowSize,
(WidgetTester tester) async {
await pumpMemoryScreen(tester);
final allocationProfileController =
scene.controller.controllers.profile;
await navigateToAllocationProfile(tester, allocationProfileController);
// We'll clear it for now so we can tell when it's refreshed.
allocationProfileController.clearCurrentProfile();
await tester.pump();
// Refresh the profile.
await tester.tap(
find.byIcon(Icons.refresh).first,
);
await tester.pumpAndSettle();
// Ensure that we have populated the current allocation profile.
expect(
allocationProfileController.currentAllocationProfile.value,
isNotNull,
);
expect(find.text('Class'), findsOneWidget);
},
);
testWidgetsWithWindowSize(
'refreshes on GC',
windowSize,
(WidgetTester tester) async {
await pumpMemoryScreen(tester);
final allocationProfileController =
scene.controller.controllers.profile;
await navigateToAllocationProfile(tester, allocationProfileController);
// We'll clear it for now so we can tell when it's refreshed.
allocationProfileController.clearCurrentProfile();
await tester.pump();
// Emit a GC event and confirm we don't perform a refresh.
final fakeService = scene.fakeServiceConnection.serviceManager.service
as FakeVmServiceWrapper;
fakeService.emitGCEvent();
expect(
allocationProfileController.currentAllocationProfile.value,
isNull,
);
// Enable "Refresh on GC" functionality.
await tester.tap(
find.text('Refresh on GC').first,
);
await tester.pump();
// Emit a GC event to trigger a refresh.
fakeService.emitGCEvent();
await tester.pumpAndSettle();
// Ensure that we have populated the current allocation profile.
expect(
allocationProfileController.currentAllocationProfile.value,
isNotNull,
);
},
);
// Regression test for https://github.com/flutter/devtools/issues/4484.
testWidgetsWithWindowSize(
'sorts correctly',
windowSize,
(WidgetTester tester) async {
await pumpMemoryScreen(tester);
final table = find.byType(FlatTable<ProfileRecord>);
expect(table, findsOneWidget);
final cls = find.text('Class');
final instances = find.text('Instances');
final size = find.text('Total Size');
final dartHeap = find.text('Dart Heap');
final columns = <Finder>[
cls,
instances,
size,
dartHeap,
];
for (final columnFinder in columns) {
expect(columnFinder, findsOneWidget);
}
final state = tester.state<FlatTableState<ProfileRecord>>(table.first);
var data = state.tableController.tableData.value.data;
// Initial state should be sorted by size, largest to smallest.
int lastValue = data.first.totalDartHeapSize;
for (final element in data) {
expect(element.totalDartHeapSize <= lastValue, isTrue);
lastValue = element.totalDartHeapSize;
}
// Sort by size, smallest to largest.
await tester.tap(size);
await tester.pumpAndSettle();
data = state.tableController.tableData.value.data;
lastValue = data.first.totalDartHeapSize;
for (final element in data) {
expect(element.totalDartHeapSize >= lastValue, isTrue);
lastValue = element.totalDartHeapSize;
}
// Sort by class name, alphabetically
await tester.tap(cls);
await tester.pumpAndSettle();
data = state.tableController.tableData.value.data;
String lastClassName = data.first.heapClass.className;
for (final element in data) {
final name = element.heapClass.className;
expect(name.compareTo(lastClassName) >= 0, isTrue);
lastClassName = name;
}
// Sort by class name, reverse alphabetical order
await tester.tap(cls);
await tester.pumpAndSettle();
data = state.tableController.tableData.value.data;
lastClassName = data.first.heapClass.className;
for (final element in data) {
final name = element.heapClass.className;
expect(name.compareTo(lastClassName) <= 0, isTrue);
lastClassName = name;
}
// Sort by instance count, largest to smallest.
await tester.tap(instances);
await tester.pumpAndSettle();
data = state.tableController.tableData.value.data;
lastValue = data.first.totalInstances!;
for (final element in data) {
if (element.isTotal) continue;
expect(element.totalInstances! <= lastValue, isTrue);
lastValue = element.totalInstances!;
}
// Sort by instance count, smallest to largest.
await tester.tap(instances);
await tester.pumpAndSettle();
data = state.tableController.tableData.value.data;
lastValue = data.first.totalInstances!;
for (final element in data) {
expect(element.totalInstances! >= lastValue, isTrue);
lastValue = element.totalInstances!;
}
// Sort by dart heap size, largest to smallest.
await tester.tap(dartHeap);
await tester.pumpAndSettle();
data = state.tableController.tableData.value.data;
lastValue = data.first.totalDartHeapSize;
for (final element in data) {
final internalSize = element.totalDartHeapSize;
expect(internalSize <= lastValue, isTrue);
lastValue = internalSize;
}
// Sort by dart heap size, smallest to largest.
await tester.tap(dartHeap);
await tester.pumpAndSettle();
data = state.tableController.tableData.value.data;
lastValue = data.first.totalDartHeapSize;
for (final element in data) {
final internalSize = element.totalDartHeapSize;
expect(internalSize >= lastValue, isTrue);
lastValue = internalSize;
}
},
);
});
}
| devtools/packages/devtools_app/test/memory/profile/allocation_profile_table_view_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/memory/profile/allocation_profile_table_view_test.dart",
"repo_id": "devtools",
"token_count": 4983
} | 164 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app/devtools_app.dart';
import 'package:flutter_test/flutter_test.dart';
import '../../test_infra/test_data/performance/sample_performance_data.dart';
void main() {
group('$FlutterFrame', () {
test('shaderDuration', () {
expect(testFrame0.shaderDuration.inMicroseconds, equals(0));
expect(testFrame1.shaderDuration.inMicroseconds, equals(0));
expect(jankyFrame.shaderDuration.inMicroseconds, equals(0));
expect(jankyFrameUiOnly.shaderDuration.inMicroseconds, equals(0));
expect(jankyFrameRasterOnly.shaderDuration.inMicroseconds, equals(0));
expect(
testFrameWithShaderJank.shaderDuration.inMicroseconds,
equals(10010),
);
expect(
testFrameWithSubtleShaderJank.shaderDuration.inMicroseconds,
equals(3010),
);
});
test('hasShaderTime', () {
expect(testFrame0.hasShaderTime, isFalse);
expect(testFrame1.hasShaderTime, isFalse);
expect(jankyFrame.hasShaderTime, isFalse);
expect(jankyFrameUiOnly.hasShaderTime, isFalse);
expect(jankyFrameRasterOnly.hasShaderTime, isFalse);
expect(testFrameWithShaderJank.hasShaderTime, isTrue);
expect(testFrameWithSubtleShaderJank.hasShaderTime, isTrue);
});
test('hasShaderJank', () {
expect(testFrame0.hasShaderJank(defaultRefreshRate), isFalse);
expect(testFrame1.hasShaderJank(defaultRefreshRate), isFalse);
expect(jankyFrame.hasShaderJank(defaultRefreshRate), isFalse);
expect(jankyFrameUiOnly.hasShaderJank(defaultRefreshRate), isFalse);
expect(jankyFrameRasterOnly.hasShaderJank(defaultRefreshRate), isFalse);
expect(testFrameWithShaderJank.hasShaderJank(defaultRefreshRate), isTrue);
expect(
testFrameWithSubtleShaderJank.hasShaderJank(defaultRefreshRate),
isFalse,
);
});
});
}
| devtools/packages/devtools_app/test/performance/flutter_frames/flutter_frame_model_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/performance/flutter_frames/flutter_frame_model_test.dart",
"repo_id": "devtools",
"token_count": 789
} | 165 |
// Copyright 2024 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:convert';
import 'package:devtools_app/devtools_app.dart';
import 'package:fixnum/fixnum.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:vm_service_protos/vm_service_protos.dart';
import '../../../test_infra/test_data/performance/sample_performance_data.dart';
void main() {
group('$PerfettoTrace', () {
test('setting trace with new trace object notifies listeners', () {
final startingTrace = Trace();
final perfettoTrace = PerfettoTrace(startingTrace);
final newTrace = Trace();
bool notified = false;
perfettoTrace.addListener(() => notified = true);
perfettoTrace.trace = newTrace;
expect(perfettoTrace.trace, newTrace);
expect(notified, isTrue);
});
test('setting trace with identical object notifies listeners', () {
final trace = Trace();
final perfettoTrace = PerfettoTrace(trace);
bool notified = false;
perfettoTrace.addListener(() => notified = true);
perfettoTrace.trace = trace;
expect(notified, isTrue);
});
});
group('$PerfettoTrackDescriptorEvent', () {
late PerfettoTrackDescriptorEvent trackDescriptor;
setUp(() {
trackDescriptor = PerfettoTrackDescriptorEvent(
TrackDescriptor.fromJson(jsonEncode(trackDescriptorEvents.first)),
);
});
test('can successfully read fields', () {
expect(trackDescriptor.name, 'io.flutter.1.raster');
expect(trackDescriptor.id, Int64(31491));
});
});
group('$PerfettoTrackEvent', () {
late PerfettoTrackEvent trackEvent;
test('UI track events', () {
trackEvent = PerfettoTrackEvent.fromPacket(
TracePacket.fromJson(jsonEncode(frame2TrackEventPackets.first)),
);
expect(trackEvent.name, 'Animator::BeginFrame');
expect(trackEvent.args, {'frame_number': '2'});
expect(trackEvent.categories, ['Embedder']);
expect(trackEvent.trackId, Int64(22787));
expect(trackEvent.type, PerfettoEventType.sliceBegin);
expect(trackEvent.timelineEventType, null);
expect(trackEvent.flutterFrameNumber, 2);
expect(trackEvent.isUiFrameIdentifier, true);
expect(trackEvent.isRasterFrameIdentifier, false);
expect(trackEvent.isShaderEvent, false);
trackEvent = PerfettoTrackEvent.fromPacket(
TracePacket.fromJson(jsonEncode(frame2TrackEventPackets[1])),
);
expect(trackEvent.name, '');
expect(trackEvent.args, isEmpty);
expect(trackEvent.categories, ['Embedder']);
expect(trackEvent.trackId, Int64(22787));
expect(trackEvent.type, PerfettoEventType.sliceEnd);
expect(trackEvent.timelineEventType, null);
expect(trackEvent.flutterFrameNumber, null);
expect(trackEvent.isUiFrameIdentifier, false);
expect(trackEvent.isRasterFrameIdentifier, false);
expect(trackEvent.isShaderEvent, false);
});
test('Raster track events', () {
trackEvent = PerfettoTrackEvent.fromPacket(
TracePacket.fromJson(jsonEncode(frame2TrackEventPackets[2])),
);
expect(trackEvent.name, 'Rasterizer::DoDraw');
expect(trackEvent.args, {'frame_number': '2'});
expect(trackEvent.categories, ['Embedder']);
expect(trackEvent.trackId, Int64(31491));
expect(trackEvent.type, PerfettoEventType.sliceBegin);
expect(trackEvent.timelineEventType, null);
expect(trackEvent.flutterFrameNumber, 2);
expect(trackEvent.isUiFrameIdentifier, false);
expect(trackEvent.isRasterFrameIdentifier, true);
expect(trackEvent.isShaderEvent, false);
});
test('Shader compilation track event', () {
final trackEventWithShaders = {
'8': '713834379092000',
'10': 1,
'11': {
'4': [
{'6': 'shaders', '10': 'devtoolsTag'},
],
'9': 1,
'11': '31491',
'22': ['Embedder'],
'23': 'Rasterizer::DoDraw',
},
'58': 3,
};
trackEvent = PerfettoTrackEvent.fromPacket(
TracePacket.fromJson(jsonEncode(trackEventWithShaders)),
);
expect(trackEvent.name, 'Rasterizer::DoDraw');
expect(trackEvent.args, {'devtoolsTag': 'shaders'});
expect(trackEvent.categories, ['Embedder']);
expect(trackEvent.trackId, Int64(31491));
expect(trackEvent.type, PerfettoEventType.sliceBegin);
expect(trackEvent.timelineEventType, null);
expect(trackEvent.flutterFrameNumber, null);
expect(trackEvent.isUiFrameIdentifier, false);
expect(trackEvent.isRasterFrameIdentifier, false);
expect(trackEvent.isShaderEvent, true);
});
});
}
| devtools/packages/devtools_app/test/performance/timeline_events/perfetto/tracing_model_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/performance/timeline_events/perfetto/tracing_model_test.dart",
"repo_id": "devtools",
"token_count": 1921
} | 166 |
// Copyright 2023 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app/devtools_app.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
group('$RemoteDiagnosticsNode', () {
test('equality is order agnostic', () {
final json1 = <String, dynamic>{
'a': 1,
'b': <String, dynamic>{'x': 2, 'y': 3},
};
final json2 = <String, dynamic>{
'b': <String, dynamic>{'y': 3, 'x': 2},
'a': 1,
};
expect(
RemoteDiagnosticsNode.jsonHashCode(json1),
RemoteDiagnosticsNode.jsonHashCode(json2),
);
expect(
RemoteDiagnosticsNode.jsonEquality(json1, json2),
isTrue,
);
});
test('equality is deep', () {
final json1 = <String, dynamic>{
'a': 1,
'b': <String, dynamic>{'x': 3, 'y': 2},
};
final json2 = <String, dynamic>{
'b': <String, dynamic>{'y': 3, 'x': 2},
'a': 1,
};
expect(
RemoteDiagnosticsNode.jsonEquality(json1, json2),
isFalse,
);
});
});
}
| devtools/packages/devtools_app/test/shared/diagnostics/diagnostics_node_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/shared/diagnostics/diagnostics_node_test.dart",
"repo_id": "devtools",
"token_count": 548
} | 167 |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@TestOn('vm')
import 'package:devtools_app/devtools_app.dart';
import 'package:devtools_app/src/framework/initializer.dart';
import 'package:devtools_app/src/shared/framework_controller.dart';
import 'package:devtools_app_shared/ui.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:devtools_test/devtools_test.dart';
import 'package:devtools_test/helpers.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/mockito.dart';
void main() {
group('Initializer', () {
const Key initializedKey = Key('initialized');
setUp(() {
final serviceManager = FakeServiceConnectionManager();
when(serviceManager.serviceManager.connectedApp!.isDartWebApp)
.thenAnswer((_) => Future.value(false));
setGlobal(ServiceConnectionManager, serviceManager);
setGlobal(FrameworkController, FrameworkController());
setGlobal(OfflineModeController, OfflineModeController());
setGlobal(IdeTheme, IdeTheme());
});
Future<void> pumpInitializer(WidgetTester tester) async {
await tester.pumpWidget(
wrap(
Initializer(
url: null,
builder: (_) => const SizedBox(key: initializedKey),
),
),
);
await tester.pump();
}
testWidgets(
'shows disconnected overlay if not connected',
(WidgetTester tester) async {
setGlobal(
ServiceConnectionManager,
FakeServiceConnectionManager(
hasConnection: false,
),
);
await pumpInitializer(tester);
expect(find.text('Disconnected'), findsOneWidget);
},
);
testWidgets(
'shows disconnected overlay upon disconnect',
(WidgetTester tester) async {
final serviceConnection = FakeServiceConnectionManager();
setGlobal(ServiceConnectionManager, serviceConnection);
// Expect standard connected state.
serviceConnection.serviceManager.changeState(true);
await pumpInitializer(tester);
expect(find.byKey(initializedKey), findsOneWidget);
expect(find.text('Disconnected'), findsNothing);
// Trigger a disconnect.
serviceConnection.serviceManager.changeState(false);
await tester.pumpAndSettle(const Duration(microseconds: 1000));
// Expect Disconnected overlay.
expect(find.text('Disconnected'), findsOneWidget);
},
);
testWidgets(
'closes disconnected overlay upon reconnect',
(WidgetTester tester) async {
final serviceConnection = FakeServiceConnectionManager();
setGlobal(ServiceConnectionManager, serviceConnection);
// Expect standard connected state.
serviceConnection.serviceManager.changeState(true);
await pumpInitializer(tester);
expect(find.byKey(initializedKey), findsOneWidget);
expect(find.text('Disconnected'), findsNothing);
// Trigger a disconnect and ensure the overlay appears.
serviceConnection.serviceManager.changeState(false);
await tester.pumpAndSettle();
expect(find.text('Disconnected'), findsOneWidget);
// Trigger a reconnect
serviceConnection.serviceManager.changeState(true);
await tester.pumpAndSettle();
// Expect no overlay.
expect(find.text('Disconnected'), findsNothing);
},
);
});
}
| devtools/packages/devtools_app/test/shared/initializer_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/shared/initializer_test.dart",
"repo_id": "devtools",
"token_count": 1306
} | 168 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app/devtools_app.dart';
import 'package:devtools_app/src/framework/scaffold.dart';
import 'package:devtools_app/src/shared/framework_controller.dart';
import 'package:devtools_app/src/shared/survey.dart';
import 'package:devtools_app_shared/service.dart';
import 'package:devtools_app_shared/ui.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:devtools_test/devtools_test.dart';
import 'package:devtools_test/helpers.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/mockito.dart';
void main() {
late MockServiceConnectionManager mockServiceConnection;
late MockServiceManager mockServiceManager;
setUp(() {
mockServiceConnection = createMockServiceConnectionWithDefaults();
mockServiceManager =
mockServiceConnection.serviceManager as MockServiceManager;
when(mockServiceManager.service).thenReturn(null);
when(mockServiceManager.connectedState).thenReturn(
ValueNotifier<ConnectedState>(const ConnectedState(false)),
);
when(mockServiceManager.hasConnection).thenReturn(false);
when(mockServiceManager.isolateManager).thenReturn(FakeIsolateManager());
when(mockServiceConnection.appState).thenReturn(
AppState(
mockServiceManager.isolateManager.selectedIsolate,
),
);
final mockErrorBadgeManager = MockErrorBadgeManager();
when(mockServiceConnection.errorBadgeManager)
.thenReturn(mockErrorBadgeManager);
when(mockErrorBadgeManager.errorCountNotifier(any))
.thenReturn(ValueNotifier<int>(0));
setGlobal(ServiceConnectionManager, mockServiceConnection);
setGlobal(FrameworkController, FrameworkController());
setGlobal(SurveyService, SurveyService());
setGlobal(OfflineModeController, OfflineModeController());
setGlobal(IdeTheme, IdeTheme());
setGlobal(NotificationService, NotificationService());
setGlobal(BannerMessagesController, BannerMessagesController());
});
testWidgets(
'displays floating debugger controls',
(WidgetTester tester) async {
final connectedApp = MockConnectedApp();
mockConnectedApp(
connectedApp,
isFlutterApp: true,
isProfileBuild: false,
isWebApp: false,
);
when(mockServiceManager.connectedAppInitialized).thenReturn(true);
when(mockServiceManager.connectedApp).thenReturn(connectedApp);
when(mockServiceManager.isolateManager).thenReturn(FakeIsolateManager());
when(mockServiceConnection.appState).thenReturn(
AppState(
mockServiceManager.isolateManager.selectedIsolate,
),
);
final mockDebuggerController = MockDebuggerController();
final state = serviceConnection
.serviceManager.isolateManager.mainIsolateState! as MockIsolateState;
when(state.isPaused).thenReturn(ValueNotifier(true));
when(mockServiceManager.isMainIsolatePaused).thenReturn(false);
await tester.pumpWidget(
wrapWithControllers(
DevToolsScaffold(
page: _screen1.screenId,
screens: const [_screen1, _screen2],
),
debugger: mockDebuggerController,
analytics: AnalyticsController(
enabled: false,
firstRun: false,
consentMessage: 'fake message',
),
releaseNotes: ReleaseNotesController(),
),
);
expect(find.byKey(_k1), findsOneWidget);
expect(find.byKey(_k2), findsNothing);
expect(find.byType(FloatingDebuggerControls), findsOneWidget);
},
);
}
class _TestScreen extends Screen {
const _TestScreen(
this.name,
this.key, {
bool showFloatingDebuggerControls = true,
Key? tabKey,
}) : super(
name,
title: name,
icon: Icons.computer,
tabKey: tabKey,
showFloatingDebuggerControls: showFloatingDebuggerControls,
);
final String name;
final Key key;
@override
Widget buildScreenBody(BuildContext context) {
return SizedBox(key: key);
}
}
// Keys and tabs for use in the test.
const _k1 = Key('body key 1');
const _k2 = Key('body key 2');
const _t1 = Key('tab key 1');
const _t2 = Key('tab key 2');
const _screen1 = _TestScreen('screen1', _k1, tabKey: _t1);
const _screen2 = _TestScreen('screen2', _k2, tabKey: _t2);
| devtools/packages/devtools_app/test/shared/scaffold_debugging_controls_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/shared/scaffold_debugging_controls_test.dart",
"repo_id": "devtools",
"token_count": 1664
} | 169 |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app/src/shared/primitives/url_utils.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
group('url utils', () {
group('extractCurrentPageFromUrl', () {
test('parses the current page from the path', () {
final page =
extractCurrentPageFromUrl('http://localhost:9000/inspector?uri=x');
expect(page, 'inspector');
});
test('parses the current page from the query string', () {
final page = extractCurrentPageFromUrl(
'http://localhost:9000/?uri=x&page=inspector&theme=dark',
);
expect(page, 'inspector');
});
test(
'parses the current page from the path even if query string is populated',
() {
final page = extractCurrentPageFromUrl(
'http://localhost:9000/memory?uri=x&page=inspector&theme=dark',
);
expect(page, 'memory');
},
);
});
group('mapLegacyUrl', () {
for (final prefix in [
'http://localhost:123',
'http://localhost:123/authToken=/devtools',
]) {
group(' with $prefix prefix', () {
test('does not map new-style URLs', () {
expect(mapLegacyUrl(prefix), isNull);
expect(mapLegacyUrl('$prefix/'), isNull);
expect(mapLegacyUrl('$prefix/foo?uri=ws://foo'), isNull);
expect(mapLegacyUrl('$prefix?uri=ws://foo'), isNull);
expect(mapLegacyUrl('$prefix/?uri=ws://foo'), isNull);
expect(mapLegacyUrl('$prefix/?uri=ws://foo#'), isNull);
});
test('maps legacy URIs with page names in path', () {
expect(
mapLegacyUrl('$prefix/#/inspector?foo=bar'),
'$prefix/inspector?foo=bar',
);
});
test('maps legacy URIs with page names in querystring', () {
expect(
mapLegacyUrl('$prefix/#/?page=inspector&foo=bar'),
'$prefix/inspector?foo=bar',
);
});
test('maps legacy URIs with no page names', () {
expect(
mapLegacyUrl('$prefix/#/?foo=bar'),
'$prefix/?foo=bar',
);
});
});
}
});
});
}
| devtools/packages/devtools_app/test/shared/url_utils_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/shared/url_utils_test.dart",
"repo_id": "devtools",
"token_count": 1126
} | 170 |
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(const OverflowingApp());
class OverflowingApp extends StatefulWidget {
const OverflowingApp({
Key? key,
this.initialRoute,
this.isTestMode = false,
}) : super(key: key);
final bool isTestMode;
final String? initialRoute;
@override
State<OverflowingApp> createState() => _OverflowingAppState();
}
class _OverflowingAppState extends State<OverflowingApp> {
@override
Widget build(BuildContext context) => MaterialApp(
title: 'Overflowing App',
home: Column(
children: [
for (var i = 0; i < 5; i++)
const Row(
children: [
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed'
' do eiusmod tempor incididunt ut labore et dolore magna '
'aliqua. Ut enim ad minim veniam, quis nostrud '
'exercitation ullamco laboris nisi ut aliquip ex ea '
'commodo consequat.',
),
],
),
],
),
],
),
);
}
| devtools/packages/devtools_app/test/test_infra/fixtures/flutter_app/lib/overflow_errors.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/test_infra/fixtures/flutter_app/lib/overflow_errors.dart",
"repo_id": "devtools",
"token_count": 779
} | 171 |
name: memory_app
description: App for running DevTools integration and manual tests.
publish_to: 'none'
version: 1.0.0+1
environment:
sdk: '>=3.0.0'
flutter: '>=3.0.0'
dependencies:
flutter:
sdk: flutter
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter packages.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
| devtools/packages/devtools_app/test/test_infra/fixtures/memory_app/pubspec.yaml/0 | {
"file_path": "devtools/packages/devtools_app/test/test_infra/fixtures/memory_app/pubspec.yaml",
"repo_id": "devtools",
"token_count": 613
} | 172 |
>// Copyright 2022 The Chromium Authors. All rights reserved.
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.dart
>// Use of this source code is governed by a BSD-style license that can be
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.dart
>// found in the LICENSE file.
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.dart
>
>library foo;
#^^^^^^^ meta.declaration.dart keyword.other.import.dart
# ^^^^ meta.declaration.dart
# ^ meta.declaration.dart punctuation.terminator.dart
>
>import 'dart:async' deferred as deferredAsync show Future;
#^^^^^^ meta.declaration.dart keyword.other.import.dart
# ^ meta.declaration.dart
# ^^^^^^^^^^^^ meta.declaration.dart string.interpolated.single.dart
# ^^^^^^^^^^ meta.declaration.dart
# ^^ meta.declaration.dart keyword.other.import.dart
# ^^^^^^^^^^^^^^^ meta.declaration.dart
# ^^^^ meta.declaration.dart keyword.other.import.dart
# ^^^^^^^ meta.declaration.dart
# ^ meta.declaration.dart punctuation.terminator.dart
>import 'dart:io' as a show File hide Directory;
#^^^^^^ meta.declaration.dart keyword.other.import.dart
# ^ meta.declaration.dart
# ^^^^^^^^^ meta.declaration.dart string.interpolated.single.dart
# ^ meta.declaration.dart
# ^^ meta.declaration.dart keyword.other.import.dart
# ^^^ meta.declaration.dart
# ^^^^ meta.declaration.dart keyword.other.import.dart
# ^^^^^^ meta.declaration.dart
# ^^^^ meta.declaration.dart keyword.other.import.dart
# ^^^^^^^^^^ meta.declaration.dart
# ^ meta.declaration.dart punctuation.terminator.dart
>export 'dart:io';
#^^^^^^ meta.declaration.dart keyword.other.import.dart
# ^ meta.declaration.dart
# ^^^^^^^^^ meta.declaration.dart string.interpolated.single.dart
# ^ meta.declaration.dart punctuation.terminator.dart
>
>abstract class A {}
#^^^^^^^^ keyword.declaration.dart
# ^^^^^ keyword.declaration.dart
# ^ support.class.dart
>
>class B extends A {
#^^^^^ keyword.declaration.dart
# ^ support.class.dart
# ^^^^^^^ keyword.declaration.dart
# ^ support.class.dart
> B();
# ^ support.class.dart
# ^ punctuation.terminator.dart
> B.named();
# ^ support.class.dart
# ^ punctuation.dot.dart
# ^^^^^ entity.name.function.dart
# ^ punctuation.terminator.dart
> B.other() {}
# ^ support.class.dart
# ^ punctuation.dot.dart
# ^^^^^ entity.name.function.dart
>
> static late final _b = B();
# ^^^^^^ storage.modifier.dart
# ^^^^ storage.modifier.dart
# ^^^^^ storage.modifier.dart
# ^ keyword.operator.assignment.dart
# ^ support.class.dart
# ^ punctuation.terminator.dart
> factory B.single() {
# ^^^^^^^ keyword.declaration.dart
# ^ support.class.dart
# ^ punctuation.dot.dart
# ^^^^^^ entity.name.function.dart
> return _b;
# ^^^^^^ keyword.control.dart
# ^ punctuation.terminator.dart
> }
>
> String get foo => '';
# ^^^^^^ support.class.dart
# ^^^ keyword.declaration.dart
# ^^ keyword.operator.closure.dart
# ^^ string.interpolated.single.dart
# ^ punctuation.terminator.dart
> set foo(String value) {}
# ^^^ keyword.declaration.dart
# ^^^ entity.name.function.dart
# ^^^^^^ support.class.dart
>
> @override
# ^^^^^^^^^ storage.type.annotation.dart
> bool operator ==(Object other) {
# ^^^^ support.class.dart
# ^^^^^^^^ keyword.declaration.dart
# ^^ keyword.operator.comparison.dart
# ^^^^^^ support.class.dart
> return false;
# ^^^^^^ keyword.control.dart
# ^^^^^ constant.language.dart
# ^ punctuation.terminator.dart
> }
>}
>
>class C<T extends B> implements A {}
#^^^^^ keyword.declaration.dart
# ^ support.class.dart
# ^ other.source.dart
# ^ support.class.dart
# ^^^^^^^ keyword.declaration.dart
# ^ support.class.dart
# ^ other.source.dart
# ^^^^^^^^^^ keyword.declaration.dart
# ^ support.class.dart
>
>mixin D on A {}
#^^^^^ keyword.declaration.dart
# ^ support.class.dart
# ^^ keyword.control.catch-exception.dart
# ^ support.class.dart
>
>class E extends A with D {}
#^^^^^ keyword.declaration.dart
# ^ support.class.dart
# ^^^^^^^ keyword.declaration.dart
# ^ support.class.dart
# ^^^^ keyword.declaration.dart
# ^ support.class.dart
>
>extension on E {}
#^^^^^^^^^ keyword.declaration.dart
# ^^ keyword.control.catch-exception.dart
# ^ support.class.dart
>
>extension EExtension on E {}
#^^^^^^^^^ keyword.declaration.dart
# ^^^^^^^^^^ support.class.dart
# ^^ keyword.control.catch-exception.dart
# ^ support.class.dart
>
>external int get externalInt;
#^^^^^^^^ keyword.declaration.dart
# ^^^ support.class.dart
# ^^^ keyword.declaration.dart
# ^ punctuation.terminator.dart
>
>typedef StringAlias = String;
#^^^^^^^ keyword.declaration.dart
# ^^^^^^^^^^^ support.class.dart
# ^ keyword.operator.assignment.dart
# ^^^^^^ support.class.dart
# ^ punctuation.terminator.dart
>typedef void FunctionAlias1(String a, String b);
#^^^^^^^ keyword.declaration.dart
# ^^^^ storage.type.primitive.dart
# ^^^^^^^^^^^^^^ support.class.dart
# ^^^^^^ support.class.dart
# ^ punctuation.comma.dart
# ^^^^^^ support.class.dart
# ^ punctuation.terminator.dart
>typedef FunctionAlias2 = void Function(String a, String b);
#^^^^^^^ keyword.declaration.dart
# ^^^^^^^^^^^^^^ support.class.dart
# ^ keyword.operator.assignment.dart
# ^^^^ storage.type.primitive.dart
# ^^^^^^^^ support.class.dart
# ^^^^^^ support.class.dart
# ^ punctuation.comma.dart
# ^^^^^^ support.class.dart
# ^ punctuation.terminator.dart
>
>Future<void> e() async {
#^^^^^^ support.class.dart
# ^ other.source.dart
# ^^^^ storage.type.primitive.dart
# ^ other.source.dart
# ^ entity.name.function.dart
# ^^^^^ keyword.control.dart
> await Future.delayed(const Duration(seconds: 1));
# ^^^^^ keyword.control.dart
# ^^^^^^ support.class.dart
# ^ punctuation.dot.dart
# ^^^^^^^ entity.name.function.dart
# ^^^^^ storage.modifier.dart
# ^^^^^^^^ support.class.dart
# ^ keyword.operator.ternary.dart
# ^ constant.numeric.dart
# ^ punctuation.terminator.dart
>}
>
>void returns() {
#^^^^ storage.type.primitive.dart
# ^^^^^^^ entity.name.function.dart
> return;
# ^^^^^^ keyword.control.dart
# ^ punctuation.terminator.dart
>}
>
>Iterable<String> syncYield() sync* {
#^^^^^^^^ support.class.dart
# ^ other.source.dart
# ^^^^^^ support.class.dart
# ^ other.source.dart
# ^^^^^^^^^ entity.name.function.dart
# ^^^^ keyword.control.dart
# ^ keyword.operator.arithmetic.dart
> yield '';
# ^^^^^ keyword.control.dart
# ^^ string.interpolated.single.dart
# ^ punctuation.terminator.dart
>}
>
>Iterable<String> syncYieldStar() sync* {
#^^^^^^^^ support.class.dart
# ^ other.source.dart
# ^^^^^^ support.class.dart
# ^ other.source.dart
# ^^^^^^^^^^^^^ entity.name.function.dart
# ^^^^ keyword.control.dart
# ^ keyword.operator.arithmetic.dart
> yield* syncYield();
# ^^^^^ keyword.control.dart
# ^ keyword.operator.arithmetic.dart
# ^^^^^^^^^ entity.name.function.dart
# ^ punctuation.terminator.dart
>}
>
>Stream<String> asyncYield() async* {
#^^^^^^ support.class.dart
# ^ other.source.dart
# ^^^^^^ support.class.dart
# ^ other.source.dart
# ^^^^^^^^^^ entity.name.function.dart
# ^^^^^ keyword.control.dart
# ^ keyword.operator.arithmetic.dart
> await Future.delayed(const Duration(seconds: 1));
# ^^^^^ keyword.control.dart
# ^^^^^^ support.class.dart
# ^ punctuation.dot.dart
# ^^^^^^^ entity.name.function.dart
# ^^^^^ storage.modifier.dart
# ^^^^^^^^ support.class.dart
# ^ keyword.operator.ternary.dart
# ^ constant.numeric.dart
# ^ punctuation.terminator.dart
> yield '';
# ^^^^^ keyword.control.dart
# ^^ string.interpolated.single.dart
# ^ punctuation.terminator.dart
>}
>
>Stream<String> asyncYieldStar() async* {
#^^^^^^ support.class.dart
# ^ other.source.dart
# ^^^^^^ support.class.dart
# ^ other.source.dart
# ^^^^^^^^^^^^^^ entity.name.function.dart
# ^^^^^ keyword.control.dart
# ^ keyword.operator.arithmetic.dart
> await Future.delayed(const Duration(seconds: 1));
# ^^^^^ keyword.control.dart
# ^^^^^^ support.class.dart
# ^ punctuation.dot.dart
# ^^^^^^^ entity.name.function.dart
# ^^^^^ storage.modifier.dart
# ^^^^^^^^ support.class.dart
# ^ keyword.operator.ternary.dart
# ^ constant.numeric.dart
# ^ punctuation.terminator.dart
> yield* asyncYield();
# ^^^^^ keyword.control.dart
# ^ keyword.operator.arithmetic.dart
# ^^^^^^^^^^ entity.name.function.dart
# ^ punctuation.terminator.dart
>}
>
>void err() {
#^^^^ storage.type.primitive.dart
# ^^^ entity.name.function.dart
> try {
# ^^^ keyword.control.catch-exception.dart
> throw '';
# ^^^^^ keyword.control.catch-exception.dart
# ^^ string.interpolated.single.dart
# ^ punctuation.terminator.dart
> } on ArgumentError {
# ^^ keyword.control.catch-exception.dart
# ^^^^^^^^^^^^^ support.class.dart
> rethrow;
# ^^^^^^^ keyword.control.catch-exception.dart
# ^ punctuation.terminator.dart
> } catch (e) {
# ^^^^^ keyword.control.catch-exception.dart
> print('e');
# ^^^^^ entity.name.function.dart
# ^^^ string.interpolated.single.dart
# ^ punctuation.terminator.dart
> }
>}
>
>void loops() {
#^^^^ storage.type.primitive.dart
# ^^^^^ entity.name.function.dart
> while (1 > 2) {
# ^^^^^ keyword.control.dart
# ^ constant.numeric.dart
# ^ keyword.operator.comparison.dart
# ^ constant.numeric.dart
> if (3 > 4) {
# ^^ keyword.control.dart
# ^ constant.numeric.dart
# ^ keyword.operator.comparison.dart
# ^ constant.numeric.dart
> continue;
# ^^^^^^^^ keyword.control.dart
# ^ punctuation.terminator.dart
> } else {
# ^^^^ keyword.control.dart
> break;
# ^^^^^ keyword.control.dart
# ^ punctuation.terminator.dart
> }
> return;
# ^^^^^^ keyword.control.dart
# ^ punctuation.terminator.dart
> }
>
> do {
# ^^ keyword.control.dart
> print('');
# ^^^^^ entity.name.function.dart
# ^^ string.interpolated.single.dart
# ^ punctuation.terminator.dart
> } while (1 > 2);
# ^^^^^ keyword.control.dart
# ^ constant.numeric.dart
# ^ keyword.operator.comparison.dart
# ^ constant.numeric.dart
# ^ punctuation.terminator.dart
>}
>
>void switches() {
#^^^^ storage.type.primitive.dart
# ^^^^^^^^ entity.name.function.dart
> Object? i = 1;
# ^^^^^^ support.class.dart
# ^ keyword.operator.ternary.dart
# ^ keyword.operator.assignment.dart
# ^ constant.numeric.dart
# ^ punctuation.terminator.dart
> switch (i as int) {
# ^^^^^^ keyword.control.dart
# ^^ keyword.cast.dart
# ^^^ support.class.dart
> case 1:
# ^^^^ keyword.control.dart
# ^ constant.numeric.dart
# ^ keyword.operator.ternary.dart
> break;
# ^^^^^ keyword.control.dart
# ^ punctuation.terminator.dart
> default:
# ^^^^^^^ keyword.control.dart
# ^ keyword.operator.ternary.dart
> return;
# ^^^^^^ keyword.control.dart
# ^ punctuation.terminator.dart
> }
>}
>
>void conditions() {
#^^^^ storage.type.primitive.dart
# ^^^^^^^^^^ entity.name.function.dart
> if (1 > 2) {
# ^^ keyword.control.dart
# ^ constant.numeric.dart
# ^ keyword.operator.comparison.dart
# ^ constant.numeric.dart
> } else if (3 > 4) {
# ^^^^ keyword.control.dart
# ^^ keyword.control.dart
# ^ constant.numeric.dart
# ^ keyword.operator.comparison.dart
# ^ constant.numeric.dart
> } else {}
# ^^^^ keyword.control.dart
>}
>
>void misc(int a, {required int b}) {
#^^^^ storage.type.primitive.dart
# ^^^^ entity.name.function.dart
# ^^^ support.class.dart
# ^ punctuation.comma.dart
# ^^^^^^^^ storage.modifier.dart
# ^^^ support.class.dart
> assert(true);
# ^^^^^^ keyword.control.dart
# ^^^^ constant.language.dart
# ^ punctuation.terminator.dart
> assert(1 == 1, 'fail');
# ^^^^^^ keyword.control.dart
# ^ constant.numeric.dart
# ^^ keyword.operator.comparison.dart
# ^ constant.numeric.dart
# ^ punctuation.comma.dart
# ^^^^^^ string.interpolated.single.dart
# ^ punctuation.terminator.dart
>
> var a = new String.fromCharCode(1);
# ^^^ storage.type.primitive.dart
# ^ keyword.operator.assignment.dart
# ^^^ keyword.control.new.dart
# ^^^^^^ support.class.dart
# ^ punctuation.dot.dart
# ^^^^^^^^^^^^ entity.name.function.dart
# ^ constant.numeric.dart
# ^ punctuation.terminator.dart
> const b = int.fromEnvironment('');
# ^^^^^ storage.modifier.dart
# ^ keyword.operator.assignment.dart
# ^^^ support.class.dart
# ^ punctuation.dot.dart
# ^^^^^^^^^^^^^^^ entity.name.function.dart
# ^^ string.interpolated.single.dart
# ^ punctuation.terminator.dart
> final c = '';
# ^^^^^ storage.modifier.dart
# ^ keyword.operator.assignment.dart
# ^^ string.interpolated.single.dart
# ^ punctuation.terminator.dart
> late final d = '';
# ^^^^ storage.modifier.dart
# ^^^^^ storage.modifier.dart
# ^ keyword.operator.assignment.dart
# ^^ string.interpolated.single.dart
# ^ punctuation.terminator.dart
> print(d is String);
# ^^^^^ entity.name.function.dart
# ^^ keyword.operator.dart
# ^^^^^^ support.class.dart
# ^ punctuation.terminator.dart
> print(d is! String);
# ^^^^^ entity.name.function.dart
# ^^ keyword.operator.dart
# ^ keyword.operator.logical.dart
# ^^^^^^ support.class.dart
# ^ punctuation.terminator.dart
>}
>
>class Covariance<T> {
#^^^^^ keyword.declaration.dart
# ^^^^^^^^^^ support.class.dart
# ^ other.source.dart
# ^ support.class.dart
# ^ other.source.dart
> void covariance(covariant List<T> items) {}
# ^^^^ storage.type.primitive.dart
# ^^^^^^^^^^ entity.name.function.dart
# ^^^^^^^^^ keyword.declaration.dart
# ^^^^ support.class.dart
# ^ other.source.dart
# ^ support.class.dart
# ^ other.source.dart
>}
| devtools/packages/devtools_app/test/test_infra/goldens/syntax_highlighting/keywords.dart.golden/0 | {
"file_path": "devtools/packages/devtools_app/test/test_infra/goldens/syntax_highlighting/keywords.dart.golden",
"repo_id": "devtools",
"token_count": 9152
} | 173 |
// Copyright 2023 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file.
import 'dart:async';
import 'package:devtools_app/devtools_app.dart';
import 'package:devtools_app_shared/ui.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:devtools_test/devtools_test.dart';
import 'package:devtools_test/helpers.dart';
import 'package:flutter/material.dart';
import 'package:mockito/mockito.dart';
import 'package:stager/stager.dart';
import 'package:vm_service/vm_service.dart';
import '../../test_data/cpu_profiler/cpu_profile.dart';
/// To run:
/// flutter run -t test/test_infra/scenes/cpu_profiler/default.stager_app.g.dart -d macos
class CpuProfilerDefaultScene extends Scene {
late ProfilerScreenController controller;
late FakeServiceConnectionManager fakeServiceConnection;
late ProfilerScreen screen;
@override
Widget build(BuildContext context) {
return wrapWithControllers(
const ProfilerScreenBody(),
profiler: controller,
);
}
@override
Future<void> setUp() async {
setGlobal(
DevToolsEnvironmentParameters,
ExternalDevToolsEnvironmentParameters(),
);
setGlobal(OfflineModeController, OfflineModeController());
setGlobal(IdeTheme, IdeTheme());
setGlobal(NotificationService, NotificationService());
setGlobal(PreferencesController, PreferencesController());
setGlobal(BannerMessagesController, BannerMessagesController());
fakeServiceConnection = FakeServiceConnectionManager(
service: FakeServiceManager.createFakeService(
cpuSamples: CpuSamples.parse(goldenCpuSamplesJson),
),
);
final app = fakeServiceConnection.serviceManager.connectedApp!;
mockConnectedApp(
app,
isFlutterApp: false,
isProfileBuild: false,
isWebApp: false,
);
when(fakeServiceConnection.errorBadgeManager.errorCountNotifier('profiler'))
.thenReturn(ValueNotifier<int>(0));
setGlobal(ServiceConnectionManager, fakeServiceConnection);
final mockScriptManager = MockScriptManager();
when(mockScriptManager.scriptRefForUri(any)).thenReturn(
ScriptRef(
uri: 'package:test/script.dart',
id: 'script.dart',
),
);
when(mockScriptManager.sortedScripts).thenReturn(
ValueNotifier<List<ScriptRef>>([]),
);
setGlobal(ScriptManager, mockScriptManager);
controller = ProfilerScreenController();
// Await a small delay to allow the ProfilerScreenController to complete
// initialization.
await Future.delayed(const Duration(seconds: 1));
screen = ProfilerScreen();
}
@override
String get title => '$CpuProfilerDefaultScene';
}
| devtools/packages/devtools_app/test/test_infra/scenes/cpu_profiler/default.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/test_infra/scenes/cpu_profiler/default.dart",
"repo_id": "devtools",
"token_count": 926
} | 174 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file.
const smallInstructionSizes = '''
[
{
"l": "dart:_internal",
"c": "_CastListBase",
"n": "[Optimized] getRange",
"s": 112
},
{
"l": "dart:_internal",
"c": "CastIterable",
"n": "[Optimized] new CastIterable.",
"s": 216
},
{
"l": "dart:_internal",
"c": "CastIterable",
"n": "[Stub] Allocate CastIterable",
"s": 12
},
{
"l": "dart:core",
"c": "List",
"n": "[Optimized] castFrom",
"s": 120
}
]
''';
| devtools/packages/devtools_app/test/test_infra/test_data/app_size/small_sizes.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/test_infra/test_data/app_size/small_sizes.dart",
"repo_id": "devtools",
"token_count": 328
} | 175 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@TestOn('vm')
import 'package:devtools_app/src/shared/primitives/extent_delegate_list.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.dart';
class TestRenderSliverBoxChildManager extends RenderSliverBoxChildManager {
TestRenderSliverBoxChildManager({
required this.children,
required this.extentDelegate,
});
late RenderSliverExtentDelegateBoxAdaptor _renderObject;
bool _renderObjectInitialized = false;
List<RenderBox> children;
RenderSliverExtentDelegateBoxAdaptor createRenderSliverExtentDelegate() {
assert(!_renderObjectInitialized);
_renderObject = RenderSliverExtentDelegateBoxAdaptor(
childManager: this,
extentDelegate: extentDelegate,
);
_renderObjectInitialized = true;
return _renderObject;
}
final ExtentDelegate extentDelegate;
int? _currentlyUpdatingChildIndex;
@override
void createChild(int index, {required RenderBox? after}) {
if (index < 0 || index >= children.length) return;
try {
_currentlyUpdatingChildIndex = index;
_renderObject.insert(children[index], after: after);
} finally {
_currentlyUpdatingChildIndex = null;
}
}
@override
void removeChild(RenderBox child) {
_renderObject.remove(child);
}
@override
double estimateMaxScrollOffset(
SliverConstraints constraints, {
int? firstIndex,
int? lastIndex,
double? leadingScrollOffset,
double? trailingScrollOffset,
}) {
assert(lastIndex! >= firstIndex!);
return children.length *
(trailingScrollOffset! - leadingScrollOffset!) /
(lastIndex! - firstIndex! + 1);
}
@override
int get childCount => children.length;
@override
void didAdoptChild(RenderBox child) {
assert(_currentlyUpdatingChildIndex != null);
final SliverMultiBoxAdaptorParentData childParentData =
child.parentData as SliverMultiBoxAdaptorParentData;
childParentData.index = _currentlyUpdatingChildIndex;
}
@override
void setDidUnderflow(bool value) {}
}
| devtools/packages/devtools_app/test/test_infra/utils/extent_delegate_utils.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/test_infra/utils/extent_delegate_utils.dart",
"repo_id": "devtools",
"token_count": 725
} | 176 |
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app/devtools_app.dart';
import 'package:devtools_app/src/screens/vm_developer/object_inspector/vm_script_display.dart';
import 'package:devtools_app/src/screens/vm_developer/vm_developer_common_widgets.dart';
import 'package:devtools_app_shared/ui.dart';
import 'package:devtools_app_shared/utils.dart';
import 'package:devtools_test/devtools_test.dart';
import 'package:devtools_test/helpers.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/mockito.dart';
import 'package:vm_service/vm_service.dart';
import '../vm_developer_test_utils.dart';
void main() {
late MockScriptObject mockScriptObject;
const windowSize = Size(4000.0, 4000.0);
late Script testScriptCopy;
setUp(() {
setGlobal(IdeTheme, IdeTheme());
setGlobal(BreakpointManager, BreakpointManager());
setGlobal(ServiceConnectionManager, FakeServiceConnectionManager());
setGlobal(
DevToolsEnvironmentParameters,
ExternalDevToolsEnvironmentParameters(),
);
setGlobal(PreferencesController, PreferencesController());
setGlobal(NotificationService, NotificationService());
setUpMockScriptManager();
mockScriptObject = MockScriptObject();
final json = testScript.toJson();
testScriptCopy = Script.parse(json)!;
testScriptCopy.size = 1024;
mockVmObject(mockScriptObject);
when(mockScriptObject.obj).thenReturn(testScriptCopy);
when(mockScriptObject.scriptRef).thenReturn(testScriptCopy);
});
testWidgetsWithWindowSize(
'builds script display',
windowSize,
(WidgetTester tester) async {
final controller = ObjectInspectorViewController();
await tester.pumpWidget(
wrap(
VmScriptDisplay(
controller: controller,
script: mockScriptObject,
),
),
);
expect(find.byType(VmObjectDisplayBasicLayout), findsOneWidget);
expect(find.byType(VMInfoCard), findsOneWidget);
expect(find.text('General Information'), findsOneWidget);
expect(find.text('1.0 KB'), findsOneWidget);
expect(find.text('Library:'), findsOneWidget);
expect(find.text('fooLib', findRichText: true), findsOneWidget);
expect(find.text('URI:'), findsOneWidget);
expect(find.text('fooScript.dart', findRichText: true), findsOneWidget);
expect(find.text('Load time:'), findsOneWidget);
expect(find.text('2022-08-10 06:30:00.000'), findsOneWidget);
expect(find.byType(RequestableSizeWidget), findsNWidgets(2));
expect(find.byType(RetainingPathWidget), findsOneWidget);
expect(find.byType(InboundReferencesTree), findsOneWidget);
},
);
}
| devtools/packages/devtools_app/test/vm_developer/object_inspector/vm_script_display_test.dart/0 | {
"file_path": "devtools/packages/devtools_app/test/vm_developer/object_inspector/vm_script_display_test.dart",
"repo_id": "devtools",
"token_count": 1013
} | 177 |
// Copyright 2023 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:devtools_app_shared/ui.dart' as devtools_shared_ui;
import 'package:flutter/material.dart';
class ExampleWidget extends StatelessWidget {
const ExampleWidget({super.key});
@override
Widget build(BuildContext context) {
return devtools_shared_ui.RoundedOutlinedBorder(
child: Column(
children: [
const devtools_shared_ui.AreaPaneHeader(
roundedTopBorder: false,
includeTopBorder: false,
title: Text('This is a section header'),
),
Expanded(
child: Text(
'Foo',
style: Theme.of(context).subtleTextStyle, // Shared style
),
),
],
),
);
}
}
| devtools/packages/devtools_app_shared/example/ui/common_example.dart/0 | {
"file_path": "devtools/packages/devtools_app_shared/example/ui/common_example.dart",
"repo_id": "devtools",
"token_count": 375
} | 178 |
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:vm_service/vm_service.dart';
extension VmServiceExtension on VmService {
/// Retrieves the full string value of a [stringRef].
///
/// The string value stored with the [stringRef] is returned unless the value
/// is truncated, in which an extra getObject call is issued to return the
/// value. If the [stringRef] has expired so the full string is unavailable,
/// [onUnavailable] is called to return how the truncated value should be
/// displayed. If [onUnavailable] is not specified, an exception is thrown
/// if the full value cannot be retrieved.
Future<String?> retrieveFullStringValue(
String isolateId,
InstanceRef stringRef, {
String Function(String? truncatedValue)? onUnavailable,
}) async {
if (stringRef.valueAsStringIsTruncated != true) {
return stringRef.valueAsString;
}
final result = await getObject(
isolateId,
stringRef.id!,
offset: 0,
count: stringRef.length,
);
if (result is Instance) {
return result.valueAsString;
} else if (onUnavailable != null) {
return onUnavailable(stringRef.valueAsString);
} else {
throw Exception(
'The full string for "{stringRef.valueAsString}..." is unavailable',
);
}
}
/// Executes `callback` for each isolate, and waiting for all callbacks to
/// finish before completing.
Future<void> forEachIsolate(
Future<void> Function(IsolateRef) callback,
) async {
await forEachIsolateHelper(this, callback);
}
}
Future<void> forEachIsolateHelper(
VmService vmService,
Future<void> Function(IsolateRef) callback,
) async {
final vm = await vmService.getVM();
final futures = <Future<void>>[];
for (final isolate in vm.isolates ?? []) {
futures.add(callback(isolate));
}
await Future.wait(futures);
}
| devtools/packages/devtools_app_shared/lib/src/service/service_utils.dart/0 | {
"file_path": "devtools/packages/devtools_app_shared/lib/src/service/service_utils.dart",
"repo_id": "devtools",
"token_count": 646
} | 179 |
// Copyright 2023 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:math';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
// Method to convert degrees to radians
double degToRad(num deg) => deg * (pi / 180.0);
/// A small double value, used to ensure that comparisons between double are
/// valid.
const defaultEpsilon = 1 / 1000;
bool equalsWithinEpsilon(double a, double b) {
return (a - b).abs() < defaultEpsilon;
}
const tooltipWait = Duration(milliseconds: 500);
const tooltipWaitLong = Duration(milliseconds: 1000);
/// Pluralizes a word, following english rules (1, many).
///
/// Pass a custom named `plural` for irregular plurals:
/// `pluralize('index', count, plural: 'indices')`
/// So it returns `indices` and not `indexs`.
String pluralize(String word, int count, {String? plural}) =>
count == 1 ? word : (plural ?? '${word}s');
bool isPrivateMember(String member) => member.startsWith('_');
/// Public properties first, then sort alphabetically
int sortFieldsByName(String a, String b) {
final isAPrivate = isPrivateMember(a);
final isBPrivate = isPrivateMember(b);
if (isAPrivate && !isBPrivate) {
return 1;
}
if (!isAPrivate && isBPrivate) {
return -1;
}
return a.compareTo(b);
}
/// A value notifier that calls each listener immediately when registered.
final class ImmediateValueNotifier<T> extends ValueNotifier<T> {
ImmediateValueNotifier(T value) : super(value);
/// Adds a listener and calls the listener upon registration.
@override
void addListener(VoidCallback listener) {
super.addListener(listener);
listener();
}
}
Future<T> whenValueNonNull<T>(
ValueListenable<T> listenable, {
Duration? timeout,
}) {
if (listenable.value != null) return Future.value(listenable.value);
final completer = Completer<T>();
void listener() {
final value = listenable.value;
if (value != null) {
completer.complete(value);
listenable.removeListener(listener);
}
}
listenable.addListener(listener);
if (timeout != null) {
return completer.future.timeout(timeout);
}
return completer.future;
}
/// Parses a 3 or 6 digit CSS Hex Color into a dart:ui Color.
Color parseCssHexColor(String input) {
// Remove any leading # (and the escaped version to be lenient)
input = input.replaceAll('#', '').replaceAll('%23', '');
// Handle 3/4-digit hex codes (eg. #123 == #112233)
if (input.length == 3 || input.length == 4) {
input = input.split('').map((c) => '$c$c').join();
}
// Pad alpha with FF.
if (input.length == 6) {
input = '${input}ff';
}
// In CSS, alpha is in the lowest bits, but for Flutter's value, it's in the
// highest bits, so move the alpha from the end to the start before parsing.
if (input.length == 8) {
input = '${input.substring(6)}${input.substring(0, 6)}';
}
final value = int.parse(input, radix: 16);
return Color(value);
}
/// Converts a dart:ui Color into #RRGGBBAA format for use in CSS.
String toCssHexColor(Color color) {
// In CSS Hex, Alpha comes last, but in Flutter's `value` field, alpha is
// in the high bytes, so just using `value.toRadixString(16)` will put alpha
// in the wrong position.
String hex(int val) => val.toRadixString(16).padLeft(2, '0');
return '#${hex(color.red)}${hex(color.green)}${hex(color.blue)}${hex(color.alpha)}';
}
| devtools/packages/devtools_app_shared/lib/src/utils/utils.dart/0 | {
"file_path": "devtools/packages/devtools_app_shared/lib/src/utils/utils.dart",
"repo_id": "devtools",
"token_count": 1165
} | 180 |
## 0.0.15-wip
* Bump `devtools_app_shared` to ^0.1.0
## 0.0.14
* Add a global `dtdManager` for interacting with the Dart Tooling Daemon.
* Add support for connecting to the Dart Tooling Daemon from the
simulated DevTools environment.
* Add help buttons to the VM Service and DTD connection text fields in the
simulated DevTools environment.
* Bump `package:vm_service` dependency to ^14.0.0.
* Refactor `example` directory to support more package examples.
* Add an example of providing an extension from a pure Dart package.
* Update the `example/README.md`.
* Add a `devtools_extensions validate` for validating extension requirements.
* Update the `README.md` to make it clear that you can build a DevTools
extension as a standalone tool.
## 0.0.13
* Bump `package:web` to `^0.4.1`.
* Fix `README.md` instructions for adding a `.pubignore` file.
* Make Simulated DevTools Environment Panel collapsible.
## 0.0.12
* Fix a bug preventing Dart server apps from connecting to DevTools extensions.
## 0.0.11
* Add error messaging when `extensionManager` or `serviceManager` are accessed before they
are initialized.
* Improve dartdoc for `DevToolsExtension`, `extensionManager`, and `serviceManager`.
* Migrate from `dart:html` to `package:web`.
* Add `utils.dart` library with helper for message event parsing.
## 0.0.10
* Bump minimum Dart SDK version to `3.3.0-91.0.dev` and minimum Flutter SDK version to `3.17.0-0.0.pre`.
* Add a test target to the `app_that_uses_foo` example that can also be debugged
with the DevTools extension provided by `package:foo`.
* Add an example of performing expression evaluations from a DevTools extension.
* Add an example of registering a service extension and calling it from a DevTools extension.
* Document the DevTools extension examples.
* Add documentation to [ExtensionManager] public APIs.
* Fix some bugs with the `build_and_copy` command for Windows.
* Add an example `launch.json` file in the `example/foo` directory.
* Clean up the package readme to make instructions Windows-compatible.
* Update the README with instructions for joining the Flutter Discord server.
* Bump `package:devtools_shared` dependency to ^6.0.1
* Bump `package:devtools_app_shared` dependency to ^0.0.7
* Bump `package:vm_service` dependency to ^13.0.0.
## 0.0.9
* Add a link to the new #devtools-extension-authors Discord channel in the README.md.
* Fix typos that incorrectly used snake case instead of camel case for `config.yaml` examples.
* Add a VS Code launch config for the `app_that_uses_foo` example app.
## 0.0.8
* Fix the `build_and_copy` command so that it succeeds when there is not
an existing `extension/devtools/build` directory.
## 0.0.7
* Update the `build_and_copy` command to stop copying unnecessary files.
* Add `ExtensionManager.unregisterEventHandler` method.
* Update README.md to include `.pubignore` recommendation.
* Add integration testing.
## 0.0.6
* Bump `package:devtools_app_shared` dependency to version ^0.0.4.
## 0.0.5
* Ensure theme and vm service connection are preserved on refresh of the extension
iFrame or the simulated DevTools environment.
* Add a `forceReload` endpoint to the extensions API.
* Add a `toString()` representation for `DevToolsExtensionEvent`.
* Add `ignoreIfAlreadyDismissed` parameter to `ExtensionManager.showBannerMessage` api.
* Update README.md to include package publishing instructions.
## 0.0.4
* Bump `package:vm_service` dependency to ^11.10.0.
* Fix a leaking event listener in the simulated DevTools environment.
## 0.0.3
* Connect the template extension manager to the VM service URI that is passed as a
query parameter to the embedded extension iFrame.
* Add built-in theme support for DevTools extensions (light theme and dark theme).
* Add event direction to the `DevToolsExtensionEventType` api.
* Add an end to end example of a DevTools extension in the `example/` directory.
* Add exception handling to `devtools_extensions build_and_copy` command.
* Add `showNotification` and `showBannerMessage` endpoints to the extensions API.
* Add hot reload and hot restart actions to the simulated DevTools environment.
* Update `build_and_copy` command, as well as documentation, to reference `config.yaml`
instead of `config.json`, as required by `package:extension_discovery` v2.0.0.
## 0.0.2
* Add a simulated DevTools environment that for easier development.
* Add a `build_and_copy` command to build a devtools extension and copy the output to the
parent package's extension/devtools directory.
## 0.0.2-dev.0
* Add missing dependency on `package:devtools_shared`.
## 0.0.1-dev.0
* Initial commit. This package is under construction.
| devtools/packages/devtools_extensions/CHANGELOG.md/0 | {
"file_path": "devtools/packages/devtools_extensions/CHANGELOG.md",
"repo_id": "devtools",
"token_count": 1325
} | 181 |
extensions:
- foo: true | devtools/packages/devtools_extensions/example/app_that_uses_foo/devtools_options.yaml/0 | {
"file_path": "devtools/packages/devtools_extensions/example/app_that_uses_foo/devtools_options.yaml",
"repo_id": "devtools",
"token_count": 9
} | 182 |
26e289bb660abaf2f8e21f419044bdfb | devtools/packages/devtools_extensions/example/packages_with_extensions/dart_foo/packages/dart_foo/extension/devtools/build/.last_build_id/0 | {
"file_path": "devtools/packages/devtools_extensions/example/packages_with_extensions/dart_foo/packages/dart_foo/extension/devtools/build/.last_build_id",
"repo_id": "devtools",
"token_count": 19
} | 183 |
{"app_name":"foo_devtools_extension","version":"1.0.0","package_name":"foo_devtools_extension"} | devtools/packages/devtools_extensions/example/packages_with_extensions/foo/packages/foo/extension/devtools/build/version.json/0 | {
"file_path": "devtools/packages/devtools_extensions/example/packages_with_extensions/foo/packages/foo/extension/devtools/build/version.json",
"repo_id": "devtools",
"token_count": 33
} | 184 |
// Copyright 2023 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of '_simulated_devtools_environment.dart';
@visibleForTesting
class SimulatedDevToolsController extends DisposableController
with AutoDisposeControllerMixin
implements DevToolsExtensionHostInterface {
/// Logs of the post message communication that goes back and forth between
/// the extension and the simulated DevTools environment.
final messageLogs = ListValueNotifier<MessageLogEntry>([]);
/// The listener that is added to simulated DevTools window to receive
/// messages from the extension.
///
/// We need to store this in a variable so that the listener is properly
/// removed in [dispose].
EventListener? _handleMessageListener;
void init() {
window.addEventListener(
'message',
_handleMessageListener = _handleMessage.toJS,
);
addAutoDisposeListener(serviceManager.connectedState, () {
if (!serviceManager.connectedState.value.connected) {
updateVmServiceConnection(uri: null);
messageLogs.clear();
}
});
}
void _handleMessage(Event e) {
final extensionEvent = tryParseExtensionEvent(e);
if (extensionEvent != null) {
// Do not handle messages that come from the
// [_SimulatedDevToolsController] itself.
if (extensionEvent.source == '$SimulatedDevToolsController') return;
onEventReceived(extensionEvent);
}
}
@override
void dispose() {
window.removeEventListener('message', _handleMessageListener);
_handleMessageListener = null;
super.dispose();
}
@override
void ping() {
_postMessageToExtension(
DevToolsExtensionEvent(DevToolsExtensionEventType.ping),
);
}
@override
void updateVmServiceConnection({required String? uri}) {
// TODO(https://github.com/flutter/devtools/issues/6416): write uri to the
// window location query parameters so that the vm service connection
// persists on hot restart.
// TODO(kenz): add some validation and error handling if [uri] is bad input.
final event = DevToolsExtensionEvent(
DevToolsExtensionEventType.vmServiceConnection,
data: {ExtensionEventParameters.vmServiceConnectionUri: uri},
);
_postMessageToExtension(event);
}
@override
void updateTheme({required String theme}) {
assert(
theme == ExtensionEventParameters.themeValueLight ||
theme == ExtensionEventParameters.themeValueDark,
);
_postMessageToExtension(
DevToolsExtensionEvent(
DevToolsExtensionEventType.themeUpdate,
data: {ExtensionEventParameters.theme: theme},
),
);
}
@override
void onEventReceived(
DevToolsExtensionEvent event, {
void Function()? onUnknownEvent,
}) {
messageLogs.add(
MessageLogEntry(
source: MessageSource.extension,
data: event.toJson(),
),
);
}
void _postMessageToExtension(DevToolsExtensionEvent event) {
final eventJson = event.toJson();
window.postMessage(
{
...eventJson,
DevToolsExtensionEvent.sourceKey: '$SimulatedDevToolsController',
}.jsify(),
window.origin.toJS,
);
messageLogs.add(
MessageLogEntry(
source: MessageSource.devtools,
data: eventJson,
),
);
}
Future<void> hotReloadConnectedApp() async {
await serviceManager.performHotReload();
logInfoEvent('Hot reload performed on connected app');
}
Future<void> hotRestartConnectedApp() async {
await serviceManager.performHotRestart();
logInfoEvent('Hot restart performed on connected app');
}
void toggleTheme() {
final darkThemeEnabled = extensionManager.darkThemeEnabled.value;
updateTheme(
theme: darkThemeEnabled
? ExtensionEventParameters.themeValueLight
: ExtensionEventParameters.themeValueDark,
);
}
void logInfoEvent(String message) {
messageLogs.add(
MessageLogEntry(source: MessageSource.info, message: message),
);
}
@override
void forceReload() {
_postMessageToExtension(
DevToolsExtensionEvent(DevToolsExtensionEventType.forceReload),
);
}
}
@visibleForTesting
class MessageLogEntry {
MessageLogEntry({required this.source, this.data, this.message})
: timestamp = DateTime.now();
final MessageSource source;
final Map<String, Object?>? data;
final String? message;
final DateTime timestamp;
}
@visibleForTesting
enum MessageSource {
devtools,
extension,
info;
String get display {
return name.toUpperCase();
}
}
| devtools/packages/devtools_extensions/lib/src/template/_simulated_devtools_environment/_simulated_devtools_controller.dart/0 | {
"file_path": "devtools/packages/devtools_extensions/lib/src/template/_simulated_devtools_environment/_simulated_devtools_controller.dart",
"repo_id": "devtools",
"token_count": 1582
} | 185 |
## package:devtools_shared/devtools_shared.dart
This is a package shared between devtools_app, dds, and external
users accessing exported JSON files. This package contains structures
describing the format of JSON files e.g., HeapSample, memory structures
collected from the Dart VM (HeapSpace) and collected memory info from Android's
ADB (AdbMemoryInfo).
## package:devtools_shared/devtools_server.dart
An implementation of shared devtools server classes.
## Terms and Privacy
By using Dart DevTools, you agree to the
[Google Terms of Service](https://policies.google.com/terms).
| devtools/packages/devtools_shared/README.md/0 | {
"file_path": "devtools/packages/devtools_shared/README.md",
"repo_id": "devtools",
"token_count": 158
} | 186 |
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// ignore_for_file: avoid_print
import 'dart:io';
import 'package:extension_discovery/extension_discovery.dart';
import 'package:path/path.dart' as path;
import 'extension_model.dart';
/// Location where DevTools extension assets will be served, relative to where
/// DevTools assets are served (build/).
const extensionRequestPath = 'devtools_extensions';
/// The default location for the DevTools extension, relative to
/// `<parent_package_root>/extension/devtools/`.
const extensionBuildDefault = 'build';
/// Responsible for storing the available DevTools extensions and managing the
/// content that DevTools server will serve at `build/devtools_extensions`.
///
/// When [serveAvailableExtensions] is called, the available extensions will be
/// looked up using package:extension_discovery, and the available extension's
/// assets will be copied to the `build/devtools_extensions` directory that
/// DevTools server is serving.
class ExtensionsManager {
ExtensionsManager({required this.buildDir});
/// The build directory of DevTools that is being served by the DevTools
/// server.
final String buildDir;
/// The directory path where DevTools extensions are being served by the
/// DevTools server.
String get _servedExtensionsPath => path.join(buildDir, extensionRequestPath);
/// The list of available DevTools extensions that are being served by the
/// DevTools server.
///
/// This list will be cleared and re-populated each time
/// [serveAvailableExtensions] is called.
final devtoolsExtensions = <DevToolsExtensionConfig>[];
/// Serves any available DevTools extensions for the given [rootPathFileUri],
/// where [rootPathFileUri] is the root for a Dart or Flutter project
/// containing the `.dart_tool/` directory.
///
/// [rootPathFileUri] is expected to be a file uri (e.g. starting with
/// 'file://').
///
/// This method first looks up the available extensions using
/// package:extension_discovery, and the available extension's
/// assets will be copied to the `build/devtools_extensions` directory that
/// DevTools server is serving.
Future<void> serveAvailableExtensions(
String? rootPathFileUri,
List<String> logs,
) async {
if (rootPathFileUri != null && !rootPathFileUri.startsWith('file://')) {
throw ArgumentError.value(
rootPathFileUri,
'rootPathFileUri',
'must be a file:// URI String',
);
}
logs.add(
'ExtensionsManager.serveAvailableExtensions: '
'rootPathFileUri: $rootPathFileUri',
);
devtoolsExtensions.clear();
final parsingErrors = StringBuffer();
if (rootPathFileUri != null) {
late final List<Extension> extensions;
try {
extensions = await findExtensions(
'devtools',
packageConfig: Uri.parse(
path.posix.join(
rootPathFileUri,
'.dart_tool',
'package_config.json',
),
),
);
logs.add(
'ExtensionsManager.serveAvailableExtensions: findExtensionsResult - '
'${extensions.map((e) => e.package).toList()}',
);
} catch (e) {
extensions = <Extension>[];
rethrow;
}
for (final extension in extensions) {
final config = extension.config;
// TODO(https://github.com/dart-lang/pub/issues/4042): make this check
// more robust.
final isPubliclyHosted = (extension.rootUri.path.contains('pub.dev') ||
extension.rootUri.path.contains('pub.flutter-io.cn'))
.toString();
// This should be relative to the 'extension/devtools/' directory and
// defaults to 'build';
final relativeExtensionLocation =
config['buildLocation'] as String? ?? 'build';
final location = path.join(
extension.rootUri.toFilePath(),
'extension',
'devtools',
relativeExtensionLocation,
);
try {
final extensionConfig = DevToolsExtensionConfig.parse({
...config,
DevToolsExtensionConfig.pathKey: location,
DevToolsExtensionConfig.isPubliclyHostedKey: isPubliclyHosted,
});
devtoolsExtensions.add(extensionConfig);
} on StateError catch (e) {
parsingErrors.writeln(e.message);
continue;
}
}
}
_resetServedPluginsDir();
await Future.wait([
for (final extension in devtoolsExtensions)
_moveToServedExtensionsDir(extension.name, extension.path, logs: logs),
]);
if (parsingErrors.isNotEmpty) {
throw ExtensionParsingException(
'Encountered errors while parsing extension config.yaml '
'files:\n$parsingErrors',
);
}
}
void _resetServedPluginsDir() {
final buildDirectory = Directory(buildDir);
if (!buildDirectory.existsSync()) {
throw const FileSystemException('The build directory does not exist.');
}
// Destroy and recreate the 'devtools_extensions' directory where extension
// assets are served.
final servedExtensionsDir = Directory(_servedExtensionsPath);
if (servedExtensionsDir.existsSync()) {
servedExtensionsDir.deleteSync(recursive: true);
}
servedExtensionsDir.createSync();
}
Future<void> _moveToServedExtensionsDir(
String extensionPackageName,
String extensionPath, {
required List<String> logs,
}) async {
final newExtensionPath = path.join(
_servedExtensionsPath,
extensionPackageName,
);
logs.add(
'ExtensionsManager._moveToServedExtensionsDir: moving '
'$extensionPath to $newExtensionPath',
);
await copyPath(extensionPath, newExtensionPath);
}
}
// NOTE: this code is copied from `package:io`:
// https://github.com/dart-lang/io/blob/master/lib/src/copy_path.dart.
/// Copies all of the files in the [from] directory to [to].
///
/// This is similar to `cp -R <from> <to>`:
/// * Symlinks are supported.
/// * Existing files are over-written, if any.
/// * If [to] is within [from], throws [ArgumentError] (an infinite operation).
/// * If [from] and [to] are canonically the same, no operation occurs.
///
/// Returns a future that completes when complete.
Future<void> copyPath(String from, String to) async {
if (path.canonicalize(from) == path.canonicalize(to)) {
return;
}
if (path.isWithin(from, to)) {
throw ArgumentError('Cannot copy from $from to $to');
}
await Directory(to).create(recursive: true);
await for (final file in Directory(from).list(recursive: true)) {
final copyTo = path.join(to, path.relative(file.path, from: from));
if (file is Directory) {
await Directory(copyTo).create(recursive: true);
} else if (file is File) {
await File(file.path).copy(copyTo);
} else if (file is Link) {
await Link(copyTo).create(await file.target(), recursive: true);
}
}
}
/// Exception type for errors encountered while parsing DevTools extension
/// config.yaml files.
class ExtensionParsingException extends FormatException {
const ExtensionParsingException(super.message);
}
| devtools/packages/devtools_shared/lib/src/extensions/extension_manager.dart/0 | {
"file_path": "devtools/packages/devtools_shared/lib/src/extensions/extension_manager.dart",
"repo_id": "devtools",
"token_count": 2620
} | 187 |
// Copyright 2023 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Code needs to match API from VmService.
// ignore_for_file: avoid-dynamic
import 'dart:async';
import 'package:vm_service/utils.dart';
import 'package:vm_service/vm_service.dart';
import 'package:web_socket_channel/web_socket_channel.dart';
import '../sse/sse_shim.dart';
Future<T> _connectWithSse<T extends VmService>({
required Uri uri,
required void Function(Object?) onError,
required Completer<void> finishedCompleter,
required VmServiceFactory<T> serviceFactory,
}) {
final serviceCompleter = Completer<T>();
uri = uri.scheme == 'sse'
? uri.replace(scheme: 'http')
: uri.replace(scheme: 'https');
final client = SseClient('$uri', debugKey: 'DevToolsService');
final Stream<String> stream =
client.stream!.asBroadcastStream() as Stream<String>;
final service = serviceFactory(
inStream: stream,
writeMessage: client.sink!.add,
wsUri: uri.toString(),
);
unawaited(
client.sink!.done.whenComplete(() {
finishedCompleter.complete();
service.dispose();
}),
);
serviceCompleter.complete(service);
unawaited(stream.drain<void>().catchError(onError));
return serviceCompleter.future;
}
Future<T> _connectWithWebSocket<T extends VmService>({
required Uri uri,
required void Function(Object?) onError,
required Completer<void> finishedCompleter,
required VmServiceFactory<T> serviceFactory,
}) async {
// Map the URI (which may be Observatory web app) to a WebSocket URI for
// the VM service.
uri = convertToWebSocketUrl(serviceProtocolUrl: uri);
final ws = WebSocketChannel.connect(uri);
final stream = ws.stream.handleError(onError);
final service = serviceFactory(
inStream: stream,
writeMessage: (String message) {
ws.sink.add(message);
},
wsUri: uri.toString(),
);
if (ws.closeCode != null) {
onError(null);
return service;
}
unawaited(
ws.sink.done.then(
(_) {
finishedCompleter.complete();
service.dispose();
},
onError: onError,
),
);
return service;
}
Future<T> connect<T extends VmService>({
required Uri uri,
required Completer<void> finishedCompleter,
required VmServiceFactory<T> serviceFactory,
}) {
final connectedCompleter = Completer<T>();
void onError(Object? error) {
if (!connectedCompleter.isCompleted) {
connectedCompleter.completeError(error!);
}
}
// Connects to a VM Service but does not verify the connection was fully
// successful.
Future<T> connectHelper() async {
final useSse = uri.scheme == 'sse' || uri.scheme == 'sses';
final T service = useSse
? await _connectWithSse<T>(
uri: uri,
onError: onError,
finishedCompleter: finishedCompleter,
serviceFactory: serviceFactory,
)
: await _connectWithWebSocket<T>(
uri: uri,
onError: onError,
finishedCompleter: finishedCompleter,
serviceFactory: serviceFactory,
);
// Verify that the VM is alive enough to actually get the version before
// considering it successfully connected. Otherwise, VMService instances
// that failed part way through the connection may appear to be connected.
await service.getVersion();
return service;
}
connectHelper().then(
(service) {
if (!connectedCompleter.isCompleted) {
connectedCompleter.complete(service);
}
},
onError: onError,
);
finishedCompleter.future.then((_) {
// It is an error if we finish before we are connected.
if (!connectedCompleter.isCompleted) {
onError(null);
}
});
return connectedCompleter.future;
}
| devtools/packages/devtools_shared/lib/src/service/service.dart/0 | {
"file_path": "devtools/packages/devtools_shared/lib/src/service/service.dart",
"repo_id": "devtools",
"token_count": 1432
} | 188 |
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@TestOn('vm')
import 'dart:io';
import 'package:devtools_shared/devtools_extensions_io.dart';
import 'package:path/path.dart' as p;
import 'package:test/test.dart';
void main() {
late Directory from;
late Directory to;
tearDown(() {
// Delete [to] first so that we do not hit a file system exception when [to]
// is a subdirectory of [from].
to.deleteSync(recursive: true);
from.deleteSync(recursive: true);
});
test('copyPath', () async {
from = _createFromDir();
to = _createToDir();
await copyPath(from.path, to.path);
const expected =
"[Directory: 'tmp/bar', File: 'tmp/bar/baz.txt', File: 'tmp/foo.txt']";
final fromContents = _contentAsOrderedString(from);
final toContents = _contentAsOrderedString(to);
expect(fromContents.toString(), expected);
expect(toContents.toString(), expected.replaceAll('tmp', 'tmp2'));
});
test('copy path throws for infinite operation', () async {
from = _createFromDir();
to = Directory(p.join(from.path, 'bar'));
expect(to.existsSync(), isTrue);
await expectLater(copyPath(from.path, to.path), throwsArgumentError);
});
}
Directory _createFromDir() {
final from = Directory('tmp')..createSync();
File(p.join(from.path, 'foo.txt')).createSync();
final dir = Directory(p.join(from.path, 'bar'))..createSync();
File(p.join(dir.path, 'baz.txt')).createSync();
final contents = _contentAsOrderedString(from);
expect(
contents,
"[Directory: 'tmp/bar', File: 'tmp/bar/baz.txt', File: 'tmp/foo.txt']",
);
return from;
}
Directory _createToDir() {
final to = Directory('tmp2')..createSync();
final contents = _contentAsOrderedString(to);
expect(contents, '[]');
return to;
}
String _contentAsOrderedString(Directory dir) {
final contents = dir.listSync(recursive: true)
..sort((a, b) => a.path.compareTo(b.path));
return contents
// Always use posix paths so that expectations can be consistent between
// Mac/Windows.
.map(
(e) =>
"${e is Directory ? 'Directory' : 'File'}: '${posixPath(e.path)}'",
)
.toList()
.toString();
}
/// Returns a relative path [input] with posix/forward slashes regardless of
/// the current platform.
String posixPath(String input) => p.posix.joinAll(p.split(input));
| devtools/packages/devtools_shared/test/extensions/extension_manager_test.dart/0 | {
"file_path": "devtools/packages/devtools_shared/test/extensions/extension_manager_test.dart",
"repo_id": "devtools",
"token_count": 906
} | 189 |
name: ansi_up
description: Minimal package containing 'ansi_up' third_party dependency used by package:devtools.
homepage: https://github.com/flutter/devtools/tree/master/third_party/packages/ansi_up
version: 1.0.0
environment:
sdk: ^3.0.0
dev_dependencies:
lints: ^3.0.0
| devtools/third_party/packages/ansi_up/pubspec.yaml/0 | {
"file_path": "devtools/third_party/packages/ansi_up/pubspec.yaml",
"repo_id": "devtools",
"token_count": 102
} | 190 |
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>Perfetto UI</title>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<link rel="shortcut icon" id="favicon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=">
<link id="devtools-style" rel="stylesheet" href="devtools/devtools_dark.css">
<script src="devtools/devtools_theme_handler.js"></script>
</head>
<body data-perfetto_version='{"stable":"v33.0-1838a06af"}'>
<!--
Don't add any content here. The whole <body> is replaced by
frontend/index.ts when bootstrapping. This is only used for very early
error reporting.
-->
<style>
#app_load_failure {opacity:0;transition:opacity 1s ease;position:absolute;overflow:auto;background:#080082;top:0;left:0;width:100%;height:100%;bottom:0;right:0;margin:0;opacity:0;user-select:text}
#app_load_failure > pre {color:#fff;position:absolute;margin:auto;white-space:pre-wrap;top:10vh;max-width:90vw;width:880px;left:0;right:0;font-size:16px;line-height:30px;font-weight:700}
#app_load_failure > pre span {background:#fff;color:#080082;padding:2px}
#app_load_failure_dbg { overflow-wrap: break-word; font-size: 12px; line-height: 1; font-weight: initial;}
#app_load_failure a {color:#fff}
#app_load { position: absolute; top: 0; left: 0; right:0; bottom: 0; background-color: #2c3e50;}
#app_load_spinner { margin: 30vh auto; width: 150px; height: 150px; border: 3px solid rgba(255,255,255,.3); border-radius: 50%; border-top-color: #fff; animation: app_load_spin 1s ease-in-out infinite; }
@keyframes app_load_spin { to { transform: rotate(360deg); } }
</style>
<div id="app_load"><div id="app_load_spinner"></div></div>
<div id="app_load_failure">
<pre>
<span>Perfetto UI - An unrecoverable problem occurred</span>
If you are seeing this message, something went wrong while loading the UI.
Please file a bug (details below) and try these remediation steps:
* Force-reload the page with Ctrl+Shift+R (Mac: Meta+Shift+R) or
Shift + click on the refresh button.
* <a href="javascript:clearAllCaches();">Clear all the site storage and caches</a> and reload the page.
* Clear the site data and caches from devtools, following <a target="_blank" href="https://developers.google.com/web/tools/chrome-devtools/storage/cache#deletecache">these instructions</a>.
In any case, **FILE A BUG** attaching logs and screenshots from devtools.
Googlers: <a href="http://go/perfetto-ui-bug" target="_blank">go/perfetto-ui-bug</a>
Non-googlers: <a href="https://github.com/google/perfetto/issues/new" target="_blank">github.com/google/perfetto/issues/new</a>
<div id=app_load_failure_err></div>
Technical Information:
<div id=app_load_failure_dbg></div>
</pre>
</div>
<script type="text/javascript">
'use strict';
(function () {
const TIMEOUT_MS = 20000;
let errTimerId = undefined;
function errHandler(err) {
// Note: we deliberately don't clearTimeout(), which means that this
// handler is called also in the happy case when the UI loads. In that
// case, though, the onCssLoaded() in frontend/index.ts will empty the
// <body>, so |div| below will be null and this function becomes a
// no-op.
const div = document.getElementById('app_load_failure');
if (!div) return;
div.style.opacity ='1';
const errDom = document.getElementById('app_load_failure_err');
if (!errDom) return;
console.error(err);
errDom.innerText += `${err}\n`;
const storageJson = JSON.stringify(window.localStorage);
const dbg = document.getElementById('app_load_failure_dbg');
if (!dbg) return;
dbg.innerText = `LocalStorage: ${storageJson}\n`;
if (errTimerId !== undefined) clearTimeout(errTimerId);
}
// For the 'Click here to clear all caches'.
window.clearAllCaches = () => {
if (window.localStorage) window.localStorage.clear();
if (window.sessionStorage) window.sessionStorage.clear();
const promises = [];
if (window.caches) {
window.caches.keys().then(
keys => keys.forEach(k => promises.push(window.caches.delete(k))));
}
if (navigator.serviceWorker) {
navigator.serviceWorker.getRegistrations().then(regs => {
regs.forEach(reg => promises.push(reg.unregister()));
});
}
Promise.all(promises).then(() => window.location.reload());
}
// If the frontend doesn't come up, make the error page above visible.
errTimerId = setTimeout(() => errHandler('Timed out'), TIMEOUT_MS);
window.onerror = errHandler;
window.onunhandledrejection = errHandler;
const versionStr = document.body.dataset['perfetto_version'] || '{}';
const versionMap = JSON.parse(versionStr);
const channel = localStorage.getItem('perfettoUiChannel') || 'stable';
// The '.' below is a fallback for the case of opening a pinned version
// (e.g., ui.perfetto.dev/v1.2.3./). In that case, the index.html has no
// valid version map; we want to load the frontend from the same
// sub-directory directory, hence ./frontend_bundle.js.
const version = versionMap[channel] || versionMap['stable'] || '.';
const script = document.createElement('script');
script.async = true;
script.src = version + '/frontend_bundle.js';
script.onerror = () => errHandler(`Failed to load ${script.src}`);
document.head.append(script);
})();
</script>
</body>
</html>
| devtools/third_party/packages/perfetto_ui_compiled/lib/dist/index.html/0 | {
"file_path": "devtools/third_party/packages/perfetto_ui_compiled/lib/dist/index.html",
"repo_id": "devtools",
"token_count": 2145
} | 191 |
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// ignore_for_file: constant_identifier_names
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
class WidgetIcons {
static const _family = 'widget_icons';
static const _fontPackage = 'widget_icons';
static const alert_dialog = IconData(
0xe900,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const align = IconData(
0xe901,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const animated = IconData(
0xe902,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const app_bar = IconData(
0xe903,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const bottom_bar = IconData(
0xe904,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const card = IconData(
0xe905,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const center = IconData(
0xe906,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const checkbox = IconData(
0xe907,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const circle_avatar = IconData(
0xe908,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const circular_progress = IconData(
0xe909,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const column = IconData(
0xe90a,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const constrained_box = IconData(
0xe90b,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const container = IconData(
0xe90c,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const divider = IconData(
0xe90d,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const drawer = IconData(
0xe90e,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const flexible = IconData(
0xe90f,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const floating_action_button = IconData(
0xe910,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const gesture = IconData(
0xe911,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const grid_view = IconData(
0xe912,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const hero = IconData(
0xe913,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const icon = IconData(
0xe914,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const image = IconData(
0xe915,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const inkwell = IconData(
0xe916,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const list_view = IconData(
0xe917,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const material = IconData(
0xe918,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const opacity = IconData(
0xe919,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const outlined_button = IconData(
0xe91a,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const padding = IconData(
0xe91b,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const page_view = IconData(
0xe925,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const radio_button = IconData(
0xe91c,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const root = IconData(
0xe91d,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const row = IconData(
0xe91e,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const scaffold = IconData(
0xe91f,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const scroll = IconData(
0xe920,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const sized_box = IconData(
0xe921,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const stack = IconData(
0xe922,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const tab = IconData(
0xe923,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const text = IconData(
0xe924,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const text_button = IconData(
0xe929,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const toggle = IconData(
0xe926,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const transition = IconData(
0xe927,
fontFamily: _family,
fontPackage: _fontPackage,
);
static const wrap = IconData(
0xe928,
fontFamily: _family,
fontPackage: _fontPackage,
);
}
| devtools/third_party/packages/widget_icons/lib/widget_icons.dart/0 | {
"file_path": "devtools/third_party/packages/widget_icons/lib/widget_icons.dart",
"repo_id": "devtools",
"token_count": 1909
} | 192 |
#!/bin/bash
# Copyright 2023 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Fast fail the script on failures.
set -ex
export SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
export DEVTOOLS_DIR=$SCRIPT_DIR/../..
# In GitBash on Windows, we have to call flutter.bat so we alias them in this
# script to call the correct one based on the OS.
function flutter {
# TODO: Also support windows on github actions.
if [[ $RUNNER_OS == "Windows" ]]; then
command flutter.bat "$@"
else
command flutter "$@"
fi
}
export -f flutter
# TODO: Also support windows on github actions.
if [[ $RUNNER_OS == "Windows" ]]; then
echo Installing Google Chrome Stable...
# Install Chrome via Chocolatey while `addons: chrome` doesn't seem to work on Windows yet
# https://travis-ci.community/t/installing-google-chrome-stable-but-i-cant-find-it-anywhere/2118
choco install googlechrome --acceptlicense --yes --no-progress --ignore-checksums
fi
# Make sure Flutter sdk has been provided
if [ ! -d "./tool/flutter-sdk" ]; then
echo "Expected ./tool/flutter-sdk to exist"
exit 1;
fi
# Look in the dart bin dir first, then the flutter one, then the one for the
# devtools repo. We don't use the dart script from flutter/bin as that script
# can and does print 'Waiting for another flutter command...' at inopportune
# times.
export PATH=`pwd`/tool/flutter-sdk/bin/cache/dart-sdk/bin:`pwd`/tool/flutter-sdk/bin:`pwd`/bin:$PATH
# Look up the latest flutter candidate (this is the latest flutter version in g3)
# TODO(https://github.com/flutter/devtools/issues/4591): re-write this script as a
# shell script so we won't have to incurr the cost of building flutter tool twice.
flutter config --no-analytics
flutter doctor
# We should be using dart from ../flutter-sdk/bin/cache/dart-sdk/dart.
echo "which flutter: " `which flutter`
echo "which dart: " `which dart`
# Disable analytics to ensure that the welcome message for the dart cli tooling
# doesn't interrupt the CI bots.
dart --disable-analytics
# Print out the versions and ensure we can call Dart, Pub, and Flutter.
flutter --version
dart --version
# Fetch dependencies for the tool/ directory
pushd $DEVTOOLS_DIR/tool
flutter pub get
popd
# Ensure the devtools_tool command is available
export PATH="$PATH":"$DEVTOOLS_DIR/tool/bin"
# Fetch dependencies
devtools_tool pub-get --only-main
# Generate code.
devtools_tool generate-code
| devtools/tool/ci/setup.sh/0 | {
"file_path": "devtools/tool/ci/setup.sh",
"repo_id": "devtools",
"token_count": 852
} | 193 |
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:args/command_runner.dart';
import '../model.dart';
class RepoCheckCommand extends Command {
@override
String get name => 'repo-check';
@override
String get description => 'Validate properties of the repo source code.';
@override
Future run() async {
final repo = DevToolsRepo.getInstance();
print('DevTools repo at ${repo.repoPath}.');
final checks = <Check>[
DevToolsVersionCheck(),
];
print('\nPerforming checks...');
int failureCount = 0;
for (var check in checks) {
print('\nchecking ${check.name}:');
try {
await check.performCheck(repo);
print(' check successful');
} catch (e) {
failureCount++;
print(' failed: $e');
}
}
return failureCount == 0 ? 0 : 1;
}
}
abstract class Check {
String get name;
// Throw if the check fails.
Future<void> performCheck(DevToolsRepo repo);
}
class DevToolsVersionCheck extends Check {
@override
String get name => 'devtools version';
@override
Future<void> performCheck(DevToolsRepo repo) {
// TODO(devoncarew): Update this to use a package to parse the pubspec file;
// https://pub.dev/packages/pubspec.
final pubspecContents =
repo.readFile(Uri.parse('packages/devtools_app/pubspec.yaml'));
final versionString = pubspecContents
.split('\n')
.firstWhere((line) => line.startsWith('version:'));
final pubspecVersion = versionString.substring('version:'.length).trim();
final dartFileContents =
repo.readFile(Uri.parse('packages/devtools_app/lib/devtools.dart'));
final regexp = RegExp(r"version = '(\S+)';");
final match = regexp.firstMatch(dartFileContents);
if (match == null) {
throw 'Unable to parse the DevTools version from '
'packages/devtools_app/lib/devtools.dart';
}
final dartVersion = match.group(1);
if (pubspecVersion != dartVersion) {
throw 'App version $dartVersion != pubspec version $pubspecVersion; '
'these need to be kept in sync.';
}
print(' version $pubspecVersion');
return Future.value();
}
}
| devtools/tool/lib/commands/repo_check.dart/0 | {
"file_path": "devtools/tool/lib/commands/repo_check.dart",
"repo_id": "devtools",
"token_count": 866
} | 194 |
# Defines the Chromium style for automatic reformatting.
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
BasedOnStyle: Chromium
# This defaults to 'Auto'. Explicitly set it for a while, so that
# 'vector<vector<int> >' in existing files gets formatted to
# 'vector<vector<int>>'. ('Auto' means that clang-format will only use
# 'int>>' if the file already contains at least one such instance.)
Standard: Cpp11
SortIncludes: true
---
Language: ObjC
ColumnLimit: 100
| engine/.clang-format/0 | {
"file_path": "engine/.clang-format",
"repo_id": "engine",
"token_count": 139
} | 195 |
# Specify analysis options.
#
# This file is a copy of analysis_options.yaml from flutter repo
# as of 2023-12-18, but with some modifications marked with
# "DIFFERENT FROM FLUTTER/FLUTTER" below.
analyzer:
language:
strict-casts: true
strict-inference: true
strict-raw-types: true
errors:
# allow deprecated members (we do this because otherwise we have to annotate
# every member in every test, assert, etc, when we or the Dart SDK deprecates
# something (https://github.com/flutter/flutter/issues/143312)
deprecated_member_use: ignore
deprecated_member_use_from_same_package: ignore
exclude: # DIFFERENT FROM FLUTTER/FLUTTER
# Fixture depends on dart:ui and raises false positives.
- flutter_frontend_server/test/fixtures/lib/main.dart
linter:
rules:
# This list is derived from the list of all available lints located at
# https://github.com/dart-lang/linter/blob/main/example/all.yaml
- always_declare_return_types
- always_put_control_body_on_new_line
# - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219
- always_specify_types
# - always_use_package_imports # we do this commonly
- annotate_overrides
# - avoid_annotating_with_dynamic # conflicts with always_specify_types
- avoid_bool_literals_in_conditional_expressions
# - avoid_catches_without_on_clauses # blocked on https://github.com/dart-lang/linter/issues/3023
# - avoid_catching_errors # blocked on https://github.com/dart-lang/linter/issues/3023
# - avoid_classes_with_only_static_members # we do this commonly for `abstract final class`es
- avoid_double_and_int_checks
- avoid_dynamic_calls
- avoid_empty_else
# - avoid_equals_and_hash_code_on_mutable_classes # DIFFERENT FROM FLUTTER/FLUTTER (can't import the meta package here)
- avoid_escaping_inner_quotes
- avoid_field_initializers_in_const_classes
# - avoid_final_parameters # incompatible with prefer_final_parameters
- avoid_function_literals_in_foreach_calls
# - avoid_implementing_value_types # see https://github.com/dart-lang/linter/issues/4558
- avoid_init_to_null
- avoid_js_rounded_ints
# - avoid_multiple_declarations_per_line # seems to be a stylistic choice we don't subscribe to
- avoid_null_checks_in_equality_operators
# - avoid_positional_boolean_parameters # would have been nice to enable this but by now there's too many places that break it
- avoid_print
# - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356)
- avoid_redundant_argument_values
- avoid_relative_lib_imports
- avoid_renaming_method_parameters
- avoid_return_types_on_setters
- avoid_returning_null_for_void
# - avoid_returning_this # there are enough valid reasons to return `this` that this lint ends up with too many false positives
- avoid_setters_without_getters
- avoid_shadowing_type_parameters
- avoid_single_cascade_in_expression_statements
- avoid_slow_async_io
- avoid_type_to_string
- avoid_types_as_parameter_names
# - avoid_types_on_closure_parameters # conflicts with always_specify_types
- avoid_unnecessary_containers
- avoid_unused_constructor_parameters
- avoid_void_async
# - avoid_web_libraries_in_flutter # we use web libraries in web-specific code, and our tests prevent us from using them elsewhere
- await_only_futures
- camel_case_extensions
- camel_case_types
- cancel_subscriptions
# - cascade_invocations # doesn't match the typical style of this repo
- cast_nullable_to_non_nullable
# - close_sinks # not reliable enough
- collection_methods_unrelated_type
- combinators_ordering
# - comment_references # blocked on https://github.com/dart-lang/linter/issues/1142
- conditional_uri_does_not_exist
# - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204
- control_flow_in_finally
- curly_braces_in_flow_control_structures
- dangling_library_doc_comments
- depend_on_referenced_packages
- deprecated_consistency
# - deprecated_member_use_from_same_package # we allow self-references to deprecated members
# - diagnostic_describe_all_properties # enabled only at the framework level (packages/flutter/lib)
- directives_ordering
# - discarded_futures # too many false positives, similar to unawaited_futures
# - do_not_use_environment # there are appropriate times to use the environment, especially in our tests and build logic
- empty_catches
- empty_constructor_bodies
- empty_statements
- eol_at_end_of_file
- exhaustive_cases
- file_names
- flutter_style_todos
- hash_and_equals
- implementation_imports
- implicit_call_tearoffs
- implicit_reopen
- invalid_case_patterns
# - join_return_with_assignment # not required by flutter style
- leading_newlines_in_multiline_strings
- library_annotations
- library_names
- library_prefixes
- library_private_types_in_public_api
# - lines_longer_than_80_chars # not required by flutter style
- literal_only_boolean_expressions
# - matching_super_parameters # blocked on https://github.com/dart-lang/language/issues/2509
# - missing_whitespace_between_adjacent_strings # DIFFERENT FROM FLUTTER/FLUTTER (too many false positives)
- no_adjacent_strings_in_list
- no_default_cases
- no_duplicate_case_values
- no_leading_underscores_for_library_prefixes
- no_leading_underscores_for_local_identifiers
- no_literal_bool_comparisons
- no_logic_in_create_state
# - no_runtimeType_toString # ok in tests; we enable this only in packages/
- no_self_assignments
- no_wildcard_variable_uses
- non_constant_identifier_names
- noop_primitive_operations
- null_check_on_nullable_type_parameter
- null_closures
# - omit_local_variable_types # opposite of always_specify_types
# - one_member_abstracts # too many false positives
- only_throw_errors # this does get disabled in a few places where we have legacy code that uses strings et al
- overridden_fields
- package_api_docs
- package_names
- package_prefixed_library_names
# - parameter_assignments # we do this commonly
- prefer_adjacent_string_concatenation
- prefer_asserts_in_initializer_lists
# - prefer_asserts_with_message # not required by flutter style
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_const_constructors
- prefer_const_constructors_in_immutables
- prefer_const_declarations
- prefer_const_literals_to_create_immutables
# - prefer_constructors_over_static_methods # far too many false positives
- prefer_contains
# - prefer_double_quotes # opposite of prefer_single_quotes
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
- prefer_final_fields
- prefer_final_in_for_each
- prefer_final_locals
# - prefer_final_parameters # adds too much verbosity
- prefer_for_elements_to_map_fromIterable
- prefer_foreach
- prefer_function_declarations_over_variables
- prefer_generic_function_type_aliases
- prefer_if_elements_to_conditional_expressions
- prefer_if_null_operators
- prefer_initializing_formals
- prefer_inlined_adds
# - prefer_int_literals # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#use-double-literals-for-double-constants
- prefer_interpolation_to_compose_strings
- prefer_is_empty
- prefer_is_not_empty
- prefer_is_not_operator
- prefer_iterable_whereType
- prefer_mixin
# - prefer_null_aware_method_calls # "call()" is confusing to people new to the language since it's not documented anywhere
- prefer_null_aware_operators
- prefer_relative_imports
- prefer_single_quotes
- prefer_spread_collections
- prefer_typing_uninitialized_variables
- prefer_void_to_null
- provide_deprecation_message
- public_member_api_docs # DIFFERENT FROM FLUTTER/FLUTTER
- recursive_getters
# - require_trailing_commas # would be nice, but requires a lot of manual work: 10,000+ code locations would need to be reformatted by hand after bulk fix is applied
- secure_pubspec_urls
- sized_box_for_whitespace
- sized_box_shrink_expand
- slash_for_doc_comments
- sort_child_properties_last
- sort_constructors_first
# - sort_pub_dependencies # prevents separating pinned transitive dependencies
- sort_unnamed_constructors_first
- test_types_in_equals
- throw_in_finally
- tighten_type_of_initializing_formals
# - type_annotate_public_apis # subset of always_specify_types
- type_init_formals
- type_literal_in_constant_pattern
# - unawaited_futures # too many false positives, especially with the way AnimationController works
- unnecessary_await_in_return
- unnecessary_brace_in_string_interps
- unnecessary_breaks
- unnecessary_const
- unnecessary_constructor_name
# - unnecessary_final # conflicts with prefer_final_locals
- unnecessary_getters_setters
# - unnecessary_lambdas # has false positives: https://github.com/dart-lang/linter/issues/498
- unnecessary_late
- unnecessary_library_directive
- unnecessary_new
- unnecessary_null_aware_assignments
- unnecessary_null_aware_operator_on_extension_on_nullable
- unnecessary_null_checks
- unnecessary_null_in_if_null_operators
- unnecessary_nullable_for_final_variable_declarations
- unnecessary_overrides
- unnecessary_parenthesis
# - unnecessary_raw_strings # what's "necessary" is a matter of opinion; consistency across strings can help readability more than this lint
- unnecessary_statements
- unnecessary_string_escapes
- unnecessary_string_interpolations
- unnecessary_this
- unnecessary_to_list_in_spreads
- unreachable_from_main
- unrelated_type_equality_checks
- unsafe_html
- use_build_context_synchronously
- use_colored_box
# - use_decorated_box # leads to bugs: DecoratedBox and Container are not equivalent (Container inserts extra padding)
- use_enums
- use_full_hex_values_for_flutter_colors
- use_function_type_syntax_for_parameters
- use_if_null_to_convert_nulls_to_bools
- use_is_even_rather_than_modulo
- use_key_in_widget_constructors
- use_late_for_private_fields_and_variables
- use_named_constants
- use_raw_strings
- use_rethrow_when_possible
- use_setters_to_change_properties
# - use_string_buffers # has false positives: https://github.com/dart-lang/sdk/issues/34182
# - use_string_in_part_of_directives # DIFFERENT FROM FLUTTER/FLUTTER (needs to be evaluated, dart:ui does this frequently)
- use_super_parameters
- use_test_throws_matchers
# - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review
- valid_regexps
- void_checks
| engine/analysis_options.yaml/0 | {
"file_path": "engine/analysis_options.yaml",
"repo_id": "engine",
"token_count": 3955
} | 196 |
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//flutter/build/dart/dart.gni")
# Generates an assembly file defining a given symbol with the bytes from a
# binary file. Places the symbol in a text section if 'executable' is true,
# otherwise places the symbol in a read-only data section.
template("bin_to_assembly") {
assert(defined(invoker.deps), "Must define deps")
assert(defined(invoker.input), "Must define input binary file")
assert(defined(invoker.symbol), "Must define symbol name")
assert(defined(invoker.executable), "Must define boolean executable")
action(target_name) {
deps = invoker.deps
script = "$dart_src/runtime/tools/bin_to_assembly.py"
output = "$target_gen_dir/${invoker.input}.S"
args = [
"--input",
rebase_path(invoker.input),
"--output",
rebase_path(output),
"--symbol_name",
invoker.symbol,
"--target_os",
current_os,
]
if (defined(invoker.size_symbol)) {
args += [
"--size_symbol_name",
invoker.size_symbol,
"--target_arch",
current_cpu,
]
}
if (invoker.executable) {
args += [ "--executable" ]
}
if (current_os != "win") {
args += [ "--incbin" ]
}
inputs = [
script,
invoker.input,
]
outputs = [ output ]
}
}
# Generates an object file defining a given symbol with the bytes from a
# binary file. Places the symbol in the read-only data section.
template("bin_to_coff") {
assert(defined(invoker.deps), "Must define deps")
assert(defined(invoker.input), "Must define input binary file")
assert(defined(invoker.symbol), "Must define symbol name")
assert(defined(invoker.executable), "Must define executable")
action(target_name) {
deps = invoker.deps
script = "$dart_src/runtime/tools/bin_to_coff.py"
output = "$target_gen_dir/${invoker.input}.o"
args = [
"--input",
rebase_path(invoker.input),
"--output",
rebase_path(output),
"--symbol_name",
invoker.symbol,
]
if (defined(invoker.size_symbol)) {
args += [
"--size_symbol_name",
invoker.size_symbol,
]
}
if (invoker.executable) {
args += [ "--executable" ]
}
args += [ "--arch=$current_cpu" ]
inputs = [ invoker.input ]
outputs = [ output ]
}
}
# Generates a linkable output file defining the specified symbol with the bytes
# from the binary file. Emits a COFF object file when targeting Windows,
# otherwise assembly.
template("bin_to_linkable") {
assert(defined(invoker.deps), "Must define deps")
assert(defined(invoker.input), "Must define input binary file")
assert(defined(invoker.symbol), "Must define symbol name")
target_type = "bin_to_assembly"
if (is_win) {
target_type = "bin_to_coff"
}
target(target_type, target_name) {
forward_variables_from(invoker, "*")
}
}
| engine/build/bin_to_obj.gni/0 | {
"file_path": "engine/build/bin_to_obj.gni",
"repo_id": "engine",
"token_count": 1171
} | 197 |
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("glfw_args.gni")
_checkout_dir = "//flutter/third_party/glfw"
config("relative_glfw_headers") {
include_dirs = [
"$_checkout_dir/include",
"$_checkout_dir/include/GLFW",
]
}
source_set("glfw") {
public = [
"$_checkout_dir/include/GLFW/glfw3.h",
"$_checkout_dir/include/GLFW/glfw3native.h",
]
sources = [
"$_checkout_dir/src/context.c",
"$_checkout_dir/src/egl_context.c",
"$_checkout_dir/src/init.c",
"$_checkout_dir/src/input.c",
"$_checkout_dir/src/monitor.c",
"$_checkout_dir/src/null_init.c",
"$_checkout_dir/src/null_joystick.c",
"$_checkout_dir/src/null_joystick.h",
"$_checkout_dir/src/null_monitor.c",
"$_checkout_dir/src/null_platform.h",
"$_checkout_dir/src/null_window.c",
"$_checkout_dir/src/osmesa_context.c",
"$_checkout_dir/src/platform.c",
"$_checkout_dir/src/vulkan.c",
"$_checkout_dir/src/window.c",
]
include_dirs = [ "$_checkout_dir/src" ]
public_configs = [ ":relative_glfw_headers" ]
if (is_win) {
sources += [
"$_checkout_dir/src/wgl_context.c",
"$_checkout_dir/src/win32_init.c",
"$_checkout_dir/src/win32_joystick.c",
"$_checkout_dir/src/win32_joystick.h",
"$_checkout_dir/src/win32_module.c",
"$_checkout_dir/src/win32_monitor.c",
"$_checkout_dir/src/win32_platform.h",
"$_checkout_dir/src/win32_thread.c",
"$_checkout_dir/src/win32_time.c",
"$_checkout_dir/src/win32_window.c",
]
libs = [ "Gdi32.lib" ]
defines = [ "_GLFW_WIN32" ]
} else if (is_linux) {
sources += [
"$_checkout_dir/src/glx_context.c",
"$_checkout_dir/src/linux_joystick.c",
"$_checkout_dir/src/linux_joystick.h",
"$_checkout_dir/src/posix_module.c",
"$_checkout_dir/src/posix_poll.c",
"$_checkout_dir/src/posix_poll.h",
"$_checkout_dir/src/posix_thread.c",
"$_checkout_dir/src/posix_thread.h",
"$_checkout_dir/src/posix_time.c",
"$_checkout_dir/src/posix_time.h",
"$_checkout_dir/src/x11_init.c",
"$_checkout_dir/src/x11_monitor.c",
"$_checkout_dir/src/x11_platform.h",
"$_checkout_dir/src/x11_window.c",
"$_checkout_dir/src/xkb_unicode.c",
"$_checkout_dir/src/xkb_unicode.h",
]
defines = [
"_GLFW_X11",
"_GLFW_HAS_XF86VM",
]
libs = [
"X11",
"Xcursor",
"Xinerama",
"Xrandr",
"Xxf86vm",
]
} else if (is_mac) {
sources += [
"$_checkout_dir/src/cocoa_init.m",
"$_checkout_dir/src/cocoa_joystick.h",
"$_checkout_dir/src/cocoa_joystick.m",
"$_checkout_dir/src/cocoa_monitor.m",
"$_checkout_dir/src/cocoa_platform.h",
"$_checkout_dir/src/cocoa_time.c",
"$_checkout_dir/src/cocoa_window.m",
"$_checkout_dir/src/nsgl_context.m",
"$_checkout_dir/src/posix_module.c",
"$_checkout_dir/src/posix_thread.c",
"$_checkout_dir/src/posix_thread.h",
]
defines = [ "_GLFW_COCOA" ]
cflags = [
"-Wno-deprecated-declarations",
"-Wno-objc-multiple-method-names",
]
frameworks = [
"CoreVideo.framework",
"IOKit.framework",
]
}
if (glfw_vulkan_library != "") {
defines += [ "_GLFW_VULKAN_LIBRARY=" + glfw_vulkan_library ]
}
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
}
| engine/build/secondary/flutter/third_party/glfw/BUILD.gn/0 | {
"file_path": "engine/build/secondary/flutter/third_party/glfw/BUILD.gn",
"repo_id": "engine",
"token_count": 1751
} | 198 |
{
"builds": [
{
"drone_dimensions": [
"device_type=none",
"os=Linux",
"kvm=1",
"cores=8"
],
"gclient_variables": {
"use_rbe": true
},
"gn": [
"--android",
"--android-cpu=x64",
"--no-lto",
"--rbe",
"--no-goma",
"--target-dir",
"android_debug_api33_x64"
],
"dependencies": [
{
"dependency": "goldctl",
"version": "git_revision:720a542f6fe4f92922c3b8f0fdcc4d2ac6bb83cd"
}
],
"name": "android_debug_api33_x64",
"ninja": {
"config": "android_debug_api33_x64",
"targets": [
"flutter/impeller/toolkit/android:unittests",
"flutter/shell/platform/android:flutter_shell_native_unittests",
"flutter/testing/scenario_app"
]
},
"tests": [
{
"language": "python3",
"name": "Android Unit Tests",
"test_dependencies": [
{
"dependency": "android_virtual_device",
"version": "android_33_google_apis_x64.textpb"
},
{
"dependency": "avd_cipd_version",
"version": "build_id:8759428741582061553"
}
],
"contexts": [
"android_virtual_device"
],
"script": "flutter/testing/run_tests.py",
"parameters": [
"--android-variant",
"android_debug_api33_x64",
"--type",
"android"
]
},
{
"language": "dart",
"name": "Scenario App Integration Tests",
"test_timeout_secs": 900,
"max_attempts": 2,
"test_dependencies": [
{
"dependency": "android_virtual_device",
"version": "android_33_google_apis_x64.textpb"
},
{
"dependency": "avd_cipd_version",
"version": "build_id:8759428741582061553"
}
],
"contexts": [
"android_virtual_device"
],
"script": "flutter/testing/scenario_app/bin/run_android_tests.dart",
"parameters": [
"--out-dir=../out/android_debug_api33_x64"
]
}
]
}
]
}
| engine/ci/builders/linux_android_emulator_api_33.json/0 | {
"file_path": "engine/ci/builders/linux_android_emulator_api_33.json",
"repo_id": "engine",
"token_count": 2187
} | 199 |
{
"builds": [
{
"drone_dimensions": [
"device_type=none",
"os=Mac-13",
"cpu=x86",
"mac_model=Macmini8,1"
],
"gclient_variables": {
"download_android_deps": false,
"use_rbe": true
},
"gn": [
"--runtime-mode",
"debug",
"--unoptimized",
"--no-lto",
"--prebuilt-dart-sdk",
"--enable-impeller-3d",
"--rbe",
"--no-goma",
"--xcode-symlinks"
],
"name": "host_debug_unopt",
"ninja": {
"config": "host_debug_unopt",
"targets": []
},
"properties": {
"$flutter/osx_sdk": {
"sdk_version": "15a240d"
}
},
"tests": [
{
"language": "python3",
"name": "Host Tests for host_debug_unopt",
"script": "flutter/testing/run_tests.py",
"parameters": [
"--variant",
"host_debug_unopt",
"--type",
"dart,dart-host,engine",
"--engine-capture-core-dump"
]
},
{
"name": "Tests of tools/gn",
"language": "python3",
"script": "flutter/tools/gn_test.py"
}
]
},
{
"properties": {
"$flutter/osx_sdk": {
"runtime_versions": [
"ios-17-0_15a240d"
],
"sdk_version": "15a240d"
}
},
"drone_dimensions": [
"device_type=none",
"os=Mac-13",
"cpu=x86"
],
"gclient_variables": {
"download_android_deps": false,
"use_rbe": true
},
"gn": [
"--ios",
"--runtime-mode",
"debug",
"--simulator",
"--no-lto",
"--rbe",
"--no-goma",
"--xcode-symlinks",
"--target-dir",
"ios_debug_unopt_sim"
],
"name": "ios_debug_unopt_sim",
"ninja": {
"config": "ios_debug_unopt_sim",
"targets": [
"flutter/testing/scenario_app",
"flutter/shell/platform/darwin/ios:ios_test_flutter"
]
},
"tests": [
{
"language": "python3",
"name": "Tests for ios_debug_unopt_sim",
"script": "flutter/testing/run_tests.py",
"parameters": [
"--variant",
"ios_debug_unopt_sim",
"--type",
"objc",
"--engine-capture-core-dump",
"--ios-variant",
"ios_debug_unopt_sim"
]
},
{
"name": "Scenario App Integration Tests",
"parameters": [
"ios_debug_unopt_sim"
],
"script": "flutter/testing/scenario_app/run_ios_tests.sh"
}
]
},
{
"drone_dimensions": [
"device_type=none",
"os=Mac-13",
"cpu=arm64"
],
"gclient_variables": {
"download_android_deps": false,
"use_rbe": true
},
"gn": [
"--runtime-mode",
"debug",
"--unoptimized",
"--no-lto",
"--prebuilt-dart-sdk",
"--force-mac-arm64",
"--mac-cpu",
"arm64",
"--rbe",
"--no-goma",
"--xcode-symlinks",
"--use-glfw-swiftshader"
],
"name": "host_debug_unopt_arm64",
"ninja": {
"config": "host_debug_unopt_arm64",
"targets": [
]
},
"properties": {
"$flutter/osx_sdk": {
"sdk_version": "15a240d"
}
},
"tests": [
{
"language": "python3",
"name": "Host Tests for host_debug_unopt_arm64",
"script": "flutter/testing/run_tests.py",
"parameters": [
"--variant",
"host_debug_unopt_arm64",
"--type",
"dart,dart-host,engine,impeller-golden",
"--engine-capture-core-dump"
]
}
]
},
{
"properties": {
"$flutter/osx_sdk": {
"runtime_versions": [
"ios-17-0_15a240d"
],
"sdk_version": "15a240d"
}
},
"drone_dimensions": [
"device_type=none",
"os=Mac-13",
"cpu=arm64"
],
"gclient_variables": {
"download_android_deps": false,
"use_rbe": true
},
"gn": [
"--ios",
"--runtime-mode",
"debug",
"--simulator",
"--no-lto",
"--force-mac-arm64",
"--simulator-cpu",
"arm64",
"--rbe",
"--no-goma",
"--xcode-symlinks",
"--target-dir",
"ios_debug_unopt_sim_arm64"
],
"name": "ios_debug_unopt_sim_arm64",
"ninja": {
"config": "ios_debug_unopt_sim_arm64",
"targets": [
"flutter/testing/scenario_app",
"flutter/shell/platform/darwin/ios:ios_test_flutter"
]
},
"tests": [
{
"language": "python3",
"name": "Tests for ios_debug_unopt_sim_arm64",
"script": "flutter/testing/run_tests.py",
"parameters": [
"--variant",
"ios_debug_unopt_sim_arm64",
"--type",
"objc",
"--engine-capture-core-dump",
"--ios-variant",
"ios_debug_unopt_sim_arm64"
]
},
{
"name": "Scenario App Integration Tests",
"parameters": [
"ios_debug_unopt_sim_arm64"
],
"script": "flutter/testing/scenario_app/run_ios_tests.sh"
}
]
},
{
"properties": {
"$flutter/osx_sdk": {
"runtime_versions": [
"ios-17-0_15a240d"
],
"sdk_version": "15a240d"
}
},
"drone_dimensions": [
"device_type=none",
"os=Mac-13",
"cpu=arm64"
],
"gclient_variables": {
"download_android_deps": false,
"use_rbe": true
},
"gn": [
"--ios",
"--runtime-mode",
"debug",
"--simulator",
"--no-lto",
"--force-mac-arm64",
"--simulator-cpu",
"arm64",
"--darwin-extension-safe",
"--rbe",
"--no-goma",
"--xcode-symlinks",
"--target-dir",
"ios_debug_unopt_sim_arm64_extension_safe"
],
"name": "ios_debug_unopt_sim_arm64_extension_safe",
"ninja": {
"config": "ios_debug_unopt_sim_arm64_extension_safe",
"targets": [
"flutter/testing/scenario_app",
"flutter/shell/platform/darwin/ios:ios_test_flutter"
]
},
"tests": [
{
"language": "python3",
"name": "Tests for ios_debug_unopt_sim_arm64_extension_safe",
"script": "flutter/testing/run_tests.py",
"parameters": [
"--variant",
"ios_debug_unopt_sim_arm64_extension_safe",
"--type",
"objc",
"--engine-capture-core-dump",
"--ios-variant",
"ios_debug_unopt_sim_arm64_extension_safe"
]
},
{
"name": "Scenario App Integration Tests",
"parameters": [
"ios_debug_unopt_sim_arm64_extension_safe"
],
"script": "flutter/testing/scenario_app/run_ios_tests.sh"
}
]
}
]
}
| engine/ci/builders/mac_unopt.json/0 | {
"file_path": "engine/ci/builders/mac_unopt.json",
"repo_id": "engine",
"token_count": 6860
} | 200 |
../../../.clang-format
../../../.git
../../../.gitattributes
../../../.github
../../../.gitignore
../../../.gn
../../../AUTHORS
../../../CODEOWNERS
../../../README.md
../../../build
../../../build_overrides
../../../buildtools
../../../flutter/.ci.yaml
../../../flutter/.clang-format
../../../flutter/.clang-tidy
../../../flutter/.git
../../../flutter/.gitattributes
../../../flutter/.github
../../../flutter/.gitignore
../../../flutter/.style.yapf
../../../flutter/AUTHORS
../../../flutter/CODEOWNERS
../../../flutter/CONTRIBUTING.md
../../../flutter/DEPS
../../../flutter/Doxyfile
../../../flutter/README.md
../../../flutter/analysis_options.yaml
../../../flutter/build
../../../flutter/build_overrides
../../../flutter/ci
../../../flutter/common/README.md
../../../flutter/display_list/benchmarking/dl_complexity_unittests.cc
../../../flutter/display_list/display_list_unittests.cc
../../../flutter/display_list/dl_color_unittests.cc
../../../flutter/display_list/dl_paint_unittests.cc
../../../flutter/display_list/dl_vertices_unittests.cc
../../../flutter/display_list/effects/dl_color_filter_unittests.cc
../../../flutter/display_list/effects/dl_color_source_unittests.cc
../../../flutter/display_list/effects/dl_image_filter_unittests.cc
../../../flutter/display_list/effects/dl_mask_filter_unittests.cc
../../../flutter/display_list/effects/dl_path_effect_unittests.cc
../../../flutter/display_list/geometry/dl_region_unittests.cc
../../../flutter/display_list/geometry/dl_rtree_unittests.cc
../../../flutter/display_list/skia/dl_sk_conversions_unittests.cc
../../../flutter/display_list/skia/dl_sk_paint_dispatcher_unittests.cc
../../../flutter/display_list/testing
../../../flutter/display_list/utils/dl_matrix_clip_tracker_unittests.cc
../../../flutter/docs
../../../flutter/examples
../../../flutter/flow/README.md
../../../flutter/flow/diff_context_unittests.cc
../../../flutter/flow/embedded_view_params_unittests.cc
../../../flutter/flow/flow_run_all_unittests.cc
../../../flutter/flow/frame_timings_recorder_unittests.cc
../../../flutter/flow/gl_context_switch_unittests.cc
../../../flutter/flow/layers/backdrop_filter_layer_unittests.cc
../../../flutter/flow/layers/checkerboard_layertree_unittests.cc
../../../flutter/flow/layers/clip_path_layer_unittests.cc
../../../flutter/flow/layers/clip_rect_layer_unittests.cc
../../../flutter/flow/layers/clip_rrect_layer_unittests.cc
../../../flutter/flow/layers/color_filter_layer_unittests.cc
../../../flutter/flow/layers/container_layer_unittests.cc
../../../flutter/flow/layers/display_list_layer_unittests.cc
../../../flutter/flow/layers/image_filter_layer_unittests.cc
../../../flutter/flow/layers/layer_state_stack_unittests.cc
../../../flutter/flow/layers/layer_tree_unittests.cc
../../../flutter/flow/layers/offscreen_surface_unittests.cc
../../../flutter/flow/layers/opacity_layer_unittests.cc
../../../flutter/flow/layers/performance_overlay_layer_unittests.cc
../../../flutter/flow/layers/platform_view_layer_unittests.cc
../../../flutter/flow/layers/shader_mask_layer_unittests.cc
../../../flutter/flow/layers/texture_layer_unittests.cc
../../../flutter/flow/layers/transform_layer_unittests.cc
../../../flutter/flow/mutators_stack_unittests.cc
../../../flutter/flow/raster_cache_unittests.cc
../../../flutter/flow/skia_gpu_object_unittests.cc
../../../flutter/flow/stopwatch_dl_unittests.cc
../../../flutter/flow/stopwatch_unittests.cc
../../../flutter/flow/surface_frame_unittests.cc
../../../flutter/flow/testing
../../../flutter/flow/texture_unittests.cc
../../../flutter/flutter_frontend_server
../../../flutter/fml/ascii_trie_unittests.cc
../../../flutter/fml/backtrace_unittests.cc
../../../flutter/fml/base32_unittest.cc
../../../flutter/fml/closure_unittests.cc
../../../flutter/fml/command_line_unittest.cc
../../../flutter/fml/container_unittests.cc
../../../flutter/fml/cpu_affinity_unittests.cc
../../../flutter/fml/endianness_unittests.cc
../../../flutter/fml/file_unittest.cc
../../../flutter/fml/hash_combine_unittests.cc
../../../flutter/fml/hex_codec_unittest.cc
../../../flutter/fml/logging_unittests.cc
../../../flutter/fml/mapping_unittests.cc
../../../flutter/fml/math_unittests.cc
../../../flutter/fml/memory/ref_counted_unittest.cc
../../../flutter/fml/memory/task_runner_checker_unittest.cc
../../../flutter/fml/memory/weak_ptr_unittest.cc
../../../flutter/fml/message_loop_task_queues_merge_unmerge_unittests.cc
../../../flutter/fml/message_loop_task_queues_unittests.cc
../../../flutter/fml/message_loop_unittests.cc
../../../flutter/fml/paths_unittests.cc
../../../flutter/fml/platform/darwin/cf_utils_unittests.mm
../../../flutter/fml/platform/darwin/scoped_nsobject_arc_unittests.mm
../../../flutter/fml/platform/darwin/scoped_nsobject_unittests.mm
../../../flutter/fml/platform/darwin/string_range_sanitization_unittests.mm
../../../flutter/fml/platform/darwin/weak_nsobject_arc_unittests.mm
../../../flutter/fml/platform/darwin/weak_nsobject_unittests.mm
../../../flutter/fml/platform/fuchsia/log_interest_listener_unittests.cc
../../../flutter/fml/platform/win/file_win_unittests.cc
../../../flutter/fml/platform/win/wstring_conversion_unittests.cc
../../../flutter/fml/raster_thread_merger_unittests.cc
../../../flutter/fml/string_conversion_unittests.cc
../../../flutter/fml/synchronization/count_down_latch_unittests.cc
../../../flutter/fml/synchronization/semaphore_unittest.cc
../../../flutter/fml/synchronization/sync_switch_unittest.cc
../../../flutter/fml/synchronization/waitable_event_unittest.cc
../../../flutter/fml/task_source_unittests.cc
../../../flutter/fml/thread_unittests.cc
../../../flutter/fml/time/time_delta_unittest.cc
../../../flutter/fml/time/time_point_unittest.cc
../../../flutter/fml/time/time_unittest.cc
../../../flutter/impeller/.clang-format
../../../flutter/impeller/.gitignore
../../../flutter/impeller/README.md
../../../flutter/impeller/aiks/aiks_blur_unittests.cc
../../../flutter/impeller/aiks/aiks_gradient_unittests.cc
../../../flutter/impeller/aiks/aiks_path_unittests.cc
../../../flutter/impeller/aiks/aiks_unittests.cc
../../../flutter/impeller/aiks/aiks_unittests.h
../../../flutter/impeller/aiks/canvas_recorder_unittests.cc
../../../flutter/impeller/aiks/canvas_unittests.cc
../../../flutter/impeller/aiks/testing
../../../flutter/impeller/aiks/trace_serializer_unittests.cc
../../../flutter/impeller/base/README.md
../../../flutter/impeller/base/base_unittests.cc
../../../flutter/impeller/compiler/README.md
../../../flutter/impeller/compiler/compiler_unittests.cc
../../../flutter/impeller/compiler/shader_bundle_unittests.cc
../../../flutter/impeller/compiler/switches_unittests.cc
../../../flutter/impeller/core/allocator_unittests.cc
../../../flutter/impeller/display_list/dl_unittests.cc
../../../flutter/impeller/display_list/skia_conversions_unittests.cc
../../../flutter/impeller/docs
../../../flutter/impeller/entity/contents/checkerboard_contents_unittests.cc
../../../flutter/impeller/entity/contents/content_context_unittests.cc
../../../flutter/impeller/entity/contents/filters/gaussian_blur_filter_contents_unittests.cc
../../../flutter/impeller/entity/contents/filters/inputs/filter_input_unittests.cc
../../../flutter/impeller/entity/contents/host_buffer_unittests.cc
../../../flutter/impeller/entity/contents/test
../../../flutter/impeller/entity/contents/tiled_texture_contents_unittests.cc
../../../flutter/impeller/entity/contents/vertices_contents_unittests.cc
../../../flutter/impeller/entity/entity_pass_target_unittests.cc
../../../flutter/impeller/entity/entity_unittests.cc
../../../flutter/impeller/entity/geometry/geometry_unittests.cc
../../../flutter/impeller/entity/render_target_cache_unittests.cc
../../../flutter/impeller/fixtures
../../../flutter/impeller/geometry/README.md
../../../flutter/impeller/geometry/geometry_unittests.cc
../../../flutter/impeller/geometry/matrix_unittests.cc
../../../flutter/impeller/geometry/path_unittests.cc
../../../flutter/impeller/geometry/rect_unittests.cc
../../../flutter/impeller/geometry/saturated_math_unittests.cc
../../../flutter/impeller/geometry/size_unittests.cc
../../../flutter/impeller/geometry/trig_unittests.cc
../../../flutter/impeller/golden_tests/README.md
../../../flutter/impeller/playground
../../../flutter/impeller/renderer/backend/gles/test
../../../flutter/impeller/renderer/backend/metal/texture_mtl_unittests.mm
../../../flutter/impeller/renderer/backend/vulkan/allocator_vk_unittests.cc
../../../flutter/impeller/renderer/backend/vulkan/blit_command_vk_unittests.cc
../../../flutter/impeller/renderer/backend/vulkan/command_encoder_vk_unittests.cc
../../../flutter/impeller/renderer/backend/vulkan/command_pool_vk_unittests.cc
../../../flutter/impeller/renderer/backend/vulkan/context_vk_unittests.cc
../../../flutter/impeller/renderer/backend/vulkan/descriptor_pool_vk_unittests.cc
../../../flutter/impeller/renderer/backend/vulkan/driver_info_vk_unittests.cc
../../../flutter/impeller/renderer/backend/vulkan/fence_waiter_vk_unittests.cc
../../../flutter/impeller/renderer/backend/vulkan/render_pass_cache_unittests.cc
../../../flutter/impeller/renderer/backend/vulkan/resource_manager_vk_unittests.cc
../../../flutter/impeller/renderer/backend/vulkan/swapchain/README.md
../../../flutter/impeller/renderer/backend/vulkan/swapchain/khr/README.md
../../../flutter/impeller/renderer/backend/vulkan/test
../../../flutter/impeller/renderer/blit_pass_unittests.cc
../../../flutter/impeller/renderer/capabilities_unittests.cc
../../../flutter/impeller/renderer/compute_subgroup_unittests.cc
../../../flutter/impeller/renderer/compute_unittests.cc
../../../flutter/impeller/renderer/device_buffer_unittests.cc
../../../flutter/impeller/renderer/pipeline_descriptor_unittests.cc
../../../flutter/impeller/renderer/pool_unittests.cc
../../../flutter/impeller/renderer/renderer_dart_unittests.cc
../../../flutter/impeller/renderer/renderer_unittests.cc
../../../flutter/impeller/renderer/testing
../../../flutter/impeller/runtime_stage/runtime_stage_unittests.cc
../../../flutter/impeller/scene/README.md
../../../flutter/impeller/scene/importer/importer_unittests.cc
../../../flutter/impeller/scene/scene_unittests.cc
../../../flutter/impeller/shader_archive/shader_archive_unittests.cc
../../../flutter/impeller/tessellator/dart/.dart_tool
../../../flutter/impeller/tessellator/dart/pubspec.lock
../../../flutter/impeller/tessellator/dart/pubspec.yaml
../../../flutter/impeller/tessellator/tessellator_unittests.cc
../../../flutter/impeller/toolkit/android/README.md
../../../flutter/impeller/toolkit/android/toolkit_android_unittests.cc
../../../flutter/impeller/tools/build_metal_library.py
../../../flutter/impeller/tools/check_licenses.py
../../../flutter/impeller/tools/malioc_cores.py
../../../flutter/impeller/tools/malioc_diff.py
../../../flutter/impeller/tools/xxd.py
../../../flutter/impeller/typographer/typographer_unittests.cc
../../../flutter/lib/gpu/analysis_options.yaml
../../../flutter/lib/gpu/pubspec.yaml
../../../flutter/lib/snapshot/libraries.json
../../../flutter/lib/snapshot/libraries.yaml
../../../flutter/lib/snapshot/pubspec.yaml
../../../flutter/lib/ui/analysis_options.yaml
../../../flutter/lib/ui/compositing/scene_builder_unittests.cc
../../../flutter/lib/ui/fixtures
../../../flutter/lib/ui/hooks_unittests.cc
../../../flutter/lib/ui/painting/image_decoder_no_gl_unittests.cc
../../../flutter/lib/ui/painting/image_decoder_no_gl_unittests.h
../../../flutter/lib/ui/painting/image_decoder_unittests.cc
../../../flutter/lib/ui/painting/image_dispose_unittests.cc
../../../flutter/lib/ui/painting/image_encoding_unittests.cc
../../../flutter/lib/ui/painting/image_generator_registry_unittests.cc
../../../flutter/lib/ui/painting/paint_unittests.cc
../../../flutter/lib/ui/painting/path_unittests.cc
../../../flutter/lib/ui/painting/single_frame_codec_unittests.cc
../../../flutter/lib/ui/semantics/semantics_update_builder_unittests.cc
../../../flutter/lib/ui/window/platform_configuration_unittests.cc
../../../flutter/lib/ui/window/platform_message_response_dart_port_unittests.cc
../../../flutter/lib/ui/window/platform_message_response_dart_unittests.cc
../../../flutter/lib/ui/window/pointer_data_packet_converter_unittests.cc
../../../flutter/lib/ui/window/pointer_data_packet_unittests.cc
../../../flutter/lib/web_ui/.gitignore
../../../flutter/lib/web_ui/CODE_CONVENTIONS.md
../../../flutter/lib/web_ui/README.md
../../../flutter/lib/web_ui/analysis_options.yaml
../../../flutter/lib/web_ui/dart_test_chrome.yaml
../../../flutter/lib/web_ui/dart_test_edge.yaml
../../../flutter/lib/web_ui/dart_test_firefox.yaml
../../../flutter/lib/web_ui/dart_test_safari.yaml
../../../flutter/lib/web_ui/dev
../../../flutter/lib/web_ui/pubspec.yaml
../../../flutter/lib/web_ui/test
../../../flutter/prebuilts
../../../flutter/runtime/dart_isolate_unittests.cc
../../../flutter/runtime/dart_lifecycle_unittests.cc
../../../flutter/runtime/dart_plugin_registrant_unittests.cc
../../../flutter/runtime/dart_service_isolate_unittests.cc
../../../flutter/runtime/dart_vm_unittests.cc
../../../flutter/runtime/fixtures
../../../flutter/runtime/no_dart_plugin_registrant_unittests.cc
../../../flutter/runtime/platform_isolate_manager_unittests.cc
../../../flutter/runtime/type_conversions_unittests.cc
../../../flutter/shell/common/animator_unittests.cc
../../../flutter/shell/common/base64_unittests.cc
../../../flutter/shell/common/context_options_unittests.cc
../../../flutter/shell/common/dl_op_spy_unittests.cc
../../../flutter/shell/common/engine_animator_unittests.cc
../../../flutter/shell/common/engine_unittests.cc
../../../flutter/shell/common/fixtures
../../../flutter/shell/common/input_events_unittests.cc
../../../flutter/shell/common/persistent_cache_unittests.cc
../../../flutter/shell/common/pipeline_unittests.cc
../../../flutter/shell/common/rasterizer_unittests.cc
../../../flutter/shell/common/resource_cache_limit_calculator_unittests.cc
../../../flutter/shell/common/shell_fuchsia_unittests.cc
../../../flutter/shell/common/shell_io_manager_unittests.cc
../../../flutter/shell/common/shell_unittests.cc
../../../flutter/shell/common/switches_unittests.cc
../../../flutter/shell/common/variable_refresh_rate_display_unittests.cc
../../../flutter/shell/common/vsync_waiter_unittests.cc
../../../flutter/shell/gpu/gpu_surface_metal_impeller_unittests.mm
../../../flutter/shell/platform/android/.gitignore
../../../flutter/shell/platform/android/README.md
../../../flutter/shell/platform/android/android_context_gl_impeller_unittests.cc
../../../flutter/shell/platform/android/android_context_gl_unittests.cc
../../../flutter/shell/platform/android/android_shell_holder_unittests.cc
../../../flutter/shell/platform/android/apk_asset_provider_unittests.cc
../../../flutter/shell/platform/android/build.gradle
../../../flutter/shell/platform/android/external_view_embedder/external_view_embedder_unittests.cc
../../../flutter/shell/platform/android/external_view_embedder/surface_pool_unittests.cc
../../../flutter/shell/platform/android/flutter_shell_native_unittests.cc
../../../flutter/shell/platform/android/gradle.properties
../../../flutter/shell/platform/android/image_lru_unittests.cc
../../../flutter/shell/platform/android/jni/jni_mock_unittest.cc
../../../flutter/shell/platform/android/platform_view_android_delegate/platform_view_android_delegate_unittests.cc
../../../flutter/shell/platform/android/platform_view_android_unittests.cc
../../../flutter/shell/platform/android/test
../../../flutter/shell/platform/android/test_runner
../../../flutter/shell/platform/common/accessibility_bridge_unittests.cc
../../../flutter/shell/platform/common/client_wrapper/README
../../../flutter/shell/platform/common/client_wrapper/basic_message_channel_unittests.cc
../../../flutter/shell/platform/common/client_wrapper/encodable_value_unittests.cc
../../../flutter/shell/platform/common/client_wrapper/event_channel_unittests.cc
../../../flutter/shell/platform/common/client_wrapper/method_call_unittests.cc
../../../flutter/shell/platform/common/client_wrapper/method_channel_unittests.cc
../../../flutter/shell/platform/common/client_wrapper/method_result_functions_unittests.cc
../../../flutter/shell/platform/common/client_wrapper/plugin_registrar_unittests.cc
../../../flutter/shell/platform/common/client_wrapper/standard_message_codec_unittests.cc
../../../flutter/shell/platform/common/client_wrapper/standard_method_codec_unittests.cc
../../../flutter/shell/platform/common/client_wrapper/testing
../../../flutter/shell/platform/common/client_wrapper/texture_registrar_unittests.cc
../../../flutter/shell/platform/common/engine_switches_unittests.cc
../../../flutter/shell/platform/common/flutter_platform_node_delegate_unittests.cc
../../../flutter/shell/platform/common/geometry_unittests.cc
../../../flutter/shell/platform/common/incoming_message_dispatcher_unittests.cc
../../../flutter/shell/platform/common/json_message_codec_unittests.cc
../../../flutter/shell/platform/common/json_method_codec_unittests.cc
../../../flutter/shell/platform/common/path_utils_unittests.cc
../../../flutter/shell/platform/common/text_editing_delta_unittests.cc
../../../flutter/shell/platform/common/text_input_model_unittests.cc
../../../flutter/shell/platform/common/text_range_unittests.cc
../../../flutter/shell/platform/darwin/Doxyfile
../../../flutter/shell/platform/darwin/common/availability_version_check_unittests.cc
../../../flutter/shell/platform/darwin/common/framework/Source/flutter_codecs_unittest.mm
../../../flutter/shell/platform/darwin/common/framework/Source/flutter_standard_codec_unittest.mm
../../../flutter/shell/platform/darwin/macos/README.md
../../../flutter/shell/platform/darwin/macos/framework/Source/fixtures
../../../flutter/shell/platform/embedder/fixtures
../../../flutter/shell/platform/embedder/platform_view_embedder_unittests.cc
../../../flutter/shell/platform/embedder/tests
../../../flutter/shell/platform/fuchsia/dart-pkg/fuchsia/README.md
../../../flutter/shell/platform/fuchsia/dart-pkg/fuchsia/analysis_options.yaml
../../../flutter/shell/platform/fuchsia/dart-pkg/fuchsia/pubspec.yaml
../../../flutter/shell/platform/fuchsia/dart-pkg/zircon/README.md
../../../flutter/shell/platform/fuchsia/dart-pkg/zircon/analysis_options.yaml
../../../flutter/shell/platform/fuchsia/dart-pkg/zircon/pubspec.yaml
../../../flutter/shell/platform/fuchsia/dart-pkg/zircon/test
../../../flutter/shell/platform/fuchsia/dart-pkg/zircon_ffi/pubspec.yaml
../../../flutter/shell/platform/fuchsia/dart_runner/.gitignore
../../../flutter/shell/platform/fuchsia/dart_runner/README.md
../../../flutter/shell/platform/fuchsia/dart_runner/embedder/pubspec.yaml
../../../flutter/shell/platform/fuchsia/dart_runner/kernel/libraries.json
../../../flutter/shell/platform/fuchsia/dart_runner/kernel/libraries.yaml
../../../flutter/shell/platform/fuchsia/dart_runner/tests
../../../flutter/shell/platform/fuchsia/dart_runner/vmservice/analysis_options.yaml
../../../flutter/shell/platform/fuchsia/dart_runner/vmservice/pubspec.yaml
../../../flutter/shell/platform/fuchsia/flutter/README.md
../../../flutter/shell/platform/fuchsia/flutter/accessibility_bridge_unittest.cc
../../../flutter/shell/platform/fuchsia/flutter/build/asset_package.py
../../../flutter/shell/platform/fuchsia/flutter/build/gen_debug_wrapper_main.py
../../../flutter/shell/platform/fuchsia/flutter/canvas_spy_unittests.cc
../../../flutter/shell/platform/fuchsia/flutter/component_v2_unittest.cc
../../../flutter/shell/platform/fuchsia/flutter/focus_delegate_unittests.cc
../../../flutter/shell/platform/fuchsia/flutter/fuchsia_intl_unittest.cc
../../../flutter/shell/platform/fuchsia/flutter/kernel/analysis_options.yaml
../../../flutter/shell/platform/fuchsia/flutter/kernel/libraries.json
../../../flutter/shell/platform/fuchsia/flutter/kernel/libraries.yaml
../../../flutter/shell/platform/fuchsia/flutter/kernel/pubspec.yaml
../../../flutter/shell/platform/fuchsia/flutter/keyboard_unittest.cc
../../../flutter/shell/platform/fuchsia/flutter/pointer_delegate_unittests.cc
../../../flutter/shell/platform/fuchsia/flutter/pointer_injector_delegate_unittest.cc
../../../flutter/shell/platform/fuchsia/flutter/rtree_unittests.cc
../../../flutter/shell/platform/fuchsia/flutter/runner_tzdata_missing_unittest.cc
../../../flutter/shell/platform/fuchsia/flutter/runner_tzdata_unittest.cc
../../../flutter/shell/platform/fuchsia/flutter/tests
../../../flutter/shell/platform/fuchsia/flutter/text_delegate_unittests.cc
../../../flutter/shell/platform/fuchsia/flutter/vsync_waiter_unittest.cc
../../../flutter/shell/platform/fuchsia/runtime/dart/profiler_symbols/analysis_options.yaml
../../../flutter/shell/platform/fuchsia/runtime/dart/profiler_symbols/pubspec.yaml
../../../flutter/shell/platform/fuchsia/runtime/dart/utils/build_info_unittests.cc
../../../flutter/shell/platform/fuchsia/unit_tests.md
../../../flutter/shell/platform/glfw/client_wrapper/flutter_engine_unittests.cc
../../../flutter/shell/platform/glfw/client_wrapper/flutter_window_controller_unittests.cc
../../../flutter/shell/platform/glfw/client_wrapper/flutter_window_unittests.cc
../../../flutter/shell/platform/glfw/client_wrapper/plugin_registrar_glfw_unittests.cc
../../../flutter/shell/platform/glfw/client_wrapper/testing
../../../flutter/shell/platform/linux/testing
../../../flutter/shell/platform/windows/README.md
../../../flutter/shell/platform/windows/accessibility_bridge_windows_unittests.cc
../../../flutter/shell/platform/windows/client_wrapper/dart_project_unittests.cc
../../../flutter/shell/platform/windows/client_wrapper/flutter_engine_unittests.cc
../../../flutter/shell/platform/windows/client_wrapper/flutter_view_controller_unittests.cc
../../../flutter/shell/platform/windows/client_wrapper/flutter_view_unittests.cc
../../../flutter/shell/platform/windows/client_wrapper/plugin_registrar_windows_unittests.cc
../../../flutter/shell/platform/windows/client_wrapper/testing
../../../flutter/shell/platform/windows/compositor_opengl_unittests.cc
../../../flutter/shell/platform/windows/compositor_software_unittests.cc
../../../flutter/shell/platform/windows/cursor_handler_unittests.cc
../../../flutter/shell/platform/windows/direct_manipulation_unittests.cc
../../../flutter/shell/platform/windows/dpi_utils_unittests.cc
../../../flutter/shell/platform/windows/fixtures
../../../flutter/shell/platform/windows/flutter_project_bundle_unittests.cc
../../../flutter/shell/platform/windows/flutter_window_unittests.cc
../../../flutter/shell/platform/windows/flutter_windows_engine_unittests.cc
../../../flutter/shell/platform/windows/flutter_windows_texture_registrar_unittests.cc
../../../flutter/shell/platform/windows/flutter_windows_unittests.cc
../../../flutter/shell/platform/windows/flutter_windows_view_unittests.cc
../../../flutter/shell/platform/windows/keyboard_key_channel_handler_unittests.cc
../../../flutter/shell/platform/windows/keyboard_key_embedder_handler_unittests.cc
../../../flutter/shell/platform/windows/keyboard_key_handler_unittests.cc
../../../flutter/shell/platform/windows/keyboard_unittests.cc
../../../flutter/shell/platform/windows/keyboard_utils_unittests.cc
../../../flutter/shell/platform/windows/platform_handler_unittests.cc
../../../flutter/shell/platform/windows/sequential_id_generator_unittests.cc
../../../flutter/shell/platform/windows/settings_plugin_unittests.cc
../../../flutter/shell/platform/windows/system_utils_unittests.cc
../../../flutter/shell/platform/windows/task_runner_unittests.cc
../../../flutter/shell/platform/windows/testing
../../../flutter/shell/platform/windows/text_input_plugin_unittest.cc
../../../flutter/shell/platform/windows/window_proc_delegate_manager_unittests.cc
../../../flutter/shell/platform/windows/window_unittests.cc
../../../flutter/shell/platform/windows/windows_lifecycle_manager_unittests.cc
../../../flutter/shell/profiling/sampling_profiler_unittest.cc
../../../flutter/shell/testing
../../../flutter/shell/vmservice/.dart_tool
../../../flutter/shell/vmservice/pubspec.lock
../../../flutter/shell/vmservice/pubspec.yaml
../../../flutter/sky/packages/sky_engine/.gitignore
../../../flutter/sky/packages/sky_engine/LICENSE
../../../flutter/sky/packages/sky_engine/README.md
../../../flutter/sky/packages/sky_engine/lib/_embedder.yaml
../../../flutter/sky/packages/sky_engine/pubspec.yaml
../../../flutter/sky/tools/create_embedder_framework.py
../../../flutter/sky/tools/create_full_ios_framework.py
../../../flutter/sky/tools/create_ios_framework.py
../../../flutter/sky/tools/create_macos_framework.py
../../../flutter/sky/tools/create_macos_gen_snapshots.py
../../../flutter/sky/tools/create_xcframework.py
../../../flutter/sky/tools/dist_dart_pkg.py
../../../flutter/sky/tools/install_framework_headers.py
../../../flutter/testing
../../../flutter/third_party/.clang-tidy
../../../flutter/third_party/.gitignore
../../../flutter/third_party/README.md
../../../flutter/third_party/abseil-cpp/.git
../../../flutter/third_party/abseil-cpp/.github
../../../flutter/third_party/abseil-cpp/ABSEIL_ISSUE_TEMPLATE.md
../../../flutter/third_party/abseil-cpp/AUTHORS
../../../flutter/third_party/abseil-cpp/BUILD.bazel
../../../flutter/third_party/abseil-cpp/CMake
../../../flutter/third_party/abseil-cpp/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/CONTRIBUTING.md
../../../flutter/third_party/abseil-cpp/DIR_METADATA
../../../flutter/third_party/abseil-cpp/FAQ.md
../../../flutter/third_party/abseil-cpp/OWNERS
../../../flutter/third_party/abseil-cpp/README.chromium
../../../flutter/third_party/abseil-cpp/README.md
../../../flutter/third_party/abseil-cpp/UPGRADES.md
../../../flutter/third_party/abseil-cpp/WORKSPACE
../../../flutter/third_party/abseil-cpp/absl/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/abseil.podspec.gen.py
../../../flutter/third_party/abseil-cpp/absl/algorithm/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/algorithm/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/algorithm/algorithm_test.cc
../../../flutter/third_party/abseil-cpp/absl/algorithm/container_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/base/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/base/bit_cast_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/call_once_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/config_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/exception_safety_testing_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/inline_variable_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/internal/atomic_hook_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/internal/cmake_thread_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/internal/endian_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/internal/errno_saver_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/internal/fast_type_id_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/internal/low_level_alloc_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/internal/scoped_set_env_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/internal/strerror_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/internal/sysinfo_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/internal/thread_identity_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/internal/unique_small_name_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/invoke_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/log_severity_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/no_destructor_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/nullability_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/optimization_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/prefetch_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/raw_logging_test.cc
../../../flutter/third_party/abseil-cpp/absl/base/throw_delegate_test.cc
../../../flutter/third_party/abseil-cpp/absl/cleanup/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/cleanup/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/cleanup/cleanup_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/container/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/container/btree_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/btree_test.h
../../../flutter/third_party/abseil-cpp/absl/container/fixed_array_exception_safety_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/fixed_array_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/flat_hash_map_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/flat_hash_set_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/inlined_vector_exception_safety_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/inlined_vector_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/internal/common_policy_traits_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/internal/compressed_tuple_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/internal/container_memory_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/internal/hash_function_defaults_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/internal/hash_policy_testing_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/internal/hash_policy_traits_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/internal/layout_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/internal/node_slot_policy_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/internal/raw_hash_set_allocator_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/internal/raw_hash_set_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/internal/test_instance_tracker_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/internal/unordered_map_constructor_test.h
../../../flutter/third_party/abseil-cpp/absl/container/internal/unordered_map_lookup_test.h
../../../flutter/third_party/abseil-cpp/absl/container/internal/unordered_map_members_test.h
../../../flutter/third_party/abseil-cpp/absl/container/internal/unordered_map_modifiers_test.h
../../../flutter/third_party/abseil-cpp/absl/container/internal/unordered_map_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/internal/unordered_set_constructor_test.h
../../../flutter/third_party/abseil-cpp/absl/container/internal/unordered_set_lookup_test.h
../../../flutter/third_party/abseil-cpp/absl/container/internal/unordered_set_members_test.h
../../../flutter/third_party/abseil-cpp/absl/container/internal/unordered_set_modifiers_test.h
../../../flutter/third_party/abseil-cpp/absl/container/internal/unordered_set_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/node_hash_map_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/node_hash_set_test.cc
../../../flutter/third_party/abseil-cpp/absl/container/sample_element_size_test.cc
../../../flutter/third_party/abseil-cpp/absl/copts/AbseilConfigureCopts.cmake
../../../flutter/third_party/abseil-cpp/absl/copts/GENERATED_AbseilCopts.cmake
../../../flutter/third_party/abseil-cpp/absl/copts/GENERATED_copts.bzl
../../../flutter/third_party/abseil-cpp/absl/copts/configure_copts.bzl
../../../flutter/third_party/abseil-cpp/absl/copts/copts.py
../../../flutter/third_party/abseil-cpp/absl/copts/generate_copts.py
../../../flutter/third_party/abseil-cpp/absl/crc/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/crc/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/crc/crc32c_test.cc
../../../flutter/third_party/abseil-cpp/absl/crc/internal/crc_cord_state_test.cc
../../../flutter/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_test.cc
../../../flutter/third_party/abseil-cpp/absl/crc/internal/non_temporal_memcpy_test.cc
../../../flutter/third_party/abseil-cpp/absl/debugging/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/debugging/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/debugging/failure_signal_handler_test.cc
../../../flutter/third_party/abseil-cpp/absl/debugging/internal/demangle_test.cc
../../../flutter/third_party/abseil-cpp/absl/debugging/internal/stack_consumption_test.cc
../../../flutter/third_party/abseil-cpp/absl/debugging/leak_check_fail_test.cc
../../../flutter/third_party/abseil-cpp/absl/debugging/leak_check_test.cc
../../../flutter/third_party/abseil-cpp/absl/debugging/stacktrace_test.cc
../../../flutter/third_party/abseil-cpp/absl/debugging/symbolize_test.cc
../../../flutter/third_party/abseil-cpp/absl/flags/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/flags/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/flags/commandlineflag_test.cc
../../../flutter/third_party/abseil-cpp/absl/flags/config_test.cc
../../../flutter/third_party/abseil-cpp/absl/flags/flag_test.cc
../../../flutter/third_party/abseil-cpp/absl/flags/internal/path_util_test.cc
../../../flutter/third_party/abseil-cpp/absl/flags/internal/program_name_test.cc
../../../flutter/third_party/abseil-cpp/absl/flags/internal/sequence_lock_test.cc
../../../flutter/third_party/abseil-cpp/absl/flags/internal/usage_test.cc
../../../flutter/third_party/abseil-cpp/absl/flags/marshalling_test.cc
../../../flutter/third_party/abseil-cpp/absl/flags/parse_test.cc
../../../flutter/third_party/abseil-cpp/absl/flags/reflection_test.cc
../../../flutter/third_party/abseil-cpp/absl/flags/usage_config_test.cc
../../../flutter/third_party/abseil-cpp/absl/functional/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/functional/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/functional/any_invocable_test.cc
../../../flutter/third_party/abseil-cpp/absl/functional/bind_front_test.cc
../../../flutter/third_party/abseil-cpp/absl/functional/function_ref_test.cc
../../../flutter/third_party/abseil-cpp/absl/functional/overload_test.cc
../../../flutter/third_party/abseil-cpp/absl/hash/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/hash/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/hash/hash_instantiated_test.cc
../../../flutter/third_party/abseil-cpp/absl/hash/hash_test.cc
../../../flutter/third_party/abseil-cpp/absl/hash/internal/city_test.cc
../../../flutter/third_party/abseil-cpp/absl/hash/internal/hash_test.h
../../../flutter/third_party/abseil-cpp/absl/hash/internal/low_level_hash_test.cc
../../../flutter/third_party/abseil-cpp/absl/log/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/log/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/log/absl_check_test.cc
../../../flutter/third_party/abseil-cpp/absl/log/absl_log_basic_test.cc
../../../flutter/third_party/abseil-cpp/absl/log/check_test.cc
../../../flutter/third_party/abseil-cpp/absl/log/die_if_null_test.cc
../../../flutter/third_party/abseil-cpp/absl/log/flags_test.cc
../../../flutter/third_party/abseil-cpp/absl/log/globals_test.cc
../../../flutter/third_party/abseil-cpp/absl/log/internal/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/log/internal/fnmatch_test.cc
../../../flutter/third_party/abseil-cpp/absl/log/internal/stderr_log_sink_test.cc
../../../flutter/third_party/abseil-cpp/absl/log/log_basic_test.cc
../../../flutter/third_party/abseil-cpp/absl/log/log_entry_test.cc
../../../flutter/third_party/abseil-cpp/absl/log/log_format_test.cc
../../../flutter/third_party/abseil-cpp/absl/log/log_macro_hygiene_test.cc
../../../flutter/third_party/abseil-cpp/absl/log/log_modifier_methods_test.cc
../../../flutter/third_party/abseil-cpp/absl/log/log_sink_test.cc
../../../flutter/third_party/abseil-cpp/absl/log/log_streamer_test.cc
../../../flutter/third_party/abseil-cpp/absl/log/scoped_mock_log_test.cc
../../../flutter/third_party/abseil-cpp/absl/log/stripping_test.cc
../../../flutter/third_party/abseil-cpp/absl/log/structured_test.cc
../../../flutter/third_party/abseil-cpp/absl/log/vlog_is_on_test.cc
../../../flutter/third_party/abseil-cpp/absl/memory/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/memory/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/memory/memory_test.cc
../../../flutter/third_party/abseil-cpp/absl/meta/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/meta/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/meta/type_traits_test.cc
../../../flutter/third_party/abseil-cpp/absl/numeric/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/numeric/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/numeric/bits_test.cc
../../../flutter/third_party/abseil-cpp/absl/numeric/int128_stream_test.cc
../../../flutter/third_party/abseil-cpp/absl/numeric/int128_test.cc
../../../flutter/third_party/abseil-cpp/absl/profiling/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/profiling/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/profiling/internal/exponential_biased_test.cc
../../../flutter/third_party/abseil-cpp/absl/profiling/internal/periodic_sampler_test.cc
../../../flutter/third_party/abseil-cpp/absl/profiling/internal/sample_recorder_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/random/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/random/bernoulli_distribution_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/beta_distribution_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/bit_gen_ref_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/discrete_distribution_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/distributions_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/examples_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/exponential_distribution_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/gaussian_distribution_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/generators_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/internal/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/random/internal/chi_square_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/internal/distribution_test_util_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/internal/explicit_seed_seq_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/internal/fastmath_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/internal/generate_real_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/internal/iostream_state_saver_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/internal/nanobenchmark_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/internal/nonsecure_base_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/internal/pcg_engine_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/internal/pool_urbg_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/internal/randen_engine_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/internal/randen_hwaes_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/internal/randen_slow_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/internal/randen_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/internal/salted_seed_seq_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/internal/seed_material_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/internal/traits_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/internal/uniform_helper_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/internal/wide_multiply_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/log_uniform_int_distribution_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/mock_distributions_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/mocking_bit_gen_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/poisson_distribution_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/seed_sequences_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/uniform_int_distribution_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/uniform_real_distribution_test.cc
../../../flutter/third_party/abseil-cpp/absl/random/zipf_distribution_test.cc
../../../flutter/third_party/abseil-cpp/absl/status/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/status/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/status/status_test.cc
../../../flutter/third_party/abseil-cpp/absl/status/statusor_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/strings/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/strings/ascii_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/atod_manual_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/char_formatting_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/charconv_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/charset_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/cord_buffer_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/cord_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/cordz_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/escaping_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/has_absl_stringify_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/has_ostream_operator_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/charconv_bigint_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/charconv_parse_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/cord_data_edge_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/cordz_functions_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/cordz_handle_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/cordz_info_statistics_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/cordz_info_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/cordz_sample_token_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/cordz_update_scope_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/memutil_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/ostringstream_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/pow10_helper_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/str_format/arg_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/str_format/bind_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/str_format/checker_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/str_format/convert_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/str_format/extension_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/str_format/output_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/str_format/parser_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/string_constant_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/internal/utf8_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/match_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/numbers_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/str_cat_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/str_format_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/str_join_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/str_replace_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/str_split_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/string_view_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/strip_test.cc
../../../flutter/third_party/abseil-cpp/absl/strings/substitute_test.cc
../../../flutter/third_party/abseil-cpp/absl/synchronization/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/synchronization/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/synchronization/barrier_test.cc
../../../flutter/third_party/abseil-cpp/absl/synchronization/blocking_counter_test.cc
../../../flutter/third_party/abseil-cpp/absl/synchronization/internal/graphcycles_test.cc
../../../flutter/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout_test.cc
../../../flutter/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem_test.cc
../../../flutter/third_party/abseil-cpp/absl/synchronization/internal/waiter_test.cc
../../../flutter/third_party/abseil-cpp/absl/synchronization/lifetime_test.cc
../../../flutter/third_party/abseil-cpp/absl/synchronization/mutex_method_pointer_test.cc
../../../flutter/third_party/abseil-cpp/absl/synchronization/mutex_test.cc
../../../flutter/third_party/abseil-cpp/absl/synchronization/notification_test.cc
../../../flutter/third_party/abseil-cpp/absl/time/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/time/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/time/civil_time_test.cc
../../../flutter/third_party/abseil-cpp/absl/time/clock_test.cc
../../../flutter/third_party/abseil-cpp/absl/time/duration_test.cc
../../../flutter/third_party/abseil-cpp/absl/time/flag_test.cc
../../../flutter/third_party/abseil-cpp/absl/time/format_test.cc
../../../flutter/third_party/abseil-cpp/absl/time/internal/cctz/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/time/internal/cctz/src/civil_time_test.cc
../../../flutter/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format_test.cc
../../../flutter/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup_test.cc
../../../flutter/third_party/abseil-cpp/absl/time/internal/cctz/testdata
../../../flutter/third_party/abseil-cpp/absl/time/time_test.cc
../../../flutter/third_party/abseil-cpp/absl/time/time_zone_test.cc
../../../flutter/third_party/abseil-cpp/absl/types/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/types/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/types/any_exception_safety_test.cc
../../../flutter/third_party/abseil-cpp/absl/types/any_test.cc
../../../flutter/third_party/abseil-cpp/absl/types/compare_test.cc
../../../flutter/third_party/abseil-cpp/absl/types/optional_exception_safety_test.cc
../../../flutter/third_party/abseil-cpp/absl/types/optional_test.cc
../../../flutter/third_party/abseil-cpp/absl/types/span_test.cc
../../../flutter/third_party/abseil-cpp/absl/types/variant_exception_safety_test.cc
../../../flutter/third_party/abseil-cpp/absl/types/variant_test.cc
../../../flutter/third_party/abseil-cpp/absl/utility/BUILD.bazel
../../../flutter/third_party/abseil-cpp/absl/utility/CMakeLists.txt
../../../flutter/third_party/abseil-cpp/absl/utility/internal/if_constexpr_test.cc
../../../flutter/third_party/abseil-cpp/absl/utility/utility_test.cc
../../../flutter/third_party/abseil-cpp/absl_hardening_test.cc
../../../flutter/third_party/abseil-cpp/conanfile.py
../../../flutter/third_party/abseil-cpp/create_lts.py
../../../flutter/third_party/abseil-cpp/generate_def_files.py
../../../flutter/third_party/abseil-cpp/roll_abseil.py
../../../flutter/third_party/accessibility/README.md
../../../flutter/third_party/accessibility/ax/ax_enum_util_unittest.cc
../../../flutter/third_party/accessibility/ax/ax_event_generator_unittest.cc
../../../flutter/third_party/accessibility/ax/ax_node_data_unittest.cc
../../../flutter/third_party/accessibility/ax/ax_node_position_unittest.cc
../../../flutter/third_party/accessibility/ax/ax_range_unittest.cc
../../../flutter/third_party/accessibility/ax/ax_role_properties_unittest.cc
../../../flutter/third_party/accessibility/ax/ax_table_info_unittest.cc
../../../flutter/third_party/accessibility/ax/ax_tree_unittest.cc
../../../flutter/third_party/accessibility/ax/platform/ax_fragment_root_win_unittest.cc
../../../flutter/third_party/accessibility/ax/platform/ax_platform_node_base_unittest.cc
../../../flutter/third_party/accessibility/ax/platform/ax_platform_node_mac_unittest.h
../../../flutter/third_party/accessibility/ax/platform/ax_platform_node_mac_unittest.mm
../../../flutter/third_party/accessibility/ax/platform/ax_platform_node_textprovider_win_unittest.cc
../../../flutter/third_party/accessibility/ax/platform/ax_platform_node_textrangeprovider_win_unittest.cc
../../../flutter/third_party/accessibility/ax/platform/ax_platform_node_unittest.cc
../../../flutter/third_party/accessibility/ax/platform/ax_platform_node_unittest.h
../../../flutter/third_party/accessibility/ax/platform/ax_platform_node_win_unittest.cc
../../../flutter/third_party/accessibility/ax/platform/ax_platform_node_win_unittest.h
../../../flutter/third_party/accessibility/ax/platform/ax_unique_id_unittest.cc
../../../flutter/third_party/accessibility/base/logging_unittests.cc
../../../flutter/third_party/accessibility/base/numerics/README.md
../../../flutter/third_party/accessibility/base/string_utils_unittest.cc
../../../flutter/third_party/accessibility/base/test
../../../flutter/third_party/accessibility/base/win/display_unittest.cc
../../../flutter/third_party/accessibility/base/win/enum_variant_unittest.cc
../../../flutter/third_party/accessibility/base/win/scoped_bstr_unittest.cc
../../../flutter/third_party/accessibility/base/win/scoped_safearray_unittest.cc
../../../flutter/third_party/accessibility/base/win/scoped_variant_unittest.cc
../../../flutter/third_party/accessibility/base/win/variant_vector_unittest.cc
../../../flutter/third_party/accessibility/gfx/geometry/insets_unittest.cc
../../../flutter/third_party/accessibility/gfx/geometry/point_unittest.cc
../../../flutter/third_party/accessibility/gfx/geometry/rect_unittest.cc
../../../flutter/third_party/accessibility/gfx/geometry/size_unittest.cc
../../../flutter/third_party/accessibility/gfx/geometry/vector2d_unittest.cc
../../../flutter/third_party/accessibility/gfx/range/range_unittest.cc
../../../flutter/third_party/accessibility/gfx/test
../../../flutter/third_party/angle/.clang-format
../../../flutter/third_party/angle/.git
../../../flutter/third_party/angle/.gitattributes
../../../flutter/third_party/angle/.gitignore
../../../flutter/third_party/angle/.gn
../../../flutter/third_party/angle/.style.yapf
../../../flutter/third_party/angle/.vpython
../../../flutter/third_party/angle/.vpython3
../../../flutter/third_party/angle/.yapfignore
../../../flutter/third_party/angle/AUTHORS
../../../flutter/third_party/angle/Android.mk
../../../flutter/third_party/angle/CONTRIBUTORS
../../../flutter/third_party/angle/DEPS
../../../flutter/third_party/angle/DIR_METADATA
../../../flutter/third_party/angle/OWNERS
../../../flutter/third_party/angle/PRESUBMIT.py
../../../flutter/third_party/angle/README.chromium
../../../flutter/third_party/angle/README.md
../../../flutter/third_party/angle/WATCHLISTS
../../../flutter/third_party/angle/additional_readme_paths.json
../../../flutter/third_party/angle/android
../../../flutter/third_party/angle/codereview.settings
../../../flutter/third_party/angle/doc
../../../flutter/third_party/angle/extensions
../../../flutter/third_party/angle/include/CL/.clang-format
../../../flutter/third_party/angle/include/CL/README.md
../../../flutter/third_party/angle/include/EGL/.clang-format
../../../flutter/third_party/angle/include/GLES/.clang-format
../../../flutter/third_party/angle/include/GLES/README.md
../../../flutter/third_party/angle/include/GLES2/.clang-format
../../../flutter/third_party/angle/include/GLES3/.clang-format
../../../flutter/third_party/angle/include/GLX/.clang-format
../../../flutter/third_party/angle/include/KHR/.clang-format
../../../flutter/third_party/angle/include/WGL/.clang-format
../../../flutter/third_party/angle/include/platform/autogen/.clang-format
../../../flutter/third_party/angle/include/platform/gen_features.py
../../../flutter/third_party/angle/infra
../../../flutter/third_party/angle/samples
../../../flutter/third_party/angle/scripts
../../../flutter/third_party/angle/src/commit_id.py
../../../flutter/third_party/angle/src/common/BinaryStream_unittest.cpp
../../../flutter/third_party/angle/src/common/CircularBuffer_unittest.cpp
../../../flutter/third_party/angle/src/common/FastVector_unittest.cpp
../../../flutter/third_party/angle/src/common/FixedQueue_unittest.cpp
../../../flutter/third_party/angle/src/common/FixedVector_unittest.cpp
../../../flutter/third_party/angle/src/common/Float16ToFloat32.py
../../../flutter/third_party/angle/src/common/Optional_unittest.cpp
../../../flutter/third_party/angle/src/common/PoolAlloc_unittest.cpp
../../../flutter/third_party/angle/src/common/WorkerThread_unittest.cpp
../../../flutter/third_party/angle/src/common/aligned_memory_unittest.cpp
../../../flutter/third_party/angle/src/common/angleutils_unittest.cpp
../../../flutter/third_party/angle/src/common/base/README.angle
../../../flutter/third_party/angle/src/common/base/anglebase/numerics/OWNERS
../../../flutter/third_party/angle/src/common/bitset_utils_unittest.cpp
../../../flutter/third_party/angle/src/common/fuchsia_egl/OWNERS
../../../flutter/third_party/angle/src/common/gen_packed_gl_enums.py
../../../flutter/third_party/angle/src/common/gen_uniform_type_table.py
../../../flutter/third_party/angle/src/common/hash_utils_unittest.cpp
../../../flutter/third_party/angle/src/common/mathutil_unittest.cpp
../../../flutter/third_party/angle/src/common/matrix_utils_unittest.cpp
../../../flutter/third_party/angle/src/common/serializer/JsonSerializer_unittest.cpp
../../../flutter/third_party/angle/src/common/spirv/gen_spirv_builder_and_parser.py
../../../flutter/third_party/angle/src/common/string_utils_unittest.cpp
../../../flutter/third_party/angle/src/common/system_utils_unittest.cpp
../../../flutter/third_party/angle/src/common/third_party/xxhash/README.chromium
../../../flutter/third_party/angle/src/common/third_party/xxhash/README.md
../../../flutter/third_party/angle/src/common/utilities_unittest.cpp
../../../flutter/third_party/angle/src/common/vector_utils_unittest.cpp
../../../flutter/third_party/angle/src/compiler/generate_parser_tools.py
../../../flutter/third_party/angle/src/compiler/preprocessor/generate_parser.py
../../../flutter/third_party/angle/src/compiler/translator/gen_builtin_symbols.py
../../../flutter/third_party/angle/src/compiler/translator/generate_parser.py
../../../flutter/third_party/angle/src/compiler/translator/hlsl/gen_emulated_builtin_function_tables.py
../../../flutter/third_party/angle/src/compiler/translator/span_unittest.cpp
../../../flutter/third_party/angle/src/feature_support_util/OWNERS
../../../flutter/third_party/angle/src/feature_support_util/feature_support_util_unittest.cpp
../../../flutter/third_party/angle/src/gpu_info_util/SystemInfo_unittest.cpp
../../../flutter/third_party/angle/src/image_util/AstcDecompressor_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/BlendStateExt_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/BlobCache_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/Config_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/Fence_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/GlobalMutex_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/HandleAllocator_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/ImageIndexIterator_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/Image_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/Observer_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/Program_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/ResourceManager_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/ResourceMap_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/SizedMRUCache_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/Surface_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/TransformFeedback_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/UnlockedTailCall_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/VaryingPacking_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/VertexArray_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/capture/OWNERS
../../../flutter/third_party/angle/src/libANGLE/gen_copy_conversion_table.py
../../../flutter/third_party/angle/src/libANGLE/gen_extensions.py
../../../flutter/third_party/angle/src/libANGLE/gen_format_map.py
../../../flutter/third_party/angle/src/libANGLE/gen_overlay_fonts.py
../../../flutter/third_party/angle/src/libANGLE/gen_overlay_widgets.py
../../../flutter/third_party/angle/src/libANGLE/renderer/README.md
../../../flutter/third_party/angle/src/libANGLE/renderer/angle_format.py
../../../flutter/third_party/angle/src/libANGLE/renderer/d3d/OWNERS
../../../flutter/third_party/angle/src/libANGLE/renderer/d3d/d3d11/FormatTables.md
../../../flutter/third_party/angle/src/libANGLE/renderer/d3d/d3d11/UniformBlockToStructuredBufferTranslation.md
../../../flutter/third_party/angle/src/libANGLE/renderer/d3d/d3d11/gen_blit11helper.py
../../../flutter/third_party/angle/src/libANGLE/renderer/d3d/d3d11/gen_texture_format_table.py
../../../flutter/third_party/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/renderer/gen_angle_format_table.py
../../../flutter/third_party/angle/src/libANGLE/renderer/gen_dxgi_format_table.py
../../../flutter/third_party/angle/src/libANGLE/renderer/gen_dxgi_support_tables.py
../../../flutter/third_party/angle/src/libANGLE/renderer/gen_load_functions_table.py
../../../flutter/third_party/angle/src/libANGLE/renderer/gl/DisplayGL_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/renderer/gl/FeatureSupportGL.md
../../../flutter/third_party/angle/src/libANGLE/renderer/gl/OWNERS
../../../flutter/third_party/angle/src/libANGLE/renderer/gl/generate_gl_dispatch_table.py
../../../flutter/third_party/angle/src/libANGLE/renderer/metal/doc
../../../flutter/third_party/angle/src/libANGLE/renderer/metal/gen_mtl_format_table.py
../../../flutter/third_party/angle/src/libANGLE/renderer/metal/shaders/gen_mtl_internal_shaders.py
../../../flutter/third_party/angle/src/libANGLE/renderer/serial_utils_unittest.cpp
../../../flutter/third_party/angle/src/libANGLE/renderer/vulkan/OWNERS
../../../flutter/third_party/angle/src/libANGLE/renderer/vulkan/README.md
../../../flutter/third_party/angle/src/libANGLE/renderer/vulkan/doc
../../../flutter/third_party/angle/src/libANGLE/renderer/vulkan/fuchsia/OWNERS
../../../flutter/third_party/angle/src/libANGLE/renderer/vulkan/gen_vk_format_table.py
../../../flutter/third_party/angle/src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py
../../../flutter/third_party/angle/src/libANGLE/renderer/vulkan/gen_vk_mandatory_format_support_table.py
../../../flutter/third_party/angle/src/libANGLE/renderer/vulkan/shaders/README.md
../../../flutter/third_party/angle/src/libANGLE/renderer/vulkan/shaders/src/third_party/.clang-format
../../../flutter/third_party/angle/src/libANGLE/renderer/vulkan/shaders/src/third_party/etc_decoder/README.chromium
../../../flutter/third_party/angle/src/libANGLE/renderer/vulkan/shaders/src/third_party/ffx_spd/README.chromium
../../../flutter/third_party/angle/src/program_serialize_data_version.py
../../../flutter/third_party/angle/src/tests
../../../flutter/third_party/angle/src/third_party/ceval/.clang-format
../../../flutter/third_party/angle/src/third_party/ceval/README.chromium
../../../flutter/third_party/angle/src/third_party/ceval/README.md
../../../flutter/third_party/angle/src/third_party/ceval/package.json
../../../flutter/third_party/angle/src/third_party/libXNVCtrl/README.chromium
../../../flutter/third_party/angle/src/third_party/volk
../../../flutter/third_party/angle/third_party
../../../flutter/third_party/angle/tools
../../../flutter/third_party/angle/util
../../../flutter/third_party/benchmark
../../../flutter/third_party/boringssl/.git
../../../flutter/third_party/boringssl/.gitignore
../../../flutter/third_party/boringssl/OWNERS
../../../flutter/third_party/boringssl/README
../../../flutter/third_party/boringssl/apple-aarch64/crypto/test
../../../flutter/third_party/boringssl/apple-arm/crypto/test
../../../flutter/third_party/boringssl/apple-x86/crypto/test
../../../flutter/third_party/boringssl/apple-x86_64/crypto/test
../../../flutter/third_party/boringssl/codereview.settings
../../../flutter/third_party/boringssl/linux-aarch64/crypto/test
../../../flutter/third_party/boringssl/linux-arm/crypto/test
../../../flutter/third_party/boringssl/linux-x86/crypto/test
../../../flutter/third_party/boringssl/linux-x86_64/crypto/test
../../../flutter/third_party/boringssl/src/.clang-format
../../../flutter/third_party/boringssl/src/.git
../../../flutter/third_party/boringssl/src/.github
../../../flutter/third_party/boringssl/src/.gitignore
../../../flutter/third_party/boringssl/src/API-CONVENTIONS.md
../../../flutter/third_party/boringssl/src/BREAKING-CHANGES.md
../../../flutter/third_party/boringssl/src/BUILDING.md
../../../flutter/third_party/boringssl/src/CMakeLists.txt
../../../flutter/third_party/boringssl/src/CONTRIBUTING.md
../../../flutter/third_party/boringssl/src/FUZZING.md
../../../flutter/third_party/boringssl/src/INCORPORATING.md
../../../flutter/third_party/boringssl/src/PORTING.md
../../../flutter/third_party/boringssl/src/README.md
../../../flutter/third_party/boringssl/src/SANDBOXING.md
../../../flutter/third_party/boringssl/src/STYLE.md
../../../flutter/third_party/boringssl/src/cmake
../../../flutter/third_party/boringssl/src/codereview.settings
../../../flutter/third_party/boringssl/src/crypto/CMakeLists.txt
../../../flutter/third_party/boringssl/src/crypto/abi_self_test.cc
../../../flutter/third_party/boringssl/src/crypto/asn1/asn1_test.cc
../../../flutter/third_party/boringssl/src/crypto/base64/base64_test.cc
../../../flutter/third_party/boringssl/src/crypto/bio/bio_test.cc
../../../flutter/third_party/boringssl/src/crypto/blake2/blake2_test.cc
../../../flutter/third_party/boringssl/src/crypto/buf/buf_test.cc
../../../flutter/third_party/boringssl/src/crypto/bytestring/bytestring_test.cc
../../../flutter/third_party/boringssl/src/crypto/chacha/chacha_test.cc
../../../flutter/third_party/boringssl/src/crypto/cipher_extra/aead_test.cc
../../../flutter/third_party/boringssl/src/crypto/cipher_extra/cipher_test.cc
../../../flutter/third_party/boringssl/src/crypto/cipher_extra/test
../../../flutter/third_party/boringssl/src/crypto/compiler_test.cc
../../../flutter/third_party/boringssl/src/crypto/conf/conf_test.cc
../../../flutter/third_party/boringssl/src/crypto/constant_time_test.cc
../../../flutter/third_party/boringssl/src/crypto/cpu_arm_linux_test.cc
../../../flutter/third_party/boringssl/src/crypto/crypto_test.cc
../../../flutter/third_party/boringssl/src/crypto/curve25519/ed25519_test.cc
../../../flutter/third_party/boringssl/src/crypto/curve25519/make_curve25519_tables.py
../../../flutter/third_party/boringssl/src/crypto/curve25519/spake25519_test.cc
../../../flutter/third_party/boringssl/src/crypto/curve25519/x25519_test.cc
../../../flutter/third_party/boringssl/src/crypto/dh_extra/dh_test.cc
../../../flutter/third_party/boringssl/src/crypto/digest_extra/digest_test.cc
../../../flutter/third_party/boringssl/src/crypto/dsa/dsa_test.cc
../../../flutter/third_party/boringssl/src/crypto/ecdh_extra/ecdh_test.cc
../../../flutter/third_party/boringssl/src/crypto/err/err_data_generate.go
../../../flutter/third_party/boringssl/src/crypto/err/err_test.cc
../../../flutter/third_party/boringssl/src/crypto/evp/evp_extra_test.cc
../../../flutter/third_party/boringssl/src/crypto/evp/evp_test.cc
../../../flutter/third_party/boringssl/src/crypto/evp/pbkdf_test.cc
../../../flutter/third_party/boringssl/src/crypto/evp/scrypt_test.cc
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/CMakeLists.txt
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/FIPS.md
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/aes/aes_test.cc
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/bn/bn_test.cc
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/bn/bn_test_to_fuzzer.go
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/bn/check_bn_tests.go
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/bn/test
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/cmac/cmac_test.cc
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/ec/asm/p256_beeu-armv8-asm.pl
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/ec/asm/p256_beeu-x86_64-asm.pl
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/ec/ec_test.cc
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/ec/make_ec_scalar_base_mult_tests.go
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/ec/make_p256-nistz-tests.go
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/ec/make_tables.go
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/ec/p256-nistz_test.cc
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa_test.cc
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/hkdf/hkdf_test.cc
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/md5/md5_test.cc
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/modes/gcm_test.cc
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg_test.cc
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/rand/fork_detect_test.cc
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/rand/urandom_test.cc
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/service_indicator/service_indicator_test.cc
../../../flutter/third_party/boringssl/src/crypto/fipsmodule/sha/sha_test.cc
../../../flutter/third_party/boringssl/src/crypto/hmac_extra/hmac_test.cc
../../../flutter/third_party/boringssl/src/crypto/hpke/hpke_test.cc
../../../flutter/third_party/boringssl/src/crypto/hpke/translate_test_vectors.py
../../../flutter/third_party/boringssl/src/crypto/hrss/hrss_test.cc
../../../flutter/third_party/boringssl/src/crypto/impl_dispatch_test.cc
../../../flutter/third_party/boringssl/src/crypto/kyber/kyber_test.cc
../../../flutter/third_party/boringssl/src/crypto/lhash/lhash_test.cc
../../../flutter/third_party/boringssl/src/crypto/obj/README
../../../flutter/third_party/boringssl/src/crypto/obj/obj_test.cc
../../../flutter/third_party/boringssl/src/crypto/pem/pem_test.cc
../../../flutter/third_party/boringssl/src/crypto/perlasm/readme
../../../flutter/third_party/boringssl/src/crypto/pkcs7/pkcs7_test.cc
../../../flutter/third_party/boringssl/src/crypto/pkcs8/pkcs12_test.cc
../../../flutter/third_party/boringssl/src/crypto/pkcs8/pkcs8_test.cc
../../../flutter/third_party/boringssl/src/crypto/pkcs8/test
../../../flutter/third_party/boringssl/src/crypto/poly1305/poly1305_test.cc
../../../flutter/third_party/boringssl/src/crypto/pool/pool_test.cc
../../../flutter/third_party/boringssl/src/crypto/rand_extra/getentropy_test.cc
../../../flutter/third_party/boringssl/src/crypto/rand_extra/rand_test.cc
../../../flutter/third_party/boringssl/src/crypto/refcount_test.cc
../../../flutter/third_party/boringssl/src/crypto/rsa_extra/rsa_test.cc
../../../flutter/third_party/boringssl/src/crypto/self_test.cc
../../../flutter/third_party/boringssl/src/crypto/siphash/siphash_test.cc
../../../flutter/third_party/boringssl/src/crypto/stack/stack_test.cc
../../../flutter/third_party/boringssl/src/crypto/test
../../../flutter/third_party/boringssl/src/crypto/thread_test.cc
../../../flutter/third_party/boringssl/src/crypto/trust_token/trust_token_test.cc
../../../flutter/third_party/boringssl/src/crypto/x509/test
../../../flutter/third_party/boringssl/src/crypto/x509/x509_test.cc
../../../flutter/third_party/boringssl/src/crypto/x509/x509_time_test.cc
../../../flutter/third_party/boringssl/src/crypto/x509v3/tab_test.cc
../../../flutter/third_party/boringssl/src/decrepit/CMakeLists.txt
../../../flutter/third_party/boringssl/src/decrepit/blowfish/blowfish_test.cc
../../../flutter/third_party/boringssl/src/decrepit/cast/cast_test.cc
../../../flutter/third_party/boringssl/src/decrepit/cfb/cfb_test.cc
../../../flutter/third_party/boringssl/src/decrepit/evp/evp_test.cc
../../../flutter/third_party/boringssl/src/decrepit/ripemd/ripemd_test.cc
../../../flutter/third_party/boringssl/src/decrepit/xts/xts_test.cc
../../../flutter/third_party/boringssl/src/fuzz
../../../flutter/third_party/boringssl/src/pki/README.md
../../../flutter/third_party/boringssl/src/pki/cert_issuer_source_static_unittest.cc
../../../flutter/third_party/boringssl/src/pki/cert_issuer_source_sync_unittest.h
../../../flutter/third_party/boringssl/src/pki/certificate_policies_unittest.cc
../../../flutter/third_party/boringssl/src/pki/crl_unittest.cc
../../../flutter/third_party/boringssl/src/pki/encode_values_unittest.cc
../../../flutter/third_party/boringssl/src/pki/extended_key_usage_unittest.cc
../../../flutter/third_party/boringssl/src/pki/general_names_unittest.cc
../../../flutter/third_party/boringssl/src/pki/input_unittest.cc
../../../flutter/third_party/boringssl/src/pki/ip_util_unittest.cc
../../../flutter/third_party/boringssl/src/pki/name_constraints_unittest.cc
../../../flutter/third_party/boringssl/src/pki/nist_pkits_unittest.cc
../../../flutter/third_party/boringssl/src/pki/nist_pkits_unittest.h
../../../flutter/third_party/boringssl/src/pki/ocsp_unittest.cc
../../../flutter/third_party/boringssl/src/pki/parse_certificate_unittest.cc
../../../flutter/third_party/boringssl/src/pki/parse_name_unittest.cc
../../../flutter/third_party/boringssl/src/pki/parse_values_unittest.cc
../../../flutter/third_party/boringssl/src/pki/parsed_certificate_unittest.cc
../../../flutter/third_party/boringssl/src/pki/parser_unittest.cc
../../../flutter/third_party/boringssl/src/pki/path_builder_pkits_unittest.cc
../../../flutter/third_party/boringssl/src/pki/path_builder_unittest.cc
../../../flutter/third_party/boringssl/src/pki/path_builder_verify_certificate_chain_unittest.cc
../../../flutter/third_party/boringssl/src/pki/signature_algorithm_unittest.cc
../../../flutter/third_party/boringssl/src/pki/simple_path_builder_delegate_unittest.cc
../../../flutter/third_party/boringssl/src/pki/string_util_unittest.cc
../../../flutter/third_party/boringssl/src/pki/testdata
../../../flutter/third_party/boringssl/src/pki/trust_store_collection_unittest.cc
../../../flutter/third_party/boringssl/src/pki/verify_certificate_chain_pkits_unittest.cc
../../../flutter/third_party/boringssl/src/pki/verify_certificate_chain_typed_unittest.h
../../../flutter/third_party/boringssl/src/pki/verify_certificate_chain_unittest.cc
../../../flutter/third_party/boringssl/src/pki/verify_name_match_unittest.cc
../../../flutter/third_party/boringssl/src/pki/verify_signed_data_unittest.cc
../../../flutter/third_party/boringssl/src/rust
../../../flutter/third_party/boringssl/src/sources.cmake
../../../flutter/third_party/boringssl/src/ssl/CMakeLists.txt
../../../flutter/third_party/boringssl/src/ssl/span_test.cc
../../../flutter/third_party/boringssl/src/ssl/ssl_c_test.c
../../../flutter/third_party/boringssl/src/ssl/ssl_test.cc
../../../flutter/third_party/boringssl/src/ssl/test
../../../flutter/third_party/boringssl/src/third_party/fiat/METADATA
../../../flutter/third_party/boringssl/src/third_party/fiat/README.chromium
../../../flutter/third_party/boringssl/src/third_party/fiat/README.md
../../../flutter/third_party/boringssl/src/third_party/googletest
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/METADATA
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/aead_aes_siv_cmac_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/aegis128L_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/aegis128_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/aegis256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/aes_cbc_pkcs5_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/aes_cbc_pkcs5_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/aes_ccm_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/aes_cmac_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/aes_cmac_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/aes_eax_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/aes_gcm_siv_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/aes_gcm_siv_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/aes_gcm_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/aes_gcm_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/aes_siv_cmac_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/chacha20_poly1305_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/chacha20_poly1305_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/dsa_2048_224_sha224_p1363_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/dsa_2048_224_sha224_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/dsa_2048_224_sha256_p1363_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/dsa_2048_224_sha256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/dsa_2048_256_sha256_p1363_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/dsa_2048_256_sha256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/dsa_3072_256_sha256_p1363_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/dsa_3072_256_sha256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/dsa_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/dsa_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_brainpoolP224r1_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_brainpoolP256r1_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_brainpoolP320r1_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_brainpoolP384r1_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_brainpoolP512r1_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_secp224r1_ecpoint_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_secp224r1_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_secp224r1_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_secp256k1_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_secp256r1_ecpoint_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_secp256r1_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_secp256r1_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_secp384r1_ecpoint_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_secp384r1_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_secp384r1_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_secp521r1_ecpoint_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_secp521r1_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_secp521r1_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_webcrypto_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_brainpoolP224r1_sha224_p1363_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_brainpoolP224r1_sha224_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_brainpoolP256r1_sha256_p1363_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_brainpoolP256r1_sha256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_brainpoolP320r1_sha384_p1363_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_brainpoolP320r1_sha384_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_brainpoolP384r1_sha384_p1363_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_brainpoolP384r1_sha384_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_brainpoolP512r1_sha512_p1363_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_brainpoolP512r1_sha512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp224r1_sha224_p1363_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp224r1_sha224_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp224r1_sha224_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp224r1_sha256_p1363_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp224r1_sha256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp224r1_sha256_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp224r1_sha3_224_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp224r1_sha3_256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp224r1_sha3_512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp224r1_sha512_p1363_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp224r1_sha512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp224r1_sha512_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp256k1_sha256_p1363_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp256k1_sha256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp256k1_sha3_256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp256k1_sha3_512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp256k1_sha512_p1363_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp256k1_sha512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp256r1_sha256_p1363_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp256r1_sha256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp256r1_sha256_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp256r1_sha3_256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp256r1_sha3_512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp256r1_sha512_p1363_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp256r1_sha512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp256r1_sha512_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha384_p1363_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha384_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha384_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha3_384_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha3_512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha512_p1363_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha512_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp521r1_sha3_512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp521r1_sha512_p1363_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp521r1_sha512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp521r1_sha512_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_webcrypto_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/ed448_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/eddsa_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/eddsa_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/gmac_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hkdf_sha1_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hkdf_sha1_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hkdf_sha256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hkdf_sha256_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hkdf_sha384_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hkdf_sha384_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hkdf_sha512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hkdf_sha512_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hmac_sha1_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hmac_sha1_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hmac_sha224_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hmac_sha224_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hmac_sha256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hmac_sha256_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hmac_sha384_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hmac_sha384_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hmac_sha3_224_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hmac_sha3_256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hmac_sha3_384_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hmac_sha3_512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hmac_sha512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/hmac_sha512_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/kw_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/kw_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/kwp_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/kwp_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/primality_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/primality_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_2048_sha1_mgf1sha1_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_2048_sha1_mgf1sha1_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_2048_sha224_mgf1sha1_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_2048_sha224_mgf1sha1_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_2048_sha224_mgf1sha224_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_2048_sha224_mgf1sha224_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_2048_sha256_mgf1sha1_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_2048_sha256_mgf1sha1_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_2048_sha256_mgf1sha256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_2048_sha256_mgf1sha256_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_2048_sha384_mgf1sha1_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_2048_sha384_mgf1sha1_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_2048_sha384_mgf1sha384_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_2048_sha384_mgf1sha384_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_2048_sha512_mgf1sha1_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_2048_sha512_mgf1sha1_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_2048_sha512_mgf1sha512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_2048_sha512_mgf1sha512_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_3072_sha256_mgf1sha1_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_3072_sha256_mgf1sha1_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_3072_sha256_mgf1sha256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_3072_sha256_mgf1sha256_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_3072_sha512_mgf1sha1_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_3072_sha512_mgf1sha1_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_3072_sha512_mgf1sha512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_3072_sha512_mgf1sha512_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_4096_sha256_mgf1sha1_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_4096_sha256_mgf1sha1_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_4096_sha256_mgf1sha256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_4096_sha256_mgf1sha256_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_4096_sha512_mgf1sha1_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_4096_sha512_mgf1sha1_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_4096_sha512_mgf1sha512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_4096_sha512_mgf1sha512_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_misc_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_oaep_misc_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pkcs1_2048_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pkcs1_2048_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pkcs1_3072_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pkcs1_3072_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pkcs1_4096_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pkcs1_4096_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pss_2048_sha1_mgf1_20_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pss_2048_sha1_mgf1_20_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pss_2048_sha256_mgf1_0_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pss_2048_sha256_mgf1_0_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pss_2048_sha256_mgf1_32_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pss_2048_sha256_mgf1_32_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pss_2048_sha512_256_mgf1_28_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pss_2048_sha512_256_mgf1_32_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pss_3072_sha256_mgf1_32_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pss_3072_sha256_mgf1_32_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pss_4096_sha256_mgf1_32_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pss_4096_sha256_mgf1_32_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pss_4096_sha512_mgf1_32_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pss_4096_sha512_mgf1_32_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pss_misc_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_pss_misc_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_sig_gen_misc_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_sig_gen_misc_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_2048_sha224_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_2048_sha224_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_2048_sha256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_2048_sha256_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_2048_sha384_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_2048_sha384_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_2048_sha3_224_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_2048_sha3_256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_2048_sha3_384_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_2048_sha3_512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_2048_sha512_224_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_2048_sha512_256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_2048_sha512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_2048_sha512_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_3072_sha256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_3072_sha256_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_3072_sha384_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_3072_sha384_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_3072_sha3_256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_3072_sha3_384_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_3072_sha3_512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_3072_sha512_256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_3072_sha512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_3072_sha512_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_4096_sha384_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_4096_sha384_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_4096_sha512_256_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_4096_sha512_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_4096_sha512_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/vmac_128_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/vmac_64_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/x25519_asn_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/x25519_jwk_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/x25519_pem_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/x25519_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/x25519_test.txt
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/x448_asn_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/x448_jwk_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/x448_pem_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/x448_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/xchacha20_poly1305_test.json
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/xchacha20_poly1305_test.txt
../../../flutter/third_party/boringssl/src/util
../../../flutter/third_party/boringssl/win-aarch64/crypto/test
../../../flutter/third_party/boringssl/win-x86/crypto/test
../../../flutter/third_party/boringssl/win-x86_64/crypto/test
../../../flutter/third_party/depot_tools
../../../flutter/third_party/expat/.git
../../../flutter/third_party/expat/.github
../../../flutter/third_party/expat/.gitignore
../../../flutter/third_party/expat/.mailmap
../../../flutter/third_party/expat/Brewfile
../../../flutter/third_party/expat/README.md
../../../flutter/third_party/expat/appveyor.yml
../../../flutter/third_party/expat/expat/.clang-format
../../../flutter/third_party/expat/expat/.gitignore
../../../flutter/third_party/expat/expat/AUTHORS
../../../flutter/third_party/expat/expat/CMake.README
../../../flutter/third_party/expat/expat/CMakeLists.txt
../../../flutter/third_party/expat/expat/Changes
../../../flutter/third_party/expat/expat/ConfigureChecks.cmake
../../../flutter/third_party/expat/expat/README.md
../../../flutter/third_party/expat/expat/acinclude.m4
../../../flutter/third_party/expat/expat/cmake
../../../flutter/third_party/expat/expat/configure-ac-style.md
../../../flutter/third_party/expat/expat/conftools/.gitignore
../../../flutter/third_party/expat/expat/conftools/ax-append-compile-flags.m4
../../../flutter/third_party/expat/expat/conftools/ax-append-flag.m4
../../../flutter/third_party/expat/expat/conftools/ax-append-link-flags.m4
../../../flutter/third_party/expat/expat/conftools/ax-check-compile-flag.m4
../../../flutter/third_party/expat/expat/conftools/ax-check-link-flag.m4
../../../flutter/third_party/expat/expat/conftools/ax-require-defined.m4
../../../flutter/third_party/expat/expat/conftools/expat.m4
../../../flutter/third_party/expat/expat/conftools/expatcfg-compiler-supports-visibility.m4
../../../flutter/third_party/expat/expat/doc
../../../flutter/third_party/expat/expat/examples
../../../flutter/third_party/expat/expat/expat.pc.cmake
../../../flutter/third_party/expat/expat/expat_config.h.cmake
../../../flutter/third_party/expat/expat/fuzz/.gitignore
../../../flutter/third_party/expat/expat/gennmtab/.gitignore
../../../flutter/third_party/expat/expat/lib/.gitignore
../../../flutter/third_party/expat/expat/lib/libexpat.def.cmake
../../../flutter/third_party/expat/expat/memory-sanitizer-blacklist.txt
../../../flutter/third_party/expat/expat/tests
../../../flutter/third_party/expat/expat/win32/.gitignore
../../../flutter/third_party/expat/expat/win32/MANIFEST.txt
../../../flutter/third_party/expat/expat/win32/README.txt
../../../flutter/third_party/expat/expat/win32/expat.iss
../../../flutter/third_party/expat/expat/xmlwf/.gitignore
../../../flutter/third_party/expat/expat/xmlwf/xmlwf_helpgen.py
../../../flutter/third_party/expat/testdata
../../../flutter/third_party/flatbuffers/.bazelci
../../../flutter/third_party/flatbuffers/.clang-format
../../../flutter/third_party/flatbuffers/.editorconfig
../../../flutter/third_party/flatbuffers/.eslintrc.js
../../../flutter/third_party/flatbuffers/.git
../../../flutter/third_party/flatbuffers/.gitattributes
../../../flutter/third_party/flatbuffers/.github
../../../flutter/third_party/flatbuffers/.gitignore
../../../flutter/third_party/flatbuffers/.travis.yml
../../../flutter/third_party/flatbuffers/.travis/check-sources.sh.py
../../../flutter/third_party/flatbuffers/BUILD.bazel
../../../flutter/third_party/flatbuffers/CMake
../../../flutter/third_party/flatbuffers/CMakeLists.txt
../../../flutter/third_party/flatbuffers/CONTRIBUTING.md
../../../flutter/third_party/flatbuffers/Formatters.md
../../../flutter/third_party/flatbuffers/SECURITY.md
../../../flutter/third_party/flatbuffers/WORKSPACE
../../../flutter/third_party/flatbuffers/android
../../../flutter/third_party/flatbuffers/benchmarks
../../../flutter/third_party/flatbuffers/build_defs.bzl
../../../flutter/third_party/flatbuffers/conan/CMakeLists.txt
../../../flutter/third_party/flatbuffers/conan/appveyor/build.py
../../../flutter/third_party/flatbuffers/conan/appveyor/install.py
../../../flutter/third_party/flatbuffers/conan/build.py
../../../flutter/third_party/flatbuffers/conan/test_package/CMakeLists.txt
../../../flutter/third_party/flatbuffers/conan/test_package/conanfile.py
../../../flutter/third_party/flatbuffers/conanfile.py
../../../flutter/third_party/flatbuffers/dart/CHANGELOG.md
../../../flutter/third_party/flatbuffers/dart/README.md
../../../flutter/third_party/flatbuffers/dart/analysis_options.yaml
../../../flutter/third_party/flatbuffers/dart/example
../../../flutter/third_party/flatbuffers/dart/pubspec.yaml
../../../flutter/third_party/flatbuffers/dart/test
../../../flutter/third_party/flatbuffers/docs
../../../flutter/third_party/flatbuffers/go
../../../flutter/third_party/flatbuffers/grpc/README.md
../../../flutter/third_party/flatbuffers/grpc/examples
../../../flutter/third_party/flatbuffers/grpc/flatbuffers-java-grpc/pom.xml
../../../flutter/third_party/flatbuffers/grpc/pom.xml
../../../flutter/third_party/flatbuffers/grpc/samples
../../../flutter/third_party/flatbuffers/grpc/src/compiler/BUILD.bazel
../../../flutter/third_party/flatbuffers/grpc/tests
../../../flutter/third_party/flatbuffers/js/README.md
../../../flutter/third_party/flatbuffers/kotlin/flatbuffers-kotlin/src/jvmTest
../../../flutter/third_party/flatbuffers/kotlin/gradle.properties
../../../flutter/third_party/flatbuffers/mjs/README.md
../../../flutter/third_party/flatbuffers/net
../../../flutter/third_party/flatbuffers/package.json
../../../flutter/third_party/flatbuffers/php
../../../flutter/third_party/flatbuffers/pom.xml
../../../flutter/third_party/flatbuffers/python
../../../flutter/third_party/flatbuffers/readme.md
../../../flutter/third_party/flatbuffers/reflection/BUILD.bazel
../../../flutter/third_party/flatbuffers/rust
../../../flutter/third_party/flatbuffers/samples
../../../flutter/third_party/flatbuffers/scripts/check_generate_code.py
../../../flutter/third_party/flatbuffers/scripts/generate_code.py
../../../flutter/third_party/flatbuffers/snap/snapcraft.yaml
../../../flutter/third_party/flatbuffers/src/BUILD.bazel
../../../flutter/third_party/flatbuffers/swift.swiftformat
../../../flutter/third_party/flatbuffers/swift/BUILD.bazel
../../../flutter/third_party/flatbuffers/swift/README.md
../../../flutter/third_party/flatbuffers/tests
../../../flutter/third_party/flatbuffers/ts
../../../flutter/third_party/flatbuffers/typescript.bzl
../../../flutter/third_party/freetype2/.clang-format
../../../flutter/third_party/freetype2/.git
../../../flutter/third_party/freetype2/.gitignore
../../../flutter/third_party/freetype2/.gitlab-ci.yml
../../../flutter/third_party/freetype2/.gitmodules
../../../flutter/third_party/freetype2/.mailmap
../../../flutter/third_party/freetype2/CMakeLists.txt
../../../flutter/third_party/freetype2/Makefile
../../../flutter/third_party/freetype2/README
../../../flutter/third_party/freetype2/README.git
../../../flutter/third_party/freetype2/builds
../../../flutter/third_party/freetype2/docs/.gitignore
../../../flutter/third_party/freetype2/docs/CHANGES
../../../flutter/third_party/freetype2/docs/CMAKE
../../../flutter/third_party/freetype2/docs/CUSTOMIZE
../../../flutter/third_party/freetype2/docs/DEBUG
../../../flutter/third_party/freetype2/docs/DOCGUIDE
../../../flutter/third_party/freetype2/docs/GPLv2.TXT
../../../flutter/third_party/freetype2/docs/INSTALL
../../../flutter/third_party/freetype2/docs/INSTALL.ANY
../../../flutter/third_party/freetype2/docs/INSTALL.CROSS
../../../flutter/third_party/freetype2/docs/INSTALL.GNU
../../../flutter/third_party/freetype2/docs/INSTALL.MAC
../../../flutter/third_party/freetype2/docs/INSTALL.UNIX
../../../flutter/third_party/freetype2/docs/INSTALL.VMS
../../../flutter/third_party/freetype2/docs/MAKEPP
../../../flutter/third_party/freetype2/docs/PROBLEMS
../../../flutter/third_party/freetype2/docs/README
../../../flutter/third_party/freetype2/docs/TODO
../../../flutter/third_party/freetype2/docs/VERSIONS.TXT
../../../flutter/third_party/freetype2/docs/formats.txt
../../../flutter/third_party/freetype2/docs/freetype-config.1
../../../flutter/third_party/freetype2/docs/markdown
../../../flutter/third_party/freetype2/docs/oldlogs
../../../flutter/third_party/freetype2/docs/raster.txt
../../../flutter/third_party/freetype2/docs/release
../../../flutter/third_party/freetype2/meson.build
../../../flutter/third_party/freetype2/objs/.gitignore
../../../flutter/third_party/freetype2/objs/README
../../../flutter/third_party/freetype2/src/autofit/module.mk
../../../flutter/third_party/freetype2/src/autofit/rules.mk
../../../flutter/third_party/freetype2/src/base/rules.mk
../../../flutter/third_party/freetype2/src/bdf/README
../../../flutter/third_party/freetype2/src/bdf/module.mk
../../../flutter/third_party/freetype2/src/bdf/rules.mk
../../../flutter/third_party/freetype2/src/bzip2/rules.mk
../../../flutter/third_party/freetype2/src/cache/rules.mk
../../../flutter/third_party/freetype2/src/cff/module.mk
../../../flutter/third_party/freetype2/src/cff/rules.mk
../../../flutter/third_party/freetype2/src/cid/module.mk
../../../flutter/third_party/freetype2/src/cid/rules.mk
../../../flutter/third_party/freetype2/src/dlg/rules.mk
../../../flutter/third_party/freetype2/src/gxvalid/README
../../../flutter/third_party/freetype2/src/gxvalid/module.mk
../../../flutter/third_party/freetype2/src/gxvalid/rules.mk
../../../flutter/third_party/freetype2/src/gzip/README.freetype
../../../flutter/third_party/freetype2/src/gzip/rules.mk
../../../flutter/third_party/freetype2/src/lzw/rules.mk
../../../flutter/third_party/freetype2/src/otvalid/module.mk
../../../flutter/third_party/freetype2/src/otvalid/rules.mk
../../../flutter/third_party/freetype2/src/pcf/README
../../../flutter/third_party/freetype2/src/pcf/module.mk
../../../flutter/third_party/freetype2/src/pcf/rules.mk
../../../flutter/third_party/freetype2/src/pfr/module.mk
../../../flutter/third_party/freetype2/src/pfr/rules.mk
../../../flutter/third_party/freetype2/src/psaux/module.mk
../../../flutter/third_party/freetype2/src/psaux/rules.mk
../../../flutter/third_party/freetype2/src/pshinter/module.mk
../../../flutter/third_party/freetype2/src/pshinter/rules.mk
../../../flutter/third_party/freetype2/src/psnames/module.mk
../../../flutter/third_party/freetype2/src/psnames/rules.mk
../../../flutter/third_party/freetype2/src/raster/module.mk
../../../flutter/third_party/freetype2/src/raster/rules.mk
../../../flutter/third_party/freetype2/src/sdf/module.mk
../../../flutter/third_party/freetype2/src/sdf/rules.mk
../../../flutter/third_party/freetype2/src/sfnt/module.mk
../../../flutter/third_party/freetype2/src/sfnt/rules.mk
../../../flutter/third_party/freetype2/src/smooth/module.mk
../../../flutter/third_party/freetype2/src/smooth/rules.mk
../../../flutter/third_party/freetype2/src/svg/module.mk
../../../flutter/third_party/freetype2/src/svg/rules.mk
../../../flutter/third_party/freetype2/src/tools
../../../flutter/third_party/freetype2/src/truetype/module.mk
../../../flutter/third_party/freetype2/src/truetype/rules.mk
../../../flutter/third_party/freetype2/src/type1/module.mk
../../../flutter/third_party/freetype2/src/type1/rules.mk
../../../flutter/third_party/freetype2/src/type42/module.mk
../../../flutter/third_party/freetype2/src/type42/rules.mk
../../../flutter/third_party/freetype2/src/winfonts/module.mk
../../../flutter/third_party/freetype2/src/winfonts/rules.mk
../../../flutter/third_party/freetype2/tests
../../../flutter/third_party/freetype2/vms_make.com
../../../flutter/third_party/glfw/.appveyor.yml
../../../flutter/third_party/glfw/.git
../../../flutter/third_party/glfw/.gitattributes
../../../flutter/third_party/glfw/.github
../../../flutter/third_party/glfw/.gitignore
../../../flutter/third_party/glfw/.mailmap
../../../flutter/third_party/glfw/CMake
../../../flutter/third_party/glfw/CMakeLists.txt
../../../flutter/third_party/glfw/CONTRIBUTORS.md
../../../flutter/third_party/glfw/README.md
../../../flutter/third_party/glfw/deps
../../../flutter/third_party/glfw/docs
../../../flutter/third_party/glfw/examples
../../../flutter/third_party/glfw/src/CMakeLists.txt
../../../flutter/third_party/glfw/tests
../../../flutter/third_party/gn
../../../flutter/third_party/google_fonts_for_unit_tests
../../../flutter/third_party/googletest
../../../flutter/third_party/gtest-parallel/.git
../../../flutter/third_party/gtest-parallel/.gitignore
../../../flutter/third_party/gtest-parallel/CONTRIBUTING.md
../../../flutter/third_party/gtest-parallel/README.md
../../../flutter/third_party/gtest-parallel/gtest_parallel.py
../../../flutter/third_party/gtest-parallel/gtest_parallel_mocks.py
../../../flutter/third_party/gtest-parallel/gtest_parallel_tests.py
../../../flutter/third_party/harfbuzz/.ci/requirements.txt
../../../flutter/third_party/harfbuzz/.clang-format
../../../flutter/third_party/harfbuzz/.editorconfig
../../../flutter/third_party/harfbuzz/.git
../../../flutter/third_party/harfbuzz/.github
../../../flutter/third_party/harfbuzz/AUTHORS
../../../flutter/third_party/harfbuzz/BUILD.md
../../../flutter/third_party/harfbuzz/CMakeLists.txt
../../../flutter/third_party/harfbuzz/CONFIG.md
../../../flutter/third_party/harfbuzz/NEWS
../../../flutter/third_party/harfbuzz/README
../../../flutter/third_party/harfbuzz/README.md
../../../flutter/third_party/harfbuzz/README.mingw.md
../../../flutter/third_party/harfbuzz/README.python.md
../../../flutter/third_party/harfbuzz/RELEASING.md
../../../flutter/third_party/harfbuzz/SECURITY.md
../../../flutter/third_party/harfbuzz/TESTING.md
../../../flutter/third_party/harfbuzz/THANKS
../../../flutter/third_party/harfbuzz/docs
../../../flutter/third_party/harfbuzz/git.mk
../../../flutter/third_party/harfbuzz/m4/ax_check_link_flag.m4
../../../flutter/third_party/harfbuzz/m4/ax_code_coverage.m4
../../../flutter/third_party/harfbuzz/m4/ax_cxx_compile_stdcxx.m4
../../../flutter/third_party/harfbuzz/m4/ax_pthread.m4
../../../flutter/third_party/harfbuzz/meson.build
../../../flutter/third_party/harfbuzz/perf/README.md
../../../flutter/third_party/harfbuzz/perf/meson.build
../../../flutter/third_party/harfbuzz/replace-enum-strings.cmake
../../../flutter/third_party/harfbuzz/src/Makefile.sources
../../../flutter/third_party/harfbuzz/src/addTable.py
../../../flutter/third_party/harfbuzz/src/check-c-linkage-decls.py
../../../flutter/third_party/harfbuzz/src/check-externs.py
../../../flutter/third_party/harfbuzz/src/check-header-guards.py
../../../flutter/third_party/harfbuzz/src/check-includes.py
../../../flutter/third_party/harfbuzz/src/check-libstdc++.py
../../../flutter/third_party/harfbuzz/src/check-static-inits.py
../../../flutter/third_party/harfbuzz/src/check-symbols.py
../../../flutter/third_party/harfbuzz/src/fix_get_types.py
../../../flutter/third_party/harfbuzz/src/gen-arabic-joining-list.py
../../../flutter/third_party/harfbuzz/src/gen-arabic-pua.py
../../../flutter/third_party/harfbuzz/src/gen-arabic-table.py
../../../flutter/third_party/harfbuzz/src/gen-def.py
../../../flutter/third_party/harfbuzz/src/gen-emoji-table.py
../../../flutter/third_party/harfbuzz/src/gen-harfbuzzcc.py
../../../flutter/third_party/harfbuzz/src/gen-hb-version.py
../../../flutter/third_party/harfbuzz/src/gen-indic-table.py
../../../flutter/third_party/harfbuzz/src/gen-os2-unicode-ranges.py
../../../flutter/third_party/harfbuzz/src/gen-ragel-artifacts.py
../../../flutter/third_party/harfbuzz/src/gen-tag-table.py
../../../flutter/third_party/harfbuzz/src/gen-ucd-table.py
../../../flutter/third_party/harfbuzz/src/gen-use-table.py
../../../flutter/third_party/harfbuzz/src/gen-vowel-constraints.py
../../../flutter/third_party/harfbuzz/src/justify.py
../../../flutter/third_party/harfbuzz/src/meson.build
../../../flutter/third_party/harfbuzz/src/relative_to.py
../../../flutter/third_party/harfbuzz/src/sample.py
../../../flutter/third_party/harfbuzz/src/wasm/graphite/Makefile
../../../flutter/third_party/harfbuzz/src/wasm/sample/c/Makefile
../../../flutter/third_party/harfbuzz/subprojects/.gitignore
../../../flutter/third_party/harfbuzz/subprojects/packagefiles/ragel/meson.build
../../../flutter/third_party/harfbuzz/test
../../../flutter/third_party/harfbuzz/util
../../../flutter/third_party/icu/.git
../../../flutter/third_party/icu/DIR_METADATA
../../../flutter/third_party/icu/OWNERS
../../../flutter/third_party/icu/README.chromium
../../../flutter/third_party/icu/README.fuchsia
../../../flutter/third_party/icu/codereview.settings
../../../flutter/third_party/icu/filters
../../../flutter/third_party/icu/flutter/README.md
../../../flutter/third_party/icu/fuzzers
../../../flutter/third_party/icu/icu4c.css
../../../flutter/third_party/icu/license.html
../../../flutter/third_party/icu/readme.html
../../../flutter/third_party/icu/scripts
../../../flutter/third_party/icu/source/.clang-format
../../../flutter/third_party/icu/source/Makefile.in
../../../flutter/third_party/icu/source/acinclude.m4
../../../flutter/third_party/icu/source/aclocal.m4
../../../flutter/third_party/icu/source/common/BUILD.bazel
../../../flutter/third_party/icu/source/common/Makefile.in
../../../flutter/third_party/icu/source/common/rbbicst.pl
../../../flutter/third_party/icu/source/common/sources.txt
../../../flutter/third_party/icu/source/common/unicode/uvernum.h
../../../flutter/third_party/icu/source/config
../../../flutter/third_party/icu/source/data/BUILDRULES.py
../../../flutter/third_party/icu/source/data/Makefile.in
../../../flutter/third_party/icu/source/data/brkitr/LOCALE_DEPS.json
../../../flutter/third_party/icu/source/data/brkitr/dictionaries/burmesedict.txt
../../../flutter/third_party/icu/source/data/brkitr/dictionaries/cjdict.txt
../../../flutter/third_party/icu/source/data/brkitr/dictionaries/laodict.txt
../../../flutter/third_party/icu/source/data/brkitr/rules/README.md
../../../flutter/third_party/icu/source/data/build.xml
../../../flutter/third_party/icu/source/data/coll/LOCALE_DEPS.json
../../../flutter/third_party/icu/source/data/curr/LOCALE_DEPS.json
../../../flutter/third_party/icu/source/data/dtd
../../../flutter/third_party/icu/source/data/lang/LOCALE_DEPS.json
../../../flutter/third_party/icu/source/data/locales/LOCALE_DEPS.json
../../../flutter/third_party/icu/source/data/mappings/ucmcore.mk
../../../flutter/third_party/icu/source/data/mappings/ucmebcdic.mk
../../../flutter/third_party/icu/source/data/mappings/ucmfiles.mk
../../../flutter/third_party/icu/source/data/pkgdataMakefile.in
../../../flutter/third_party/icu/source/data/rbnf/LOCALE_DEPS.json
../../../flutter/third_party/icu/source/data/region/LOCALE_DEPS.json
../../../flutter/third_party/icu/source/data/sprep/sprepfiles.mk
../../../flutter/third_party/icu/source/data/unidata/norm2/BUILD.bazel
../../../flutter/third_party/icu/source/data/unit/LOCALE_DEPS.json
../../../flutter/third_party/icu/source/data/zone/LOCALE_DEPS.json
../../../flutter/third_party/icu/source/extra/Makefile.in
../../../flutter/third_party/icu/source/extra/scrptrun/Makefile.in
../../../flutter/third_party/icu/source/extra/scrptrun/readme.html
../../../flutter/third_party/icu/source/extra/scrptrun/sources.txt
../../../flutter/third_party/icu/source/extra/uconv/Makefile.in
../../../flutter/third_party/icu/source/extra/uconv/README
../../../flutter/third_party/icu/source/extra/uconv/pkgdataMakefile.in
../../../flutter/third_party/icu/source/extra/uconv/resfiles.mk
../../../flutter/third_party/icu/source/extra/uconv/samples
../../../flutter/third_party/icu/source/extra/uconv/sources.txt
../../../flutter/third_party/icu/source/extra/uconv/uconv.1.in
../../../flutter/third_party/icu/source/i18n/BUILD.bazel
../../../flutter/third_party/icu/source/i18n/Makefile.in
../../../flutter/third_party/icu/source/i18n/sources.txt
../../../flutter/third_party/icu/source/io/Makefile.in
../../../flutter/third_party/icu/source/io/sources.txt
../../../flutter/third_party/icu/source/python/icutools/__init__.py
../../../flutter/third_party/icu/source/python/icutools/databuilder/__init__.py
../../../flutter/third_party/icu/source/python/icutools/databuilder/__main__.py
../../../flutter/third_party/icu/source/python/icutools/databuilder/comment_stripper.py
../../../flutter/third_party/icu/source/python/icutools/databuilder/filtration.py
../../../flutter/third_party/icu/source/python/icutools/databuilder/renderers/__init__.py
../../../flutter/third_party/icu/source/python/icutools/databuilder/renderers/common_exec.py
../../../flutter/third_party/icu/source/python/icutools/databuilder/renderers/makefile.py
../../../flutter/third_party/icu/source/python/icutools/databuilder/request_types.py
../../../flutter/third_party/icu/source/python/icutools/databuilder/test
../../../flutter/third_party/icu/source/python/icutools/databuilder/utils.py
../../../flutter/third_party/icu/source/samples
../../../flutter/third_party/icu/source/stubdata/BUILD.bazel
../../../flutter/third_party/icu/source/stubdata/Makefile.in
../../../flutter/third_party/icu/source/stubdata/sources.txt
../../../flutter/third_party/icu/source/test
../../../flutter/third_party/icu/source/tools/Makefile.in
../../../flutter/third_party/icu/source/tools/ctestfw/Makefile.in
../../../flutter/third_party/icu/source/tools/ctestfw/sources.txt
../../../flutter/third_party/icu/source/tools/escapesrc/Makefile.in
../../../flutter/third_party/icu/source/tools/genbrk/Makefile.in
../../../flutter/third_party/icu/source/tools/genbrk/genbrk.1.in
../../../flutter/third_party/icu/source/tools/genbrk/sources.txt
../../../flutter/third_party/icu/source/tools/genccode/Makefile.in
../../../flutter/third_party/icu/source/tools/genccode/genccode.8.in
../../../flutter/third_party/icu/source/tools/genccode/sources.txt
../../../flutter/third_party/icu/source/tools/gencfu/Makefile.in
../../../flutter/third_party/icu/source/tools/gencfu/gencfu.1.in
../../../flutter/third_party/icu/source/tools/gencfu/sources.txt
../../../flutter/third_party/icu/source/tools/gencmn/Makefile.in
../../../flutter/third_party/icu/source/tools/gencmn/gencmn.8.in
../../../flutter/third_party/icu/source/tools/gencmn/sources.txt
../../../flutter/third_party/icu/source/tools/gencnval/Makefile.in
../../../flutter/third_party/icu/source/tools/gencnval/gencnval.1.in
../../../flutter/third_party/icu/source/tools/gencnval/sources.txt
../../../flutter/third_party/icu/source/tools/gencolusb/Makefile
../../../flutter/third_party/icu/source/tools/gencolusb/README.md
../../../flutter/third_party/icu/source/tools/gendict/Makefile.in
../../../flutter/third_party/icu/source/tools/gendict/gendict.1.in
../../../flutter/third_party/icu/source/tools/gendict/sources.txt
../../../flutter/third_party/icu/source/tools/gennorm2/BUILD.bazel
../../../flutter/third_party/icu/source/tools/gennorm2/Makefile.in
../../../flutter/third_party/icu/source/tools/gennorm2/sources.txt
../../../flutter/third_party/icu/source/tools/genrb/Makefile.in
../../../flutter/third_party/icu/source/tools/genrb/derb.1.in
../../../flutter/third_party/icu/source/tools/genrb/genrb.1.in
../../../flutter/third_party/icu/source/tools/genrb/sources.txt
../../../flutter/third_party/icu/source/tools/genren/Makefile
../../../flutter/third_party/icu/source/tools/genren/README
../../../flutter/third_party/icu/source/tools/gensprep/Makefile.in
../../../flutter/third_party/icu/source/tools/gensprep/gensprep.8.in
../../../flutter/third_party/icu/source/tools/gensprep/sources.txt
../../../flutter/third_party/icu/source/tools/gentest/Makefile.in
../../../flutter/third_party/icu/source/tools/gentest/sources.txt
../../../flutter/third_party/icu/source/tools/icuexportdata/Makefile.in
../../../flutter/third_party/icu/source/tools/icuexportdata/icuexportdata.1.in
../../../flutter/third_party/icu/source/tools/icuexportdata/sources.txt
../../../flutter/third_party/icu/source/tools/icuinfo/Makefile.in
../../../flutter/third_party/icu/source/tools/icuinfo/sources.txt
../../../flutter/third_party/icu/source/tools/icupkg/Makefile.in
../../../flutter/third_party/icu/source/tools/icupkg/icupkg.8.in
../../../flutter/third_party/icu/source/tools/icupkg/sources.txt
../../../flutter/third_party/icu/source/tools/icuswap/Makefile.in
../../../flutter/third_party/icu/source/tools/icuswap/sources.txt
../../../flutter/third_party/icu/source/tools/makeconv/Makefile.in
../../../flutter/third_party/icu/source/tools/makeconv/makeconv.1.in
../../../flutter/third_party/icu/source/tools/makeconv/sources.txt
../../../flutter/third_party/icu/source/tools/memcheck/ICUMemCheck.pl
../../../flutter/third_party/icu/source/tools/pkgdata/Makefile.in
../../../flutter/third_party/icu/source/tools/pkgdata/pkgdata.1.in
../../../flutter/third_party/icu/source/tools/pkgdata/sources.txt
../../../flutter/third_party/icu/source/tools/toolutil/BUILD.bazel
../../../flutter/third_party/icu/source/tools/toolutil/Makefile.in
../../../flutter/third_party/icu/source/tools/toolutil/sources.txt
../../../flutter/third_party/icu/source/tools/tzcode/Makefile.in
../../../flutter/third_party/icu/source/tools/tzcode/readme.txt
../../../flutter/third_party/imgui
../../../flutter/third_party/inja/.clang-format
../../../flutter/third_party/inja/.git
../../../flutter/third_party/inja/.github
../../../flutter/third_party/inja/.gitignore
../../../flutter/third_party/inja/CMakeLists.txt
../../../flutter/third_party/inja/README.md
../../../flutter/third_party/inja/cmake
../../../flutter/third_party/inja/doc
../../../flutter/third_party/inja/meson.build
../../../flutter/third_party/inja/requirements.txt
../../../flutter/third_party/inja/scripts/amalgamate_config.json
../../../flutter/third_party/inja/test
../../../flutter/third_party/inja/third_party/amalgamate
../../../flutter/third_party/inja/third_party/include/doctest
../../../flutter/third_party/json/.clang-format
../../../flutter/third_party/json/.clang-tidy
../../../flutter/third_party/json/.git
../../../flutter/third_party/json/.github
../../../flutter/third_party/json/.gitignore
../../../flutter/third_party/json/.lgtm.yml
../../../flutter/third_party/json/.reuse
../../../flutter/third_party/json/BUILD.bazel
../../../flutter/third_party/json/CITATION.cff
../../../flutter/third_party/json/CMakeLists.txt
../../../flutter/third_party/json/ChangeLog.md
../../../flutter/third_party/json/Makefile
../../../flutter/third_party/json/README.md
../../../flutter/third_party/json/WORKSPACE.bazel
../../../flutter/third_party/json/cmake
../../../flutter/third_party/json/docs
../../../flutter/third_party/json/meson.build
../../../flutter/third_party/json/tests
../../../flutter/third_party/json/tools/amalgamate/CHANGES.md
../../../flutter/third_party/json/tools/amalgamate/README.md
../../../flutter/third_party/json/tools/amalgamate/amalgamate.py
../../../flutter/third_party/json/tools/gdb_pretty_printer/README.md
../../../flutter/third_party/json/tools/gdb_pretty_printer/nlohmann-json.py
../../../flutter/third_party/json/tools/generate_natvis/README.md
../../../flutter/third_party/json/tools/generate_natvis/generate_natvis.py
../../../flutter/third_party/json/tools/serve_header/README.md
../../../flutter/third_party/json/tools/serve_header/requirements.txt
../../../flutter/third_party/json/tools/serve_header/serve_header.py
../../../flutter/third_party/libjpeg-turbo/src/.git
../../../flutter/third_party/libjpeg-turbo/src/.gitignore
../../../flutter/third_party/libjpeg-turbo/src/BUILDING.md
../../../flutter/third_party/libjpeg-turbo/src/CMakeLists.txt
../../../flutter/third_party/libjpeg-turbo/src/ChangeLog.md
../../../flutter/third_party/libjpeg-turbo/src/README.fuchsia
../../../flutter/third_party/libjpeg-turbo/src/README.md
../../../flutter/third_party/libjpeg-turbo/src/acinclude.m4
../../../flutter/third_party/libjpeg-turbo/src/change.log
../../../flutter/third_party/libjpeg-turbo/src/cjpeg.1
../../../flutter/third_party/libjpeg-turbo/src/coderules.txt
../../../flutter/third_party/libjpeg-turbo/src/djpeg.1
../../../flutter/third_party/libjpeg-turbo/src/doxygen-extra.css
../../../flutter/third_party/libjpeg-turbo/src/doxygen.config
../../../flutter/third_party/libjpeg-turbo/src/jpegtran.1
../../../flutter/third_party/libjpeg-turbo/src/rdjpgcom.1
../../../flutter/third_party/libjpeg-turbo/src/simd/CMakeLists.txt
../../../flutter/third_party/libjpeg-turbo/src/structure.txt
../../../flutter/third_party/libjpeg-turbo/src/wrjpgcom.1
../../../flutter/third_party/libpng/.git
../../../flutter/third_party/libpng/.travis.yml
../../../flutter/third_party/libpng/ANNOUNCE
../../../flutter/third_party/libpng/AUTHORS
../../../flutter/third_party/libpng/CHANGES
../../../flutter/third_party/libpng/CMakeLists.txt
../../../flutter/third_party/libpng/INSTALL
../../../flutter/third_party/libpng/Makefile.in
../../../flutter/third_party/libpng/README
../../../flutter/third_party/libpng/TODO
../../../flutter/third_party/libpng/TRADEMARK
../../../flutter/third_party/libpng/aclocal.m4
../../../flutter/third_party/libpng/contrib
../../../flutter/third_party/libpng/libpng-manual.txt
../../../flutter/third_party/libpng/libpng.3
../../../flutter/third_party/libpng/libpngpf.3
../../../flutter/third_party/libpng/mips
../../../flutter/third_party/libpng/png.5
../../../flutter/third_party/libpng/powerpc
../../../flutter/third_party/libpng/projects
../../../flutter/third_party/libpng/scripts
../../../flutter/third_party/libpng/tests
../../../flutter/third_party/libtess2/.git
../../../flutter/third_party/libtess2/.gitignore
../../../flutter/third_party/libtess2/Contrib/nanosvg.c
../../../flutter/third_party/libtess2/Contrib/nanosvg.h
../../../flutter/third_party/libtess2/Example
../../../flutter/third_party/libtess2/README.md
../../../flutter/third_party/libtess2/alg_outline.md
../../../flutter/third_party/libwebp/.cmake-format.py
../../../flutter/third_party/libwebp/.git
../../../flutter/third_party/libwebp/.gitattributes
../../../flutter/third_party/libwebp/.gitignore
../../../flutter/third_party/libwebp/.mailmap
../../../flutter/third_party/libwebp/.style.yapf
../../../flutter/third_party/libwebp/AUTHORS
../../../flutter/third_party/libwebp/Android.mk
../../../flutter/third_party/libwebp/CMakeLists.txt
../../../flutter/third_party/libwebp/CONTRIBUTING.md
../../../flutter/third_party/libwebp/ChangeLog
../../../flutter/third_party/libwebp/Makefile.vc
../../../flutter/third_party/libwebp/NEWS
../../../flutter/third_party/libwebp/PATENTS
../../../flutter/third_party/libwebp/PRESUBMIT.py
../../../flutter/third_party/libwebp/README.md
../../../flutter/third_party/libwebp/build.gradle
../../../flutter/third_party/libwebp/cmake
../../../flutter/third_party/libwebp/codereview.settings
../../../flutter/third_party/libwebp/doc
../../../flutter/third_party/libwebp/examples
../../../flutter/third_party/libwebp/gradle
../../../flutter/third_party/libwebp/gradle.properties
../../../flutter/third_party/libwebp/imageio/Android.mk
../../../flutter/third_party/libwebp/m4/.gitignore
../../../flutter/third_party/libwebp/m4/ax_pthread.m4
../../../flutter/third_party/libwebp/makefile.unix
../../../flutter/third_party/libwebp/man/cwebp.1
../../../flutter/third_party/libwebp/man/dwebp.1
../../../flutter/third_party/libwebp/man/gif2webp.1
../../../flutter/third_party/libwebp/man/img2webp.1
../../../flutter/third_party/libwebp/man/vwebp.1
../../../flutter/third_party/libwebp/man/webpinfo.1
../../../flutter/third_party/libwebp/man/webpmux.1
../../../flutter/third_party/libwebp/swig
../../../flutter/third_party/libwebp/tests
../../../flutter/third_party/libwebp/webp_js
../../../flutter/third_party/ninja
../../../flutter/third_party/ocmock
../../../flutter/third_party/perfetto/.clang-format
../../../flutter/third_party/perfetto/.clang-tidy
../../../flutter/third_party/perfetto/.git
../../../flutter/third_party/perfetto/.gitattributes
../../../flutter/third_party/perfetto/.github
../../../flutter/third_party/perfetto/.gitignore
../../../flutter/third_party/perfetto/.gn
../../../flutter/third_party/perfetto/.style.yapf
../../../flutter/third_party/perfetto/CHANGELOG
../../../flutter/third_party/perfetto/DIR_METADATA
../../../flutter/third_party/perfetto/METADATA
../../../flutter/third_party/perfetto/OWNERS
../../../flutter/third_party/perfetto/PRESUBMIT.py
../../../flutter/third_party/perfetto/README.chromium
../../../flutter/third_party/perfetto/README.md
../../../flutter/third_party/perfetto/WORKSPACE
../../../flutter/third_party/perfetto/bazel/deps.bzl
../../../flutter/third_party/perfetto/bazel/proto_gen.bzl
../../../flutter/third_party/perfetto/bazel/rules.bzl
../../../flutter/third_party/perfetto/bazel/standalone/README.md
../../../flutter/third_party/perfetto/bazel/standalone/perfetto_cfg.bzl
../../../flutter/third_party/perfetto/buildtools/.gitignore
../../../flutter/third_party/perfetto/buildtools/README.md
../../../flutter/third_party/perfetto/codereview.settings
../../../flutter/third_party/perfetto/debian
../../../flutter/third_party/perfetto/docs/.gitignore
../../../flutter/third_party/perfetto/docs/README.md
../../../flutter/third_party/perfetto/examples
../../../flutter/third_party/perfetto/gn/standalone/build_tool_wrapper.py
../../../flutter/third_party/perfetto/gn/standalone/cp.py
../../../flutter/third_party/perfetto/gn/standalone/glob.py
../../../flutter/third_party/perfetto/gn/standalone/protoc.py
../../../flutter/third_party/perfetto/gn/standalone/toolchain/linux_find_llvm.py
../../../flutter/third_party/perfetto/gn/standalone/toolchain/llvm-strip.py
../../../flutter/third_party/perfetto/gn/standalone/toolchain/mac_find_llvm.py
../../../flutter/third_party/perfetto/gn/standalone/toolchain/win_find_msvc.py
../../../flutter/third_party/perfetto/gn/write_buildflag_header.py
../../../flutter/third_party/perfetto/include/README.md
../../../flutter/third_party/perfetto/include/perfetto/README.md
../../../flutter/third_party/perfetto/include/perfetto/profiling/OWNERS
../../../flutter/third_party/perfetto/include/perfetto/test
../../../flutter/third_party/perfetto/include/perfetto/trace_processor/OWNERS
../../../flutter/third_party/perfetto/include/perfetto/tracing/OWNERS
../../../flutter/third_party/perfetto/infra
../../../flutter/third_party/perfetto/meson.build
../../../flutter/third_party/perfetto/protos
../../../flutter/third_party/perfetto/python/README.md
../../../flutter/third_party/perfetto/python/example.py
../../../flutter/third_party/perfetto/python/generators/diff_tests/runner.py
../../../flutter/third_party/perfetto/python/generators/diff_tests/testing.py
../../../flutter/third_party/perfetto/python/generators/diff_tests/utils.py
../../../flutter/third_party/perfetto/python/generators/sql_processing/docs_extractor.py
../../../flutter/third_party/perfetto/python/generators/sql_processing/docs_parse.py
../../../flutter/third_party/perfetto/python/generators/sql_processing/utils.py
../../../flutter/third_party/perfetto/python/generators/trace_processor_table/public.py
../../../flutter/third_party/perfetto/python/generators/trace_processor_table/serialize.py
../../../flutter/third_party/perfetto/python/generators/trace_processor_table/util.py
../../../flutter/third_party/perfetto/python/perfetto/batch_trace_processor/__init__.py
../../../flutter/third_party/perfetto/python/perfetto/batch_trace_processor/api.py
../../../flutter/third_party/perfetto/python/perfetto/batch_trace_processor/platform.py
../../../flutter/third_party/perfetto/python/perfetto/common/repo_utils.py
../../../flutter/third_party/perfetto/python/perfetto/experimental/slice_breakdown/__init__.py
../../../flutter/third_party/perfetto/python/perfetto/experimental/slice_breakdown/breakdown.py
../../../flutter/third_party/perfetto/python/perfetto/prebuilts/manifests/trace_processor_shell.py
../../../flutter/third_party/perfetto/python/perfetto/prebuilts/manifests/tracebox.py
../../../flutter/third_party/perfetto/python/perfetto/prebuilts/manifests/traceconv.py
../../../flutter/third_party/perfetto/python/perfetto/prebuilts/perfetto_prebuilts.py
../../../flutter/third_party/perfetto/python/perfetto/trace_processor
../../../flutter/third_party/perfetto/python/perfetto/trace_uri_resolver/path.py
../../../flutter/third_party/perfetto/python/perfetto/trace_uri_resolver/registry.py
../../../flutter/third_party/perfetto/python/perfetto/trace_uri_resolver/resolver.py
../../../flutter/third_party/perfetto/python/perfetto/trace_uri_resolver/util.py
../../../flutter/third_party/perfetto/python/run_tests.py
../../../flutter/third_party/perfetto/python/setup.py
../../../flutter/third_party/perfetto/python/test
../../../flutter/third_party/perfetto/python/tools/batch_trace_processor_shell.py
../../../flutter/third_party/perfetto/python/tools/check_imports.py
../../../flutter/third_party/perfetto/python/tools/cpu_profile.py
../../../flutter/third_party/perfetto/python/tools/heap_profile.py
../../../flutter/third_party/perfetto/python/tools/record_android_trace.py
../../../flutter/third_party/perfetto/python/tools/slice_breakdown.py
../../../flutter/third_party/perfetto/python/tools/trace_processor.py
../../../flutter/third_party/perfetto/python/tools/tracebox.py
../../../flutter/third_party/perfetto/python/tools/traceconv.py
../../../flutter/third_party/perfetto/python/tools/update_permalink.py
../../../flutter/third_party/perfetto/src/android_internal/README.md
../../../flutter/third_party/perfetto/src/base/base64_unittest.cc
../../../flutter/third_party/perfetto/src/base/circular_queue_unittest.cc
../../../flutter/third_party/perfetto/src/base/flat_hash_map_unittest.cc
../../../flutter/third_party/perfetto/src/base/flat_set_unittest.cc
../../../flutter/third_party/perfetto/src/base/getopt_compat_unittest.cc
../../../flutter/third_party/perfetto/src/base/hash_unittest.cc
../../../flutter/third_party/perfetto/src/base/http/http_server_unittest.cc
../../../flutter/third_party/perfetto/src/base/http/sha1_unittest.cc
../../../flutter/third_party/perfetto/src/base/logging_unittest.cc
../../../flutter/third_party/perfetto/src/base/metatrace_unittest.cc
../../../flutter/third_party/perfetto/src/base/no_destructor_unittest.cc
../../../flutter/third_party/perfetto/src/base/paged_memory_unittest.cc
../../../flutter/third_party/perfetto/src/base/periodic_task_unittest.cc
../../../flutter/third_party/perfetto/src/base/scoped_file_unittest.cc
../../../flutter/third_party/perfetto/src/base/small_vector_unittest.cc
../../../flutter/third_party/perfetto/src/base/status_or_unittest.cc
../../../flutter/third_party/perfetto/src/base/status_unittest.cc
../../../flutter/third_party/perfetto/src/base/string_splitter_unittest.cc
../../../flutter/third_party/perfetto/src/base/string_utils_unittest.cc
../../../flutter/third_party/perfetto/src/base/string_view_unittest.cc
../../../flutter/third_party/perfetto/src/base/string_writer_unittest.cc
../../../flutter/third_party/perfetto/src/base/subprocess_unittest.cc
../../../flutter/third_party/perfetto/src/base/task_runner_unittest.cc
../../../flutter/third_party/perfetto/src/base/temp_file_unittest.cc
../../../flutter/third_party/perfetto/src/base/test
../../../flutter/third_party/perfetto/src/base/thread_checker_unittest.cc
../../../flutter/third_party/perfetto/src/base/thread_task_runner_unittest.cc
../../../flutter/third_party/perfetto/src/base/threading/channel_unittest.cc
../../../flutter/third_party/perfetto/src/base/threading/future_unittest.cc
../../../flutter/third_party/perfetto/src/base/threading/spawn_unittest.cc
../../../flutter/third_party/perfetto/src/base/threading/stream_unittest.cc
../../../flutter/third_party/perfetto/src/base/threading/thread_pool_unittest.cc
../../../flutter/third_party/perfetto/src/base/threading/util_unittest.cc
../../../flutter/third_party/perfetto/src/base/time_unittest.cc
../../../flutter/third_party/perfetto/src/base/unix_socket_unittest.cc
../../../flutter/third_party/perfetto/src/base/utils_unittest.cc
../../../flutter/third_party/perfetto/src/base/uuid_unittest.cc
../../../flutter/third_party/perfetto/src/base/watchdog_posix_unittest.cc
../../../flutter/third_party/perfetto/src/base/watchdog_unittest.cc
../../../flutter/third_party/perfetto/src/base/weak_ptr_unittest.cc
../../../flutter/third_party/perfetto/src/bigtrace/trace_processor_wrapper_unittest.cc
../../../flutter/third_party/perfetto/src/ipc
../../../flutter/third_party/perfetto/src/kallsyms/kernel_symbol_map_unittest.cc
../../../flutter/third_party/perfetto/src/kallsyms/lazy_kernel_symbolizer_unittest.cc
../../../flutter/third_party/perfetto/src/perfetto_cmd/config_unittest.cc
../../../flutter/third_party/perfetto/src/perfetto_cmd/packet_writer_unittest.cc
../../../flutter/third_party/perfetto/src/perfetto_cmd/pbtxt_to_pb_unittest.cc
../../../flutter/third_party/perfetto/src/perfetto_cmd/rate_limiter_unittest.cc
../../../flutter/third_party/perfetto/src/profiling/OWNERS
../../../flutter/third_party/perfetto/src/profiling/common/interner_unittest.cc
../../../flutter/third_party/perfetto/src/profiling/common/proc_cmdline_unittest.cc
../../../flutter/third_party/perfetto/src/profiling/common/proc_utils_unittest.cc
../../../flutter/third_party/perfetto/src/profiling/common/producer_support_unittest.cc
../../../flutter/third_party/perfetto/src/profiling/common/profiler_guardrails_unittest.cc
../../../flutter/third_party/perfetto/src/profiling/deobfuscator_unittest.cc
../../../flutter/third_party/perfetto/src/profiling/memory
../../../flutter/third_party/perfetto/src/profiling/perf/event_config_unittest.cc
../../../flutter/third_party/perfetto/src/profiling/perf/perf_producer_unittest.cc
../../../flutter/third_party/perfetto/src/profiling/perf/unwind_queue_unittest.cc
../../../flutter/third_party/perfetto/src/profiling/symbolizer/breakpad_parser_unittest.cc
../../../flutter/third_party/perfetto/src/profiling/symbolizer/breakpad_symbolizer_unittest.cc
../../../flutter/third_party/perfetto/src/profiling/symbolizer/local_symbolizer_unittest.cc
../../../flutter/third_party/perfetto/src/protozero/copyable_ptr_unittest.cc
../../../flutter/third_party/perfetto/src/protozero/filtering/filter_bytecode_generator_unittest.cc
../../../flutter/third_party/perfetto/src/protozero/filtering/filter_bytecode_parser_unittest.cc
../../../flutter/third_party/perfetto/src/protozero/filtering/filter_util_unittest.cc
../../../flutter/third_party/perfetto/src/protozero/filtering/message_filter_unittest.cc
../../../flutter/third_party/perfetto/src/protozero/filtering/message_tokenizer_unittest.cc
../../../flutter/third_party/perfetto/src/protozero/filtering/string_filter_unittest.cc
../../../flutter/third_party/perfetto/src/protozero/message_arena_unittest.cc
../../../flutter/third_party/perfetto/src/protozero/message_handle_unittest.cc
../../../flutter/third_party/perfetto/src/protozero/message_unittest.cc
../../../flutter/third_party/perfetto/src/protozero/proto_decoder_unittest.cc
../../../flutter/third_party/perfetto/src/protozero/proto_ring_buffer_unittest.cc
../../../flutter/third_party/perfetto/src/protozero/proto_utils_unittest.cc
../../../flutter/third_party/perfetto/src/protozero/scattered_stream_writer_unittest.cc
../../../flutter/third_party/perfetto/src/protozero/test
../../../flutter/third_party/perfetto/src/shared_lib/intern_map_unittest.cc
../../../flutter/third_party/perfetto/src/shared_lib/test
../../../flutter/third_party/perfetto/src/tools
../../../flutter/third_party/perfetto/src/trace_processor
../../../flutter/third_party/perfetto/src/traceconv/trace_to_text_unittest.cc
../../../flutter/third_party/perfetto/src/traced
../../../flutter/third_party/perfetto/src/traced_relay/relay_service_unittest.cc
../../../flutter/third_party/perfetto/src/traced_relay/socket_relay_handler_unittest.cc
../../../flutter/third_party/perfetto/src/tracing
../../../flutter/third_party/perfetto/test
../../../flutter/third_party/perfetto/third_party/.gitignore
../../../flutter/third_party/perfetto/tools/analyze_profiling_sampling_distribution.py
../../../flutter/third_party/perfetto/tools/check_sql_metrics.py
../../../flutter/third_party/perfetto/tools/check_sql_modules.py
../../../flutter/third_party/perfetto/tools/compat.py
../../../flutter/third_party/perfetto/tools/diff_test_trace_processor.py
../../../flutter/third_party/perfetto/tools/download_changed_screenshots.py
../../../flutter/third_party/perfetto/tools/export_power_profiles.py
../../../flutter/third_party/perfetto/tools/find_scan_roots.py
../../../flutter/third_party/perfetto/tools/gen_amalgamated_sql.py
../../../flutter/third_party/perfetto/tools/gen_cc_proto_descriptor.py
../../../flutter/third_party/perfetto/tools/gen_grpc_build_gn.py
../../../flutter/third_party/perfetto/tools/gen_stdlib_docs_json.py
../../../flutter/third_party/perfetto/tools/gen_tp_table_docs.py
../../../flutter/third_party/perfetto/tools/gen_tp_table_headers.py
../../../flutter/third_party/perfetto/tools/gn_utils.py
../../../flutter/third_party/perfetto/tools/measure_tp_performance.py
../../../flutter/third_party/perfetto/tools/print_descriptor.py
../../../flutter/third_party/perfetto/tools/protoc_helper.py
../../../flutter/third_party/perfetto/tools/pull_ftrace_format_files.py
../../../flutter/third_party/perfetto/tools/run_buildtools_binary.py
../../../flutter/third_party/perfetto/tools/serialize_test_trace.py
../../../flutter/third_party/perfetto/tools/setup_all_configs.py
../../../flutter/third_party/perfetto/tools/test_gen_amalgamated.py
../../../flutter/third_party/perfetto/tools/touch_file.py
../../../flutter/third_party/perfetto/tools/write_version_header.py
../../../flutter/third_party/perfetto/ui/.clang-format
../../../flutter/third_party/perfetto/ui/.eslintrc.js
../../../flutter/third_party/perfetto/ui/.gitignore
../../../flutter/third_party/perfetto/ui/OWNERS
../../../flutter/third_party/perfetto/ui/PRESUBMIT.py
../../../flutter/third_party/perfetto/ui/README.md
../../../flutter/third_party/perfetto/ui/config/.gitignore
../../../flutter/third_party/perfetto/ui/package.json
../../../flutter/third_party/perfetto/ui/pnpm-lock.yaml
../../../flutter/third_party/perfetto/ui/release/OWNERS
../../../flutter/third_party/perfetto/ui/release/build_all_channels.py
../../../flutter/third_party/perfetto/ui/release/roll_branch.py
../../../flutter/third_party/perfetto/ui/src/assets/.gitignore
../../../flutter/third_party/perfetto/ui/src/base/array_utils_unittest.ts
../../../flutter/third_party/perfetto/ui/src/base/bigint_math_unittest.ts
../../../flutter/third_party/perfetto/ui/src/base/binary_search_unittest.ts
../../../flutter/third_party/perfetto/ui/src/base/classnames_unittest.ts
../../../flutter/third_party/perfetto/ui/src/base/deferred_unittest.ts
../../../flutter/third_party/perfetto/ui/src/base/disposable_unittest.ts
../../../flutter/third_party/perfetto/ui/src/base/dom_utils_unittest.ts
../../../flutter/third_party/perfetto/ui/src/base/fuzzy_unittest.ts
../../../flutter/third_party/perfetto/ui/src/base/hotkeys_unittest.ts
../../../flutter/third_party/perfetto/ui/src/base/json_utils_unittest.ts
../../../flutter/third_party/perfetto/ui/src/base/object_utils_unittest.ts
../../../flutter/third_party/perfetto/ui/src/base/set_utils_unittest.ts
../../../flutter/third_party/perfetto/ui/src/base/string_utils_unittest.ts
../../../flutter/third_party/perfetto/ui/src/base/time_unittest.ts
../../../flutter/third_party/perfetto/ui/src/base/utils/package.json
../../../flutter/third_party/perfetto/ui/src/base/validators_unittest.ts
../../../flutter/third_party/perfetto/ui/src/common/actions_unittest.ts
../../../flutter/third_party/perfetto/ui/src/common/canvas_utils_unittest.ts
../../../flutter/third_party/perfetto/ui/src/common/colorizer_unittest.ts
../../../flutter/third_party/perfetto/ui/src/common/dragndrop_logic_unittest.ts
../../../flutter/third_party/perfetto/ui/src/common/event_set_unittest.ts
../../../flutter/third_party/perfetto/ui/src/common/feature_flags_unittest.ts
../../../flutter/third_party/perfetto/ui/src/common/flamegraph_unittest.ts
../../../flutter/third_party/perfetto/ui/src/common/high_precision_time_unittest.ts
../../../flutter/third_party/perfetto/ui/src/common/metatracing_unittest.ts
../../../flutter/third_party/perfetto/ui/src/common/plugins_unittest.ts
../../../flutter/third_party/perfetto/ui/src/common/proto_ring_buffer_unittest.ts
../../../flutter/third_party/perfetto/ui/src/common/protos_unittest.ts
../../../flutter/third_party/perfetto/ui/src/common/query_result_unittest.ts
../../../flutter/third_party/perfetto/ui/src/common/query_utils_unittest.ts
../../../flutter/third_party/perfetto/ui/src/common/recordingV2/target_factories/android_websocket_target_factory_unittest.ts
../../../flutter/third_party/perfetto/ui/src/common/recordingV2/target_factories/chrome_target_factory_unittest.ts
../../../flutter/third_party/perfetto/ui/src/common/registry_unittest.ts
../../../flutter/third_party/perfetto/ui/src/common/schema_unittest.ts
../../../flutter/third_party/perfetto/ui/src/common/state_unittest.ts
../../../flutter/third_party/perfetto/ui/src/common/upload_utils_unittest.ts
../../../flutter/third_party/perfetto/ui/src/controller/area_selection_handler_unittest.ts
../../../flutter/third_party/perfetto/ui/src/controller/args_parser_unittest.ts
../../../flutter/third_party/perfetto/ui/src/controller/controller_unittest.ts
../../../flutter/third_party/perfetto/ui/src/controller/pivot_table_tree_builder_unittest.ts
../../../flutter/third_party/perfetto/ui/src/core/perf_unittest.ts
../../../flutter/third_party/perfetto/ui/src/frontend/base_slice_track_unittest.ts
../../../flutter/third_party/perfetto/ui/src/frontend/flamegraph_unittest.ts
../../../flutter/third_party/perfetto/ui/src/frontend/gridline_helper_unittest.ts
../../../flutter/third_party/perfetto/ui/src/frontend/query_table_unittest.ts
../../../flutter/third_party/perfetto/ui/src/frontend/router_unittest.ts
../../../flutter/third_party/perfetto/ui/src/frontend/sql_table/column_unittest.ts
../../../flutter/third_party/perfetto/ui/src/frontend/sql_table/state_unittest.ts
../../../flutter/third_party/perfetto/ui/src/frontend/sql_utils_unittest.ts
../../../flutter/third_party/perfetto/ui/src/frontend/store_unittest.ts
../../../flutter/third_party/perfetto/ui/src/frontend/task_tracker_unittest.ts
../../../flutter/third_party/perfetto/ui/src/frontend/time_scale_unittest.ts
../../../flutter/third_party/perfetto/ui/src/frontend/track_cache_unittest.ts
../../../flutter/third_party/perfetto/ui/src/plugins/com.example.Skeleton/OWNERS
../../../flutter/third_party/perfetto/ui/src/plugins/dev.perfetto.AndroidCujs/OWNERS
../../../flutter/third_party/perfetto/ui/src/plugins/dev.perfetto.AndroidPerf/OWNERS
../../../flutter/third_party/perfetto/ui/src/plugins/dev.perfetto.LargeScreensPerf/OWNERS
../../../flutter/third_party/perfetto/ui/src/test
../../../flutter/third_party/pkg/archive
../../../flutter/third_party/pkg/equatable
../../../flutter/third_party/pkg/flutter_packages
../../../flutter/third_party/pkg/gcloud
../../../flutter/third_party/pkg/googleapis
../../../flutter/third_party/pkg/platform
../../../flutter/third_party/pkg/process
../../../flutter/third_party/pkg/process_runner
../../../flutter/third_party/pkg/vector_math
../../../flutter/third_party/protobuf
../../../flutter/third_party/pyyaml
../../../flutter/third_party/rapidjson/.git
../../../flutter/third_party/rapidjson/.gitattributes
../../../flutter/third_party/rapidjson/.gitignore
../../../flutter/third_party/rapidjson/.gitmodules
../../../flutter/third_party/rapidjson/.travis.yml
../../../flutter/third_party/rapidjson/CHANGELOG.md
../../../flutter/third_party/rapidjson/CMakeLists.txt
../../../flutter/third_party/rapidjson/CMakeModules/FindGTestSrc.cmake
../../../flutter/third_party/rapidjson/README.fuchsia
../../../flutter/third_party/rapidjson/README.fuchsia.md
../../../flutter/third_party/rapidjson/RapidJSON.pc.in
../../../flutter/third_party/rapidjson/RapidJSONConfig.cmake.in
../../../flutter/third_party/rapidjson/RapidJSONConfigVersion.cmake.in
../../../flutter/third_party/rapidjson/appveyor.yml
../../../flutter/third_party/rapidjson/contrib
../../../flutter/third_party/rapidjson/doc
../../../flutter/third_party/rapidjson/docker/debian/Dockerfile
../../../flutter/third_party/rapidjson/example
../../../flutter/third_party/rapidjson/include_dirs.js
../../../flutter/third_party/rapidjson/library.json
../../../flutter/third_party/rapidjson/package.json
../../../flutter/third_party/rapidjson/rapidjson.autopkg
../../../flutter/third_party/rapidjson/readme.md
../../../flutter/third_party/rapidjson/readme.zh-cn.md
../../../flutter/third_party/rapidjson/test
../../../flutter/third_party/shaderc/.clang-format
../../../flutter/third_party/shaderc/.git
../../../flutter/third_party/shaderc/.github
../../../flutter/third_party/shaderc/.gitignore
../../../flutter/third_party/shaderc/AUTHORS
../../../flutter/third_party/shaderc/Android.mk
../../../flutter/third_party/shaderc/CHANGES
../../../flutter/third_party/shaderc/CMakeLists.txt
../../../flutter/third_party/shaderc/CONTRIBUTING.md
../../../flutter/third_party/shaderc/CONTRIBUTORS
../../../flutter/third_party/shaderc/DEPS
../../../flutter/third_party/shaderc/Dockerfile
../../../flutter/third_party/shaderc/README.md
../../../flutter/third_party/shaderc/android_test/Android.mk
../../../flutter/third_party/shaderc/android_test/jni/Android.mk
../../../flutter/third_party/shaderc/android_test/jni/Application.mk
../../../flutter/third_party/shaderc/cmake
../../../flutter/third_party/shaderc/examples
../../../flutter/third_party/shaderc/glslc/CMakeLists.txt
../../../flutter/third_party/shaderc/glslc/README.asciidoc
../../../flutter/third_party/shaderc/glslc/test
../../../flutter/third_party/shaderc/libshaderc/Android.mk
../../../flutter/third_party/shaderc/libshaderc/CMakeLists.txt
../../../flutter/third_party/shaderc/libshaderc/README.md
../../../flutter/third_party/shaderc/libshaderc_util/Android.mk
../../../flutter/third_party/shaderc/libshaderc_util/CMakeLists.txt
../../../flutter/third_party/shaderc/libshaderc_util/testdata
../../../flutter/third_party/shaderc/license-checker.cfg
../../../flutter/third_party/shaderc/third_party/Android.mk
../../../flutter/third_party/shaderc/third_party/CMakeLists.txt
../../../flutter/third_party/shaderc/third_party/LICENSE.glslang
../../../flutter/third_party/shaderc/third_party/LICENSE.spirv-tools
../../../flutter/third_party/shaderc/utils/add_copyright.py
../../../flutter/third_party/shaderc/utils/remove-file-by-suffix.py
../../../flutter/third_party/shaderc/utils/update_build_version.py
../../../flutter/third_party/skia
../../../flutter/third_party/skia/.bazelrc
../../../flutter/third_party/skia/.bazelversion
../../../flutter/third_party/skia/.clang-format
../../../flutter/third_party/skia/.clang-tidy
../../../flutter/third_party/skia/.git
../../../flutter/third_party/skia/.gitignore
../../../flutter/third_party/skia/.gn
../../../flutter/third_party/skia/.vpython
../../../flutter/third_party/skia/AUTHORS
../../../flutter/third_party/skia/BUILD.bazel
../../../flutter/third_party/skia/CONTRIBUTING
../../../flutter/third_party/skia/CQ_COMMITTERS
../../../flutter/third_party/skia/DEPS
../../../flutter/third_party/skia/DIR_METADATA
../../../flutter/third_party/skia/OWNERS
../../../flutter/third_party/skia/OWNERS.android
../../../flutter/third_party/skia/PRESUBMIT.py
../../../flutter/third_party/skia/PRESUBMIT_test.py
../../../flutter/third_party/skia/PRESUBMIT_test_mocks.py
../../../flutter/third_party/skia/README
../../../flutter/third_party/skia/README.chromium
../../../flutter/third_party/skia/WORKSPACE.bazel
../../../flutter/third_party/skia/bazel
../../../flutter/third_party/skia/bench
../../../flutter/third_party/skia/codereview.settings
../../../flutter/third_party/skia/defines.bzl
../../../flutter/third_party/skia/demos.skia.org
../../../flutter/third_party/skia/docker/Makefile
../../../flutter/third_party/skia/docker/README.md
../../../flutter/third_party/skia/docker/binary-size/Dockerfile
../../../flutter/third_party/skia/docker/cmake-release/Dockerfile
../../../flutter/third_party/skia/docker/skia-build-tools/Dockerfile
../../../flutter/third_party/skia/docker/skia-release/Dockerfile
../../../flutter/third_party/skia/docker/skia-wasm-release/Dockerfile
../../../flutter/third_party/skia/docker/skia-with-swift-shader-base/Dockerfile
../../../flutter/third_party/skia/docs
../../../flutter/third_party/skia/example
../../../flutter/third_party/skia/experimental
../../../flutter/third_party/skia/fuzz/README.md
../../../flutter/third_party/skia/gm/BUILD.bazel
../../../flutter/third_party/skia/gm/png_codec.bzl
../../../flutter/third_party/skia/gn/BUILD.bazel
../../../flutter/third_party/skia/gn/__init__.py
../../../flutter/third_party/skia/gn/bazel_build.py
../../../flutter/third_party/skia/gn/call.py
../../../flutter/third_party/skia/gn/checkdir.py
../../../flutter/third_party/skia/gn/codesign_ios.py
../../../flutter/third_party/skia/gn/compile_ib_files.py
../../../flutter/third_party/skia/gn/compile_sksl_tests.py
../../../flutter/third_party/skia/gn/copy_git_directory.py
../../../flutter/third_party/skia/gn/cp.py
../../../flutter/third_party/skia/gn/find_headers.py
../../../flutter/third_party/skia/gn/find_msvc.py
../../../flutter/third_party/skia/gn/find_xcode_sysroot.py
../../../flutter/third_party/skia/gn/gen_plist_ios.py
../../../flutter/third_party/skia/gn/gn_meta_sln.py
../../../flutter/third_party/skia/gn/gn_to_bp.py
../../../flutter/third_party/skia/gn/gn_to_bp_utils.py
../../../flutter/third_party/skia/gn/gn_to_cmake.py
../../../flutter/third_party/skia/gn/highest_version_dir.py
../../../flutter/third_party/skia/gn/is_clang.py
../../../flutter/third_party/skia/gn/make_gm_gni.py
../../../flutter/third_party/skia/gn/minify_sksl.py
../../../flutter/third_party/skia/gn/minify_sksl_tests.py
../../../flutter/third_party/skia/gn/push_to_android.py
../../../flutter/third_party/skia/gn/rm.py
../../../flutter/third_party/skia/gn/run_sksllex.py
../../../flutter/third_party/skia/gn/skqp_gn_args.py
../../../flutter/third_party/skia/gn/toolchain/num_cpus.py
../../../flutter/third_party/skia/go_repositories.bzl
../../../flutter/third_party/skia/include/BUILD.bazel
../../../flutter/third_party/skia/include/OWNERS
../../../flutter/third_party/skia/include/android/BUILD.bazel
../../../flutter/third_party/skia/include/codec/BUILD.bazel
../../../flutter/third_party/skia/include/config/BUILD.bazel
../../../flutter/third_party/skia/include/config/OWNERS
../../../flutter/third_party/skia/include/config/WORKSPACE.bazel
../../../flutter/third_party/skia/include/config/copts.bzl
../../../flutter/third_party/skia/include/config/linkopts.bzl
../../../flutter/third_party/skia/include/core/BUILD.bazel
../../../flutter/third_party/skia/include/docs/BUILD.bazel
../../../flutter/third_party/skia/include/effects/BUILD.bazel
../../../flutter/third_party/skia/include/encode/BUILD.bazel
../../../flutter/third_party/skia/include/gpu/BUILD.bazel
../../../flutter/third_party/skia/include/gpu/d3d/BUILD.bazel
../../../flutter/third_party/skia/include/gpu/ganesh/BUILD.bazel
../../../flutter/third_party/skia/include/gpu/ganesh/gl/BUILD.bazel
../../../flutter/third_party/skia/include/gpu/ganesh/mtl/BUILD.bazel
../../../flutter/third_party/skia/include/gpu/ganesh/vk/BUILD.bazel
../../../flutter/third_party/skia/include/gpu/gl/BUILD.bazel
../../../flutter/third_party/skia/include/gpu/gl/egl/BUILD.bazel
../../../flutter/third_party/skia/include/gpu/gl/epoxy/BUILD.bazel
../../../flutter/third_party/skia/include/gpu/gl/glx/BUILD.bazel
../../../flutter/third_party/skia/include/gpu/graphite/mtl/BUILD.bazel
../../../flutter/third_party/skia/include/gpu/mock/BUILD.bazel
../../../flutter/third_party/skia/include/gpu/mtl/BUILD.bazel
../../../flutter/third_party/skia/include/gpu/vk/BUILD.bazel
../../../flutter/third_party/skia/include/pathops/BUILD.bazel
../../../flutter/third_party/skia/include/ports/BUILD.bazel
../../../flutter/third_party/skia/include/private/BUILD.bazel
../../../flutter/third_party/skia/include/private/OWNERS
../../../flutter/third_party/skia/include/private/base/BUILD.bazel
../../../flutter/third_party/skia/include/private/base/README.md
../../../flutter/third_party/skia/include/private/chromium/BUILD.bazel
../../../flutter/third_party/skia/include/private/gpu/BUILD.bazel
../../../flutter/third_party/skia/include/private/gpu/ganesh/BUILD.bazel
../../../flutter/third_party/skia/include/private/gpu/vk/BUILD.bazel
../../../flutter/third_party/skia/include/sksl/BUILD.bazel
../../../flutter/third_party/skia/include/sksl/OWNERS
../../../flutter/third_party/skia/include/svg/BUILD.bazel
../../../flutter/third_party/skia/include/third_party/vulkan/BUILD.bazel
../../../flutter/third_party/skia/include/utils/BUILD.bazel
../../../flutter/third_party/skia/include/utils/mac/BUILD.bazel
../../../flutter/third_party/skia/infra
../../../flutter/third_party/skia/modules/bentleyottmann/BUILD.bazel
../../../flutter/third_party/skia/modules/bentleyottmann/include/BUILD.bazel
../../../flutter/third_party/skia/modules/bentleyottmann/src/BUILD.bazel
../../../flutter/third_party/skia/modules/bentleyottmann/tests
../../../flutter/third_party/skia/modules/canvaskit/.gitignore
../../../flutter/third_party/skia/modules/canvaskit/BUILD.bazel
../../../flutter/third_party/skia/modules/canvaskit/CHANGELOG.md
../../../flutter/third_party/skia/modules/canvaskit/Makefile
../../../flutter/third_party/skia/modules/canvaskit/README.md
../../../flutter/third_party/skia/modules/canvaskit/external_test/.gitignore
../../../flutter/third_party/skia/modules/canvaskit/external_test/Makefile
../../../flutter/third_party/skia/modules/canvaskit/external_test/typescript_browser/package.json
../../../flutter/third_party/skia/modules/canvaskit/external_test/typescript_browser_es6/package.json
../../../flutter/third_party/skia/modules/canvaskit/fonts/README.md
../../../flutter/third_party/skia/modules/canvaskit/go/gold_test_env
../../../flutter/third_party/skia/modules/canvaskit/npm_build/.gitignore
../../../flutter/third_party/skia/modules/canvaskit/npm_build/CODE_OF_CONDUCT.md
../../../flutter/third_party/skia/modules/canvaskit/npm_build/CONTRIBUTING.md
../../../flutter/third_party/skia/modules/canvaskit/npm_build/README.md
../../../flutter/third_party/skia/modules/canvaskit/npm_build/example.html
../../../flutter/third_party/skia/modules/canvaskit/npm_build/package.json
../../../flutter/third_party/skia/modules/canvaskit/npm_build/types/README.md
../../../flutter/third_party/skia/modules/canvaskit/package.json
../../../flutter/third_party/skia/modules/canvaskit/tests
../../../flutter/third_party/skia/modules/canvaskit/wasm_tools/SIMD/.gitignore
../../../flutter/third_party/skia/modules/jetski/BUILD.bazel
../../../flutter/third_party/skia/modules/jetski/README
../../../flutter/third_party/skia/modules/pathkit/.gitignore
../../../flutter/third_party/skia/modules/pathkit/BUILD.bazel
../../../flutter/third_party/skia/modules/pathkit/CHANGELOG.md
../../../flutter/third_party/skia/modules/pathkit/Makefile
../../../flutter/third_party/skia/modules/pathkit/README.md
../../../flutter/third_party/skia/modules/pathkit/npm-asmjs/CODE_OF_CONDUCT.md
../../../flutter/third_party/skia/modules/pathkit/npm-asmjs/CONTRIBUTING.md
../../../flutter/third_party/skia/modules/pathkit/npm-asmjs/README.md
../../../flutter/third_party/skia/modules/pathkit/npm-asmjs/example.html
../../../flutter/third_party/skia/modules/pathkit/npm-asmjs/package.json
../../../flutter/third_party/skia/modules/pathkit/npm-wasm/CODE_OF_CONDUCT.md
../../../flutter/third_party/skia/modules/pathkit/npm-wasm/CONTRIBUTING.md
../../../flutter/third_party/skia/modules/pathkit/npm-wasm/README.md
../../../flutter/third_party/skia/modules/pathkit/npm-wasm/example.html
../../../flutter/third_party/skia/modules/pathkit/npm-wasm/package.json
../../../flutter/third_party/skia/modules/pathkit/package.json
../../../flutter/third_party/skia/modules/pathkit/tests
../../../flutter/third_party/skia/modules/skcms/BUILD.bazel
../../../flutter/third_party/skia/modules/skcms/OWNERS
../../../flutter/third_party/skia/modules/skcms/README.chromium
../../../flutter/third_party/skia/modules/skcms/version.sha1
../../../flutter/third_party/skia/modules/skottie/BUILD.bazel
../../../flutter/third_party/skia/modules/skottie/fuzz/BUILD.bazel
../../../flutter/third_party/skia/modules/skottie/gm/BUILD.bazel
../../../flutter/third_party/skia/modules/skottie/include/BUILD.bazel
../../../flutter/third_party/skia/modules/skottie/src/BUILD.bazel
../../../flutter/third_party/skia/modules/skottie/src/animator/BUILD.bazel
../../../flutter/third_party/skia/modules/skottie/src/effects/BUILD.bazel
../../../flutter/third_party/skia/modules/skottie/src/layers/BUILD.bazel
../../../flutter/third_party/skia/modules/skottie/src/layers/shapelayer/BUILD.bazel
../../../flutter/third_party/skia/modules/skottie/src/text/BUILD.bazel
../../../flutter/third_party/skia/modules/skottie/tests
../../../flutter/third_party/skia/modules/skottie/utils/BUILD.bazel
../../../flutter/third_party/skia/modules/skparagraph/BUILD.bazel
../../../flutter/third_party/skia/modules/skparagraph/bench/BUILD.bazel
../../../flutter/third_party/skia/modules/skparagraph/gm/BUILD.bazel
../../../flutter/third_party/skia/modules/skparagraph/include/BUILD.bazel
../../../flutter/third_party/skia/modules/skparagraph/slides/BUILD.bazel
../../../flutter/third_party/skia/modules/skparagraph/src/BUILD.bazel
../../../flutter/third_party/skia/modules/skparagraph/tests
../../../flutter/third_party/skia/modules/skparagraph/utils/BUILD.bazel
../../../flutter/third_party/skia/modules/skplaintexteditor/README.md
../../../flutter/third_party/skia/modules/skresources/BUILD.bazel
../../../flutter/third_party/skia/modules/skresources/include/BUILD.bazel
../../../flutter/third_party/skia/modules/skresources/src/BUILD.bazel
../../../flutter/third_party/skia/modules/sksg/BUILD.bazel
../../../flutter/third_party/skia/modules/sksg/include/BUILD.bazel
../../../flutter/third_party/skia/modules/sksg/slides/BUILD.bazel
../../../flutter/third_party/skia/modules/sksg/src/BUILD.bazel
../../../flutter/third_party/skia/modules/sksg/tests
../../../flutter/third_party/skia/modules/skshaper/BUILD.bazel
../../../flutter/third_party/skia/modules/skshaper/include/BUILD.bazel
../../../flutter/third_party/skia/modules/skshaper/src/BUILD.bazel
../../../flutter/third_party/skia/modules/skshaper/tests
../../../flutter/third_party/skia/modules/skunicode/BUILD.bazel
../../../flutter/third_party/skia/modules/skunicode/include/BUILD.bazel
../../../flutter/third_party/skia/modules/skunicode/src/BUILD.bazel
../../../flutter/third_party/skia/modules/skunicode/tests
../../../flutter/third_party/skia/modules/svg/include/BUILD.bazel
../../../flutter/third_party/skia/modules/svg/src/BUILD.bazel
../../../flutter/third_party/skia/modules/svg/tests
../../../flutter/third_party/skia/modules/svg/utils/BUILD.bazel
../../../flutter/third_party/skia/package.json
../../../flutter/third_party/skia/platform_tools
../../../flutter/third_party/skia/public.bzl
../../../flutter/third_party/skia/relnotes/README.md
../../../flutter/third_party/skia/requirements.txt
../../../flutter/third_party/skia/resources
../../../flutter/third_party/skia/site
../../../flutter/third_party/skia/specs
../../../flutter/third_party/skia/src/BUILD.bazel
../../../flutter/third_party/skia/src/android/BUILD.bazel
../../../flutter/third_party/skia/src/base/BUILD.bazel
../../../flutter/third_party/skia/src/base/README.md
../../../flutter/third_party/skia/src/codec/BUILD.bazel
../../../flutter/third_party/skia/src/core/BUILD.bazel
../../../flutter/third_party/skia/src/effects/BUILD.bazel
../../../flutter/third_party/skia/src/effects/colorfilters/BUILD.bazel
../../../flutter/third_party/skia/src/effects/imagefilters/BUILD.bazel
../../../flutter/third_party/skia/src/encode/BUILD.bazel
../../../flutter/third_party/skia/src/fonts/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/android/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/d3d/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/effects/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/geometry/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/gl/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/gl/android/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/gl/builders/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/gl/egl/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/gl/epoxy/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/gl/glx/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/gl/iOS/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/gl/mac/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/gl/webgl/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/gl/win/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/glsl/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/gradients/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/gradients/README.md
../../../flutter/third_party/skia/src/gpu/ganesh/image/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/mock/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/mtl/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/ops/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/surface/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/tessellate/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/text/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/ganesh/vk/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/mtl/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/tessellate/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/vk/BUILD.bazel
../../../flutter/third_party/skia/src/gpu/vk/vulkanmemoryallocator/BUILD.bazel
../../../flutter/third_party/skia/src/image/BUILD.bazel
../../../flutter/third_party/skia/src/lazy/BUILD.bazel
../../../flutter/third_party/skia/src/opts/BUILD.bazel
../../../flutter/third_party/skia/src/pathops/BUILD.bazel
../../../flutter/third_party/skia/src/pdf/BUILD.bazel
../../../flutter/third_party/skia/src/ports/BUILD.bazel
../../../flutter/third_party/skia/src/ports/fontations/BUILD.bazel
../../../flutter/third_party/skia/src/sfnt/BUILD.bazel
../../../flutter/third_party/skia/src/shaders/BUILD.bazel
../../../flutter/third_party/skia/src/shaders/gradients/BUILD.bazel
../../../flutter/third_party/skia/src/sksl/BUILD.bazel
../../../flutter/third_party/skia/src/sksl/README.md
../../../flutter/third_party/skia/src/sksl/analysis/BUILD.bazel
../../../flutter/third_party/skia/src/sksl/codegen/BUILD.bazel
../../../flutter/third_party/skia/src/sksl/ir/BUILD.bazel
../../../flutter/third_party/skia/src/sksl/lex/BUILD.bazel
../../../flutter/third_party/skia/src/sksl/tracing/BUILD.bazel
../../../flutter/third_party/skia/src/sksl/transform/BUILD.bazel
../../../flutter/third_party/skia/src/svg/BUILD.bazel
../../../flutter/third_party/skia/src/text/BUILD.bazel
../../../flutter/third_party/skia/src/text/gpu/BUILD.bazel
../../../flutter/third_party/skia/src/utils/BUILD.bazel
../../../flutter/third_party/skia/src/utils/mac/BUILD.bazel
../../../flutter/third_party/skia/src/utils/win/BUILD.bazel
../../../flutter/third_party/skia/src/xml/BUILD.bazel
../../../flutter/third_party/skia/src/xps/BUILD.bazel
../../../flutter/third_party/skia/tests
../../../flutter/third_party/skia/third_party/README
../../../flutter/third_party/skia/third_party/etc1/BUILD.bazel
../../../flutter/third_party/skia/third_party/etc1/README.google
../../../flutter/third_party/skia/third_party/freetype2
../../../flutter/third_party/skia/third_party/harfbuzz/README
../../../flutter/third_party/skia/third_party/icu
../../../flutter/third_party/skia/third_party/libgrapheme/generate_headers.py
../../../flutter/third_party/skia/third_party/libjpeg-turbo
../../../flutter/third_party/skia/third_party/libpng
../../../flutter/third_party/skia/third_party/lua
../../../flutter/third_party/skia/third_party/vello
../../../flutter/third_party/skia/third_party/vulkanmemoryallocator/BUILD.bazel
../../../flutter/third_party/skia/toolchain/BUILD.bazel
../../../flutter/third_party/skia/toolchain/android_trampolines/gen_trampolines/BUILD.bazel
../../../flutter/third_party/skia/toolchain/clang_layering_check.bzl
../../../flutter/third_party/skia/toolchain/download_linux_amd64_toolchain.bzl
../../../flutter/third_party/skia/toolchain/download_mac_toolchain.bzl
../../../flutter/third_party/skia/toolchain/download_ndk_linux_amd64_toolchain.bzl
../../../flutter/third_party/skia/toolchain/download_toolchains.bzl
../../../flutter/third_party/skia/toolchain/linux_amd64_toolchain_config.bzl
../../../flutter/third_party/skia/toolchain/mac_toolchain_config.bzl
../../../flutter/third_party/skia/toolchain/ndk_linux_arm64_toolchain_config.bzl
../../../flutter/third_party/skia/toolchain/utils.bzl
../../../flutter/third_party/skia/tools
../../../flutter/third_party/spring_animation/README.md
../../../flutter/third_party/sqlite/.git
../../../flutter/third_party/sqlite/.gitignore
../../../flutter/third_party/sqlite/GIT_REVISION
../../../flutter/third_party/sqlite/LAST_UPDATE
../../../flutter/third_party/sqlite/Makefile
../../../flutter/third_party/sqlite/README.md
../../../flutter/third_party/sqlite/VERSION
../../../flutter/third_party/stb
../../../flutter/third_party/swiftshader
../../../flutter/third_party/test_shaders
../../../flutter/third_party/tinygltf
../../../flutter/third_party/tonic/.clang-format
../../../flutter/third_party/tonic/AUTHORS
../../../flutter/third_party/tonic/PATENTS
../../../flutter/third_party/tonic/README.md
../../../flutter/third_party/tonic/file_loader/file_loader_unittests.cc
../../../flutter/third_party/tonic/filesystem/README.md
../../../flutter/third_party/tonic/filesystem/tests
../../../flutter/third_party/tonic/tests
../../../flutter/third_party/txt/.clang-format
../../../flutter/third_party/txt/.gitattributes
../../../flutter/third_party/txt/.gitignore
../../../flutter/third_party/txt/tests
../../../flutter/third_party/txt/third_party/fonts
../../../flutter/third_party/vulkan-deps/.git
../../../flutter/third_party/vulkan-deps/.gitattributes
../../../flutter/third_party/vulkan-deps/.gitignore
../../../flutter/third_party/vulkan-deps/.gitmodules
../../../flutter/third_party/vulkan-deps/DEPS
../../../flutter/third_party/vulkan-deps/OWNERS
../../../flutter/third_party/vulkan-deps/README.chromium
../../../flutter/third_party/vulkan-deps/README.md
../../../flutter/third_party/vulkan-deps/additional_readme_paths.json
../../../flutter/third_party/vulkan-deps/glslang/DIR_METADATA
../../../flutter/third_party/vulkan-deps/glslang/LICENSE
../../../flutter/third_party/vulkan-deps/glslang/README.chromium
../../../flutter/third_party/vulkan-deps/glslang/src/.clang-format
../../../flutter/third_party/vulkan-deps/glslang/src/.git
../../../flutter/third_party/vulkan-deps/glslang/src/.gitattributes
../../../flutter/third_party/vulkan-deps/glslang/src/.github
../../../flutter/third_party/vulkan-deps/glslang/src/.gitignore
../../../flutter/third_party/vulkan-deps/glslang/src/.gn
../../../flutter/third_party/vulkan-deps/glslang/src/.mailmap
../../../flutter/third_party/vulkan-deps/glslang/src/Android.mk
../../../flutter/third_party/vulkan-deps/glslang/src/CHANGES.md
../../../flutter/third_party/vulkan-deps/glslang/src/CMakeLists.txt
../../../flutter/third_party/vulkan-deps/glslang/src/CODE_OF_CONDUCT.md
../../../flutter/third_party/vulkan-deps/glslang/src/DEPS
../../../flutter/third_party/vulkan-deps/glslang/src/External/CMakeLists.txt
../../../flutter/third_party/vulkan-deps/glslang/src/LICENSE.txt
../../../flutter/third_party/vulkan-deps/glslang/src/README-spirv-remap.txt
../../../flutter/third_party/vulkan-deps/glslang/src/README.md
../../../flutter/third_party/vulkan-deps/glslang/src/SECURITY.md
../../../flutter/third_party/vulkan-deps/glslang/src/SPIRV/CMakeLists.txt
../../../flutter/third_party/vulkan-deps/glslang/src/StandAlone/CMakeLists.txt
../../../flutter/third_party/vulkan-deps/glslang/src/Test
../../../flutter/third_party/vulkan-deps/glslang/src/_config.yml
../../../flutter/third_party/vulkan-deps/glslang/src/build_info.py
../../../flutter/third_party/vulkan-deps/glslang/src/gen_extension_headers.py
../../../flutter/third_party/vulkan-deps/glslang/src/glslang/CMakeLists.txt
../../../flutter/third_party/vulkan-deps/glslang/src/glslang/OSDependent/Unix/CMakeLists.txt
../../../flutter/third_party/vulkan-deps/glslang/src/glslang/OSDependent/Web
../../../flutter/third_party/vulkan-deps/glslang/src/glslang/OSDependent/Windows/CMakeLists.txt
../../../flutter/third_party/vulkan-deps/glslang/src/gtests/CMakeLists.txt
../../../flutter/third_party/vulkan-deps/glslang/src/gtests/README.md
../../../flutter/third_party/vulkan-deps/glslang/src/known_good.json
../../../flutter/third_party/vulkan-deps/glslang/src/known_good_khr.json
../../../flutter/third_party/vulkan-deps/glslang/src/kokoro
../../../flutter/third_party/vulkan-deps/glslang/src/license-checker.cfg
../../../flutter/third_party/vulkan-deps/glslang/src/ndk_test/Android.mk
../../../flutter/third_party/vulkan-deps/glslang/src/ndk_test/jni/Application.mk
../../../flutter/third_party/vulkan-deps/glslang/src/parse_version.cmake
../../../flutter/third_party/vulkan-deps/glslang/src/update_glslang_sources.py
../../../flutter/third_party/vulkan-deps/spirv-cross/DIR_METADATA
../../../flutter/third_party/vulkan-deps/spirv-cross/README.chromium
../../../flutter/third_party/vulkan-deps/spirv-cross/src/.clang-format
../../../flutter/third_party/vulkan-deps/spirv-cross/src/.git
../../../flutter/third_party/vulkan-deps/spirv-cross/src/.github
../../../flutter/third_party/vulkan-deps/spirv-cross/src/.gitignore
../../../flutter/third_party/vulkan-deps/spirv-cross/src/.reuse
../../../flutter/third_party/vulkan-deps/spirv-cross/src/CMakeLists.txt
../../../flutter/third_party/vulkan-deps/spirv-cross/src/CODE_OF_CONDUCT.adoc
../../../flutter/third_party/vulkan-deps/spirv-cross/src/LICENSES
../../../flutter/third_party/vulkan-deps/spirv-cross/src/Makefile
../../../flutter/third_party/vulkan-deps/spirv-cross/src/README.md
../../../flutter/third_party/vulkan-deps/spirv-cross/src/appveyor.yml
../../../flutter/third_party/vulkan-deps/spirv-cross/src/cmake
../../../flutter/third_party/vulkan-deps/spirv-cross/src/samples
../../../flutter/third_party/vulkan-deps/spirv-cross/src/shaders
../../../flutter/third_party/vulkan-deps/spirv-cross/src/shaders-hlsl
../../../flutter/third_party/vulkan-deps/spirv-cross/src/shaders-hlsl-no-opt
../../../flutter/third_party/vulkan-deps/spirv-cross/src/shaders-msl
../../../flutter/third_party/vulkan-deps/spirv-cross/src/shaders-msl-no-opt
../../../flutter/third_party/vulkan-deps/spirv-cross/src/shaders-no-opt
../../../flutter/third_party/vulkan-deps/spirv-cross/src/shaders-other
../../../flutter/third_party/vulkan-deps/spirv-cross/src/shaders-reflection
../../../flutter/third_party/vulkan-deps/spirv-cross/src/shaders-ue4
../../../flutter/third_party/vulkan-deps/spirv-cross/src/shaders-ue4-no-opt
../../../flutter/third_party/vulkan-deps/spirv-cross/src/test_shaders.py
../../../flutter/third_party/vulkan-deps/spirv-headers
../../../flutter/third_party/vulkan-deps/spirv-tools
../../../flutter/third_party/vulkan-deps/update-commit-message.py
../../../flutter/third_party/vulkan-deps/vulkan-headers/DIR_METADATA
../../../flutter/third_party/vulkan-deps/vulkan-headers/README.chromium
../../../flutter/third_party/vulkan-deps/vulkan-headers/src/.git
../../../flutter/third_party/vulkan-deps/vulkan-headers/src/.gitattributes
../../../flutter/third_party/vulkan-deps/vulkan-headers/src/.github
../../../flutter/third_party/vulkan-deps/vulkan-headers/src/.gitignore
../../../flutter/third_party/vulkan-deps/vulkan-headers/src/.reuse
../../../flutter/third_party/vulkan-deps/vulkan-headers/src/BUILD.md
../../../flutter/third_party/vulkan-deps/vulkan-headers/src/CMakeLists.txt
../../../flutter/third_party/vulkan-deps/vulkan-headers/src/CODE_OF_CONDUCT.adoc
../../../flutter/third_party/vulkan-deps/vulkan-headers/src/CONTRIBUTING.md
../../../flutter/third_party/vulkan-deps/vulkan-headers/src/LICENSE.md
../../../flutter/third_party/vulkan-deps/vulkan-headers/src/README.md
../../../flutter/third_party/vulkan-deps/vulkan-headers/src/SECURITY.md
../../../flutter/third_party/vulkan-deps/vulkan-headers/src/registry
../../../flutter/third_party/vulkan-deps/vulkan-headers/src/tests
../../../flutter/third_party/vulkan-deps/vulkan-loader
../../../flutter/third_party/vulkan-deps/vulkan-tools
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/README.chromium
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/.clang-format
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/.git
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/.gitattributes
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/.github
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/.gitignore
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/.reuse
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/BUILD.md
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/CMakeLists.txt
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/CODE_OF_CONDUCT.md
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/LICENSE.md
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/README.md
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/include/CMakeLists.txt
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/scripts/CMakeLists.txt
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/scripts/generate_source.py
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/scripts/generators/base_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/scripts/generators/dispatch_table_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/scripts/generators/enum_string_helper_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/scripts/generators/format_utils_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/scripts/generators/generator_utils.py
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/scripts/generators/struct_helper_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/scripts/generators/vulkan_object.py
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/scripts/gn/DEPS
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/scripts/gn/gn.py
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/scripts/known_good.json
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/scripts/update_deps.py
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/src/CMakeLists.txt
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/src/layer/CMakeLists.txt
../../../flutter/third_party/vulkan-deps/vulkan-utility-libraries/src/tests
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/README.chromium
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/.clang-format
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/.clang-tidy
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/.git
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/.gitattributes
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/.github
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/.gitignore
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/.mailmap
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/BUILD.md
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/CMakeLists.txt
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/CODE_OF_CONDUCT.md
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/CONTRIBUTING.md
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/README.md
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/docs
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/layers/CMakeLists.txt
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/layers/gpu_shaders/README.md
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/layers/gpu_validation/spirv/CMakeLists.txt
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/layers/gpu_validation/spirv/README.md
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/layers/vulkan/generated/.clang-format
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/CMakeLists.txt
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/android.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/antialias_source.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/check_code_format.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/clang-format-diff.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/common_ci.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generate_source.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generate_spec_error_message.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generate_spirv.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/api_version_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/base_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/best_practices_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/command_validation_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/dispatch_table_helper_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/dynamic_state_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/enum_flag_bits_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/error_location_helper_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/extension_helper_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/feature_requirements.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/function_pointers_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/generator_utils.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/layer_chassis_dispatch_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/layer_chassis_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/layer_dispatch_table_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/object_tracker_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/object_types_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/pnext_chain_extraction_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/safe_struct_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/spirv_grammar_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/spirv_tool_commit_id_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/spirv_validation_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/state_tracker_helper_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/stateless_validation_helper_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/sync_validation_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/thread_safety_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/valid_enum_values_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/valid_flag_values_generator.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/generators/vulkan_object.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/gn/DEPS
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/gn/commit_id.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/gn/generate_vulkan_layers_json.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/gn/gn.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/gn/remove_files.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/known_good.json
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/tests.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/update_deps.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/scripts/vk_validation_stats.py
../../../flutter/third_party/vulkan-deps/vulkan-validation-layers/src/tests
../../../flutter/third_party/vulkan_memory_allocator/.git
../../../flutter/third_party/vulkan_memory_allocator/.gitignore
../../../flutter/third_party/vulkan_memory_allocator/.travis.yml
../../../flutter/third_party/vulkan_memory_allocator/CHANGELOG.md
../../../flutter/third_party/vulkan_memory_allocator/CMakeLists.txt
../../../flutter/third_party/vulkan_memory_allocator/Doxyfile
../../../flutter/third_party/vulkan_memory_allocator/README.md
../../../flutter/third_party/vulkan_memory_allocator/bin
../../../flutter/third_party/vulkan_memory_allocator/docs
../../../flutter/third_party/vulkan_memory_allocator/media
../../../flutter/third_party/vulkan_memory_allocator/src
../../../flutter/third_party/vulkan_memory_allocator/tools
../../../flutter/third_party/web_locale_keymap/CHANGELOG.md
../../../flutter/third_party/web_locale_keymap/README.md
../../../flutter/third_party/web_locale_keymap/pubspec.yaml
../../../flutter/third_party/web_locale_keymap/test
../../../flutter/third_party/web_test_fonts/pubspec.yaml
../../../flutter/third_party/web_unicode/README.md
../../../flutter/third_party/web_unicode/pubspec.yaml
../../../flutter/third_party/wuffs/.git
../../../flutter/third_party/wuffs/.github
../../../flutter/third_party/wuffs/README.md
../../../flutter/third_party/wuffs/docs
../../../flutter/third_party/wuffs/release/c/README.md
../../../flutter/third_party/wuffs/script
../../../flutter/third_party/wuffs/sync.txt
../../../flutter/third_party/yapf
../../../flutter/tools
../../../flutter/tools/licenses/.dart_tool
../../../flutter/tools/licenses/.gitignore
../../../flutter/tools/licenses/README.md
../../../flutter/tools/licenses/analysis_options.yaml
../../../flutter/tools/licenses/data
../../../flutter/tools/licenses/lib/README
../../../flutter/tools/licenses/pubspec.lock
../../../flutter/tools/licenses/pubspec.yaml
../../../flutter/tools/licenses/test
../../../flutter/web_sdk
../../../fuchsia/sdk/linux/.build-id
../../../fuchsia/sdk/linux/.versions
../../../fuchsia/sdk/linux/AUTHORS
../../../fuchsia/sdk/linux/NOTICE.fuchsia
../../../fuchsia/sdk/linux/PATENTS
../../../fuchsia/sdk/linux/README.md
../../../fuchsia/sdk/linux/arch/arm64/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/arch/arm64/sysroot/dist/lib/hwasan/ld.so.1
../../../fuchsia/sdk/linux/arch/arm64/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/arch/riscv64/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/arch/riscv64/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/arch/x64/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/arch/x64/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/bind/fuchsia.amlogic.platform/meta.json
../../../fuchsia/sdk/linux/bind/fuchsia.arm.platform/meta.json
../../../fuchsia/sdk/linux/bind/fuchsia.devicetree/meta.json
../../../fuchsia/sdk/linux/bind/fuchsia.google.platform/meta.json
../../../fuchsia/sdk/linux/bind/fuchsia.gpio/meta.json
../../../fuchsia/sdk/linux/bind/fuchsia.khadas.platform/meta.json
../../../fuchsia/sdk/linux/bind/fuchsia.nxp.platform/meta.json
../../../fuchsia/sdk/linux/bind/fuchsia.platform/meta.json
../../../fuchsia/sdk/linux/bind/fuchsia.sysmem/meta.json
../../../fuchsia/sdk/linux/bind/fuchsia.test.platform/meta.json
../../../fuchsia/sdk/linux/bind/fuchsia.test/meta.json
../../../fuchsia/sdk/linux/bind/fuchsia/meta.json
../../../fuchsia/sdk/linux/dart/sl4f/meta.json
../../../fuchsia/sdk/linux/data/config/symbol_index/meta.json
../../../fuchsia/sdk/linux/docs
../../../fuchsia/sdk/linux/fidl/fuchsia.accessibility.gesture/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.accessibility.semantics/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.accessibility.tts/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.accessibility.virtualkeyboard/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.audio.effects/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.auth.oldtokens/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.auth/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.bluetooth.a2dp/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.bluetooth.fastpair/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.bluetooth.gatt/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.bluetooth.gatt2/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.bluetooth.hfp/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.bluetooth.le/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.bluetooth.sys/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.bluetooth/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.buildinfo.test/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.buildinfo/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.camera/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.camera2.hal/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.camera2/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.camera3/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.castauth/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.castconfig/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.castremotecontrol/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.castsetup/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.castsysteminfo/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.castwindow/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.component.config/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.component.decl/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.component.resolution/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.component.runner/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.component.sandbox/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.component.test/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.component.types/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.component/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.data/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.debugdata/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.developer.tiles/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.device.fs/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.diagnostics.types/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.diagnostics/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.driver.development/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.driver.framework/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.driver.legacy/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.driver.registrar/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.driver.test/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.element/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.factory.wlan/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.factory/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.feedback/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.fonts/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.gpu.agis/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.gpu.magma/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.adc/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.audio.signalprocessing/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.audio/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.i2c/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.light/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.network/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.platform.device/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.power.sensor/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.power.statecontrol/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.power/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.radar/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.rtc/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.temperature/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.trippoint/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.hwinfo/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.images/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.images2/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.input.report/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.input.virtualkeyboard/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.input/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.inspect/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.intl/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.io/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.kernel/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.ldsvc/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.legacymetrics/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.lightsensor/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.location.namedplace/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.location.position/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.location.sensor/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.location/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.logger/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.lowpan.bootstrap/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.lowpan.device/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.lowpan.thread/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.lowpan/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.math/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.media.audio/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.media.drm/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.media.playback/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.media.sessions2/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.media.sounds/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.media.target/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.media/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.mediacodec/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.mediastreams/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.mem/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.memorypressure/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.metrics/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.migration/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.modular/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.net.http/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.net.interfaces/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.net.mdns/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.net.reachability/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.net.routes/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.net.stackmigrationdeprecated/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.net/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.power.clientlevel/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.power.profile/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.power.systemmode/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.process.lifecycle/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.process/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.recovery.ui/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.recovery/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.scenic.scheduling/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.session/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.settings.policy/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.settings/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.sys.test/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.sys/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.sysinfo/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.sysmem/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.sysmem2/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.test/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.thermal/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.tracing.perfetto/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.tracing.provider/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.tracing/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.ui.activity.control/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.ui.activity/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.ui.app/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.ui.brightness/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.ui.composition/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.ui.display.singleton/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.ui.gfx/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.ui.input/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.ui.input3/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.ui.observation.geometry/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.ui.pointer/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.ui.pointerinjector/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.ui.policy/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.ui.scenic/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.ui.test.input/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.ui.test.scene/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.ui.types/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.ui.views/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.ultrasound/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.unknown/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.update.channel/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.update.channelcontrol/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.update.config/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.update/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.url/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.version/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.weave/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.web/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.wlan.common/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.wlan.ieee80211/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.wlan.phyimpl/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.wlan.policy/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.wlan.product.deprecatedclient/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.wlan.product.deprecatedconfiguration/meta.json
../../../fuchsia/sdk/linux/fidl/fuchsia.wlan.softmac/meta.json
../../../fuchsia/sdk/linux/fidl/zx/meta.json
../../../fuchsia/sdk/linux/meta
../../../fuchsia/sdk/linux/obj/arm64-api-12/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/obj/arm64-api-12/sysroot/dist/lib/hwasan/ld.so.1
../../../fuchsia/sdk/linux/obj/arm64-api-12/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/obj/arm64-api-14/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/obj/arm64-api-14/sysroot/dist/lib/hwasan/ld.so.1
../../../fuchsia/sdk/linux/obj/arm64-api-14/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/obj/arm64-api-15/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/obj/arm64-api-15/sysroot/dist/lib/hwasan/ld.so.1
../../../fuchsia/sdk/linux/obj/arm64-api-15/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/obj/arm64-api-16/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/obj/arm64-api-16/sysroot/dist/lib/hwasan/ld.so.1
../../../fuchsia/sdk/linux/obj/arm64-api-16/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/obj/arm64-api-17/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/obj/arm64-api-17/sysroot/dist/lib/hwasan/ld.so.1
../../../fuchsia/sdk/linux/obj/arm64-api-17/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/obj/arm64-api-18/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/obj/arm64-api-18/sysroot/dist/lib/hwasan/ld.so.1
../../../fuchsia/sdk/linux/obj/arm64-api-18/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/obj/arm64-api-19/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/obj/arm64-api-19/sysroot/dist/lib/hwasan/ld.so.1
../../../fuchsia/sdk/linux/obj/arm64-api-19/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/obj/riscv64-api-12/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/obj/riscv64-api-12/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/obj/riscv64-api-14/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/obj/riscv64-api-14/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/obj/riscv64-api-15/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/obj/riscv64-api-15/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/obj/riscv64-api-16/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/obj/riscv64-api-16/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/obj/riscv64-api-17/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/obj/riscv64-api-17/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/obj/riscv64-api-18/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/obj/riscv64-api-18/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/obj/riscv64-api-19/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/obj/riscv64-api-19/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/obj/x64-api-12/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/obj/x64-api-12/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/obj/x64-api-14/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/obj/x64-api-14/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/obj/x64-api-15/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/obj/x64-api-15/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/obj/x64-api-16/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/obj/x64-api-16/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/obj/x64-api-17/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/obj/x64-api-17/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/obj/x64-api-18/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/obj/x64-api-18/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/obj/x64-api-19/sysroot/dist/lib/asan/ld.so.1
../../../fuchsia/sdk/linux/obj/x64-api-19/sysroot/dist/lib/ld.so.1
../../../fuchsia/sdk/linux/packages/blobs
../../../fuchsia/sdk/linux/packages/heapdump-collector/meta.json
../../../fuchsia/sdk/linux/packages/magma_conformance_tests/meta.json
../../../fuchsia/sdk/linux/packages/realm_builder_server/meta.json
../../../fuchsia/sdk/linux/packages/vkreadback_test/meta.json
../../../fuchsia/sdk/linux/pkg/async-cpp/meta.json
../../../fuchsia/sdk/linux/pkg/async-default/meta.json
../../../fuchsia/sdk/linux/pkg/async-loop-cpp/meta.json
../../../fuchsia/sdk/linux/pkg/async-loop-default/meta.json
../../../fuchsia/sdk/linux/pkg/async-loop-testing/include/lib/async-loop/testing
../../../fuchsia/sdk/linux/pkg/async-loop-testing/meta.json
../../../fuchsia/sdk/linux/pkg/async-loop/meta.json
../../../fuchsia/sdk/linux/pkg/async-testing/meta.json
../../../fuchsia/sdk/linux/pkg/async/meta.json
../../../fuchsia/sdk/linux/pkg/async_patterns_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/async_patterns_testing_cpp/include/lib/async_patterns/testing
../../../fuchsia/sdk/linux/pkg/async_patterns_testing_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/backend_fuchsia_globals/meta.json
../../../fuchsia/sdk/linux/pkg/component_incoming_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/component_outgoing_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/driver_component_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/driver_devfs_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/driver_incoming_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/driver_logging_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/driver_outgoing_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/driver_runtime/meta.json
../../../fuchsia/sdk/linux/pkg/driver_runtime_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/driver_runtime_env/meta.json
../../../fuchsia/sdk/linux/pkg/driver_runtime_env_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/driver_runtime_shared_lib/meta.json
../../../fuchsia/sdk/linux/pkg/driver_runtime_testing/meta.json
../../../fuchsia/sdk/linux/pkg/driver_runtime_testing_cpp/include/lib/driver/runtime/testing
../../../fuchsia/sdk/linux/pkg/driver_runtime_testing_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/driver_symbols/meta.json
../../../fuchsia/sdk/linux/pkg/driver_testing_cpp/include/lib/driver/testing
../../../fuchsia/sdk/linux/pkg/driver_testing_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/fdio/meta.json
../../../fuchsia/sdk/linux/pkg/fidl/meta.json
../../../fuchsia/sdk/linux/pkg/fidl_base/meta.json
../../../fuchsia/sdk/linux/pkg/fidl_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/fidl_cpp_base/meta.json
../../../fuchsia/sdk/linux/pkg/fidl_cpp_base_v2/meta.json
../../../fuchsia/sdk/linux/pkg/fidl_cpp_hlcpp_conversion/meta.json
../../../fuchsia/sdk/linux/pkg/fidl_cpp_natural_ostream/meta.json
../../../fuchsia/sdk/linux/pkg/fidl_cpp_sync/meta.json
../../../fuchsia/sdk/linux/pkg/fidl_cpp_v2/meta.json
../../../fuchsia/sdk/linux/pkg/fidl_cpp_wire/meta.json
../../../fuchsia/sdk/linux/pkg/fidl_driver/meta.json
../../../fuchsia/sdk/linux/pkg/fidl_driver_natural/meta.json
../../../fuchsia/sdk/linux/pkg/fidl_driver_transport/meta.json
../../../fuchsia/sdk/linux/pkg/fit-promise/meta.json
../../../fuchsia/sdk/linux/pkg/fit/meta.json
../../../fuchsia/sdk/linux/pkg/heapdump_instrumentation/meta.json
../../../fuchsia/sdk/linux/pkg/images_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/input_report_reader/meta.json
../../../fuchsia/sdk/linux/pkg/inspect/meta.json
../../../fuchsia/sdk/linux/pkg/inspect_component_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/inspect_service_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/magma_client/meta.json
../../../fuchsia/sdk/linux/pkg/magma_common/meta.json
../../../fuchsia/sdk/linux/pkg/media_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/media_cpp_no_converters/meta.json
../../../fuchsia/sdk/linux/pkg/scenic_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/scenic_cpp_testing/include/lib/ui/scenic/cpp/testing
../../../fuchsia/sdk/linux/pkg/scenic_cpp_testing/meta.json
../../../fuchsia/sdk/linux/pkg/stdcompat/meta.json
../../../fuchsia/sdk/linux/pkg/svc/meta.json
../../../fuchsia/sdk/linux/pkg/sync/meta.json
../../../fuchsia/sdk/linux/pkg/sync_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/sys/testing
../../../fuchsia/sdk/linux/pkg/sys_component_cpp_testing/include/lib/sys/component/cpp/testing
../../../fuchsia/sdk/linux/pkg/sys_component_cpp_testing/meta.json
../../../fuchsia/sdk/linux/pkg/sys_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/sys_cpp_testing/include/lib/sys/cpp/testing
../../../fuchsia/sdk/linux/pkg/sys_cpp_testing/meta.json
../../../fuchsia/sdk/linux/pkg/sys_inspect_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/sys_service_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/syslog/meta.json
../../../fuchsia/sdk/linux/pkg/syslog_structured_backend/meta.json
../../../fuchsia/sdk/linux/pkg/sysroot/meta.json
../../../fuchsia/sdk/linux/pkg/trace-engine-headersonly/meta.json
../../../fuchsia/sdk/linux/pkg/trace-engine/meta.json
../../../fuchsia/sdk/linux/pkg/trace-headersonly/meta.json
../../../fuchsia/sdk/linux/pkg/trace-provider-so/meta.json
../../../fuchsia/sdk/linux/pkg/trace-vthread-headersonly/meta.json
../../../fuchsia/sdk/linux/pkg/trace-vthread/meta.json
../../../fuchsia/sdk/linux/pkg/trace/meta.json
../../../fuchsia/sdk/linux/pkg/utf-utils/meta.json
../../../fuchsia/sdk/linux/pkg/vfs_cpp/meta.json
../../../fuchsia/sdk/linux/pkg/vfs_internal/meta.json
../../../fuchsia/sdk/linux/pkg/virtgralloc_headers/meta.json
../../../fuchsia/sdk/linux/pkg/vulkan/meta.json
../../../fuchsia/sdk/linux/pkg/vulkan_layers/meta.json
../../../fuchsia/sdk/linux/pkg/zx/meta.json
../../../fuchsia/sdk/linux/tools
../../../fuchsia/sdk/linux/version_history.json
../../../out
../../../third_party/android_embedding_dependencies
../../../third_party/android_tools
../../../third_party/dart
../../../third_party/dart/.clang-format
../../../third_party/dart/.dart_tool
../../../third_party/dart/.git
../../../third_party/dart/.gitattributes
../../../third_party/dart/.gitconfig
../../../third_party/dart/.github
../../../third_party/dart/.gitignore
../../../third_party/dart/.gn
../../../third_party/dart/.mailmap
../../../third_party/dart/.style.yapf
../../../third_party/dart/AUTHORS
../../../third_party/dart/CHANGELOG.md
../../../third_party/dart/CONTRIBUTING.md
../../../third_party/dart/DEPS
../../../third_party/dart/OWNERS
../../../third_party/dart/PATENT_GRANT
../../../third_party/dart/PRESUBMIT.py
../../../third_party/dart/README.dart-sdk
../../../third_party/dart/README.md
../../../third_party/dart/SECURITY.md
../../../third_party/dart/WATCHLISTS
../../../third_party/dart/benchmarks
../../../third_party/dart/build
../../../third_party/dart/codereview.settings
../../../third_party/dart/docs
../../../third_party/dart/pkg
../../../third_party/dart/runtime/.clang-tidy
../../../third_party/dart/runtime/.gitignore
../../../third_party/dart/runtime/CPPLINT.cfg
../../../third_party/dart/runtime/OWNERS
../../../third_party/dart/runtime/PRESUBMIT.py
../../../third_party/dart/runtime/bin/abstract_socket_test.cc
../../../third_party/dart/runtime/bin/crypto_test.cc
../../../third_party/dart/runtime/bin/directory_test.cc
../../../third_party/dart/runtime/bin/entrypoints_verification_test.cc
../../../third_party/dart/runtime/bin/eventhandler_test.cc
../../../third_party/dart/runtime/bin/ffi_test
../../../third_party/dart/runtime/bin/file_test.cc
../../../third_party/dart/runtime/bin/hashmap_test.cc
../../../third_party/dart/runtime/bin/priority_heap_test.cc
../../../third_party/dart/runtime/bin/process_test.cc
../../../third_party/dart/runtime/bin/secure_socket_utils_test.cc
../../../third_party/dart/runtime/bin/snapshot_utils_test.cc
../../../third_party/dart/runtime/codereview.settings
../../../third_party/dart/runtime/docs
../../../third_party/dart/runtime/observatory/.gitignore
../../../third_party/dart/runtime/observatory/HACKING.md
../../../third_party/dart/runtime/observatory/analysis_options.yaml
../../../third_party/dart/runtime/observatory/lib/src/elements/css/shared.css
../../../third_party/dart/runtime/observatory/pubspec.yaml
../../../third_party/dart/runtime/observatory/tests
../../../third_party/dart/runtime/observatory/update_sources.py
../../../third_party/dart/runtime/observatory/web/third_party/README.md
../../../third_party/dart/runtime/tests
../../../third_party/dart/runtime/tools/.gitignore
../../../third_party/dart/runtime/tools/android_finder.py
../../../third_party/dart/runtime/tools/benchmark.py
../../../third_party/dart/runtime/tools/bin_to_assembly.py
../../../third_party/dart/runtime/tools/bin_to_coff.py
../../../third_party/dart/runtime/tools/compiler_layering_check.py
../../../third_party/dart/runtime/tools/create_archive.py
../../../third_party/dart/runtime/tools/create_snapshot_bin.py
../../../third_party/dart/runtime/tools/create_snapshot_file.py
../../../third_party/dart/runtime/tools/create_string_literal.py
../../../third_party/dart/runtime/tools/dart_codesign.py
../../../third_party/dart/runtime/tools/dart_profiler_symbols.py
../../../third_party/dart/runtime/tools/dartfuzz/README.md
../../../third_party/dart/runtime/tools/dartfuzz/README_minimize.md
../../../third_party/dart/runtime/tools/dartfuzz/analysis_options.yaml
../../../third_party/dart/runtime/tools/dartfuzz/collect_data.py
../../../third_party/dart/runtime/tools/dartfuzz/dartfuzz_test.dart
../../../third_party/dart/runtime/tools/dartfuzz/minimize.py
../../../third_party/dart/runtime/tools/dartfuzz/pubspec.yaml
../../../third_party/dart/runtime/tools/dartfuzz/update_spreadsheet.py
../../../third_party/dart/runtime/tools/embedder_layering_check.py
../../../third_party/dart/runtime/tools/entitlements/README.md
../../../third_party/dart/runtime/tools/gen_library_src_paths.py
../../../third_party/dart/runtime/tools/graphexplorer/graphexplorer.css
../../../third_party/dart/runtime/tools/heapsnapshot/CHANGELOG.md
../../../third_party/dart/runtime/tools/heapsnapshot/README.md
../../../third_party/dart/runtime/tools/heapsnapshot/pubspec.yaml
../../../third_party/dart/runtime/tools/heapsnapshot/test
../../../third_party/dart/runtime/tools/utils.py
../../../third_party/dart/runtime/tools/valgrind.py
../../../third_party/dart/runtime/tools/wiki/README.md
../../../third_party/dart/runtime/tools/wiki/build/admonitions.py
../../../third_party/dart/runtime/tools/wiki/build/build.py
../../../third_party/dart/runtime/tools/wiki/build/cpp_indexer.py
../../../third_party/dart/runtime/tools/wiki/build/xrefs.py
../../../third_party/dart/runtime/vm/allocation_test.cc
../../../third_party/dart/runtime/vm/ama_test.cc
../../../third_party/dart/runtime/vm/assert_test.cc
../../../third_party/dart/runtime/vm/atomic_test.cc
../../../third_party/dart/runtime/vm/base64_test.cc
../../../third_party/dart/runtime/vm/benchmark_test.cc
../../../third_party/dart/runtime/vm/benchmark_test.h
../../../third_party/dart/runtime/vm/bit_set_test.cc
../../../third_party/dart/runtime/vm/bit_vector_test.cc
../../../third_party/dart/runtime/vm/bitfield_test.cc
../../../third_party/dart/runtime/vm/bitmap_test.cc
../../../third_party/dart/runtime/vm/boolfield_test.cc
../../../third_party/dart/runtime/vm/catch_entry_moves_test.cc
../../../third_party/dart/runtime/vm/class_finalizer_test.cc
../../../third_party/dart/runtime/vm/code_descriptors_test.cc
../../../third_party/dart/runtime/vm/code_patcher_arm64_test.cc
../../../third_party/dart/runtime/vm/code_patcher_arm_test.cc
../../../third_party/dart/runtime/vm/code_patcher_ia32_test.cc
../../../third_party/dart/runtime/vm/code_patcher_riscv_test.cc
../../../third_party/dart/runtime/vm/code_patcher_x64_test.cc
../../../third_party/dart/runtime/vm/compiler/README.md
../../../third_party/dart/runtime/vm/compiler/asm_intrinsifier_test.cc
../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64_test.cc
../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm_test.cc
../../../third_party/dart/runtime/vm/compiler/assembler/assembler_ia32_test.cc
../../../third_party/dart/runtime/vm/compiler/assembler/assembler_riscv_test.cc
../../../third_party/dart/runtime/vm/compiler/assembler/assembler_test.cc
../../../third_party/dart/runtime/vm/compiler/assembler/assembler_test.h
../../../third_party/dart/runtime/vm/compiler/assembler/assembler_x64_test.cc
../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_test.cc
../../../third_party/dart/runtime/vm/compiler/backend/bce_test.cc
../../../third_party/dart/runtime/vm/compiler/backend/constant_propagator_test.cc
../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_test.cc
../../../third_party/dart/runtime/vm/compiler/backend/il_test.cc
../../../third_party/dart/runtime/vm/compiler/backend/inliner_test.cc
../../../third_party/dart/runtime/vm/compiler/backend/locations_helpers_test.cc
../../../third_party/dart/runtime/vm/compiler/backend/loops_test.cc
../../../third_party/dart/runtime/vm/compiler/backend/memory_copy_test.cc
../../../third_party/dart/runtime/vm/compiler/backend/range_analysis_test.cc
../../../third_party/dart/runtime/vm/compiler/backend/reachability_fence_test.cc
../../../third_party/dart/runtime/vm/compiler/backend/redundancy_elimination_test.cc
../../../third_party/dart/runtime/vm/compiler/backend/slot_test.cc
../../../third_party/dart/runtime/vm/compiler/backend/type_propagator_test.cc
../../../third_party/dart/runtime/vm/compiler/backend/typed_data_aot_test.cc
../../../third_party/dart/runtime/vm/compiler/backend/yield_position_test.cc
../../../third_party/dart/runtime/vm/compiler/cha_test.cc
../../../third_party/dart/runtime/vm/compiler/ffi/README.md
../../../third_party/dart/runtime/vm/compiler/ffi/native_calling_convention_test.cc
../../../third_party/dart/runtime/vm/compiler/ffi/native_location_test.cc
../../../third_party/dart/runtime/vm/compiler/ffi/native_type_test.cc
../../../third_party/dart/runtime/vm/compiler/ffi/native_type_vm_test.cc
../../../third_party/dart/runtime/vm/compiler/ffi/unit_test.cc
../../../third_party/dart/runtime/vm/compiler/ffi/unit_test.h
../../../third_party/dart/runtime/vm/compiler/ffi/unit_tests
../../../third_party/dart/runtime/vm/compiler/frontend/kernel_binary_flowgraph_test.cc
../../../third_party/dart/runtime/vm/compiler/relocation_test.cc
../../../third_party/dart/runtime/vm/compiler/write_barrier_elimination_test.cc
../../../third_party/dart/runtime/vm/compiler_test.cc
../../../third_party/dart/runtime/vm/cpu_test.cc
../../../third_party/dart/runtime/vm/cpuinfo_test.cc
../../../third_party/dart/runtime/vm/custom_isolate_test.cc
../../../third_party/dart/runtime/vm/dart_api_impl_test.cc
../../../third_party/dart/runtime/vm/datastream_test.cc
../../../third_party/dart/runtime/vm/debugger_api_impl_test.cc
../../../third_party/dart/runtime/vm/debugger_api_impl_test.h
../../../third_party/dart/runtime/vm/exceptions_test.cc
../../../third_party/dart/runtime/vm/ffi_callback_metadata_test.cc
../../../third_party/dart/runtime/vm/fixed_cache_test.cc
../../../third_party/dart/runtime/vm/flags_test.cc
../../../third_party/dart/runtime/vm/growable_array_test.cc
../../../third_party/dart/runtime/vm/guard_field_test.cc
../../../third_party/dart/runtime/vm/handles_test.cc
../../../third_party/dart/runtime/vm/hash_map_test.cc
../../../third_party/dart/runtime/vm/hash_table_test.cc
../../../third_party/dart/runtime/vm/heap/become_test.cc
../../../third_party/dart/runtime/vm/heap/freelist_test.cc
../../../third_party/dart/runtime/vm/heap/heap_test.cc
../../../third_party/dart/runtime/vm/heap/safepoint_test.cc
../../../third_party/dart/runtime/vm/heap/weak_table_test.cc
../../../third_party/dart/runtime/vm/instructions_arm64_test.cc
../../../third_party/dart/runtime/vm/instructions_arm_test.cc
../../../third_party/dart/runtime/vm/instructions_ia32_test.cc
../../../third_party/dart/runtime/vm/instructions_riscv_test.cc
../../../third_party/dart/runtime/vm/instructions_x64_test.cc
../../../third_party/dart/runtime/vm/intrusive_dlist_test.cc
../../../third_party/dart/runtime/vm/isolate_reload_test.cc
../../../third_party/dart/runtime/vm/isolate_test.cc
../../../third_party/dart/runtime/vm/json_test.cc
../../../third_party/dart/runtime/vm/kernel_test.cc
../../../third_party/dart/runtime/vm/libfuzzer/README.md
../../../third_party/dart/runtime/vm/log_test.cc
../../../third_party/dart/runtime/vm/longjump_test.cc
../../../third_party/dart/runtime/vm/memory_region_test.cc
../../../third_party/dart/runtime/vm/message_handler_test.cc
../../../third_party/dart/runtime/vm/message_test.cc
../../../third_party/dart/runtime/vm/metrics_test.cc
../../../third_party/dart/runtime/vm/mixin_test.cc
../../../third_party/dart/runtime/vm/native_entry_test.cc
../../../third_party/dart/runtime/vm/native_entry_test.h
../../../third_party/dart/runtime/vm/object_arm64_test.cc
../../../third_party/dart/runtime/vm/object_arm_test.cc
../../../third_party/dart/runtime/vm/object_graph_test.cc
../../../third_party/dart/runtime/vm/object_ia32_test.cc
../../../third_party/dart/runtime/vm/object_id_ring_test.cc
../../../third_party/dart/runtime/vm/object_riscv_test.cc
../../../third_party/dart/runtime/vm/object_store_test.cc
../../../third_party/dart/runtime/vm/object_test.cc
../../../third_party/dart/runtime/vm/object_x64_test.cc
../../../third_party/dart/runtime/vm/os_test.cc
../../../third_party/dart/runtime/vm/port_test.cc
../../../third_party/dart/runtime/vm/profiler_test.cc
../../../third_party/dart/runtime/vm/protos/.gitignore
../../../third_party/dart/runtime/vm/regexp_test.cc
../../../third_party/dart/runtime/vm/ring_buffer_test.cc
../../../third_party/dart/runtime/vm/scopes_test.cc
../../../third_party/dart/runtime/vm/service
../../../third_party/dart/runtime/vm/service_test.cc
../../../third_party/dart/runtime/vm/snapshot_test.cc
../../../third_party/dart/runtime/vm/source_report_test.cc
../../../third_party/dart/runtime/vm/stack_frame_test.cc
../../../third_party/dart/runtime/vm/stub_code_arm64_test.cc
../../../third_party/dart/runtime/vm/stub_code_arm_test.cc
../../../third_party/dart/runtime/vm/stub_code_ia32_test.cc
../../../third_party/dart/runtime/vm/stub_code_riscv_test.cc
../../../third_party/dart/runtime/vm/stub_code_test.cc
../../../third_party/dart/runtime/vm/stub_code_x64_test.cc
../../../third_party/dart/runtime/vm/thread_barrier_test.cc
../../../third_party/dart/runtime/vm/thread_pool_test.cc
../../../third_party/dart/runtime/vm/thread_test.cc
../../../third_party/dart/runtime/vm/timeline_test.cc
../../../third_party/dart/runtime/vm/type_testing_stubs_test.cc
../../../third_party/dart/runtime/vm/unicode_test.cc
../../../third_party/dart/runtime/vm/unit_test.cc
../../../third_party/dart/runtime/vm/unit_test.h
../../../third_party/dart/runtime/vm/uri_test.cc
../../../third_party/dart/runtime/vm/utils_test.cc
../../../third_party/dart/runtime/vm/virtual_memory_test.cc
../../../third_party/dart/runtime/vm/zone_test.cc
../../../third_party/dart/samples
../../../third_party/dart/sdk/.gitignore
../../../third_party/dart/sdk/OWNERS
../../../third_party/dart/sdk/api_readme.md
../../../third_party/dart/sdk/lib/PRESUBMIT.py
../../../third_party/dart/sdk/lib/_internal/allowed_experiments.json
../../../third_party/dart/sdk/lib/_internal/fix_data.yaml
../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/OWNERS
../../../third_party/dart/sdk/lib/_internal/js_dev_runtime/private/preambles/README
../../../third_party/dart/sdk/lib/_internal/js_runtime/.packages
../../../third_party/dart/sdk/lib/_internal/js_runtime/OWNERS
../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/preambles/README
../../../third_party/dart/sdk/lib/_internal/js_runtime/pubspec.yaml
../../../third_party/dart/sdk/lib/_internal/sdk_library_metadata/pubspec.yaml
../../../third_party/dart/sdk/lib/_internal/vm/OWNERS
../../../third_party/dart/sdk/lib/_internal/wasm/OWNERS
../../../third_party/dart/sdk/lib/_wasm/OWNERS
../../../third_party/dart/sdk/lib/html/doc
../../../third_party/dart/sdk/lib/libraries.json
../../../third_party/dart/sdk/lib/libraries.yaml
../../../third_party/dart/sdk/lib/svg/dart2js
../../../third_party/dart/sdk/lib/vmservice_libraries.json
../../../third_party/dart/sdk/lib/vmservice_libraries.yaml
../../../third_party/dart/sdk/version
../../../third_party/dart/tests
../../../third_party/dart/third_party/.gitignore
../../../third_party/dart/third_party/OWNERS
../../../third_party/dart/third_party/binary_size
../../../third_party/dart/third_party/binaryen
../../../third_party/dart/third_party/clang.tar.gz.sha1
../../../third_party/dart/third_party/d3
../../../third_party/dart/third_party/d8
../../../third_party/dart/third_party/devtools
../../../third_party/dart/third_party/double-conversion/.gitignore
../../../third_party/dart/third_party/double-conversion/AUTHORS
../../../third_party/dart/third_party/double-conversion/Changelog
../../../third_party/dart/third_party/double-conversion/OWNERS
../../../third_party/dart/third_party/double-conversion/README.dart
../../../third_party/dart/third_party/double-conversion/README.md
../../../third_party/dart/third_party/fallback_root_certificates/OWNERS
../../../third_party/dart/third_party/fallback_root_certificates/README.google
../../../third_party/dart/third_party/fallback_root_certificates/certdata.pem
../../../third_party/dart/third_party/fallback_root_certificates/certdata.txt
../../../third_party/dart/third_party/firefox_jsshell
../../../third_party/dart/third_party/jsc/README.google
../../../third_party/dart/third_party/mdn/browser-compat-data/README.google
../../../third_party/dart/third_party/pkg
../../../third_party/dart/third_party/requirejs
../../../third_party/dart/tools
../../../third_party/dart/utils/OWNERS
../../../third_party/dart/utils/compiler/.gitignore
../../../third_party/dart/utils/dartanalyzer/.gitignore
../../../third_party/gradle
../../../third_party/java
../../../third_party/libcxx/.clang-format
../../../third_party/libcxx/.clang-tidy
../../../third_party/libcxx/.git
../../../third_party/libcxx/.gitignore
../../../third_party/libcxx/CMakeLists.txt
../../../third_party/libcxx/CREDITS.TXT
../../../third_party/libcxx/TODO.TXT
../../../third_party/libcxx/appveyor-reqs-install.cmd
../../../third_party/libcxx/appveyor.yml
../../../third_party/libcxx/benchmarks
../../../third_party/libcxx/cmake
../../../third_party/libcxx/docs
../../../third_party/libcxx/include/CMakeLists.txt
../../../third_party/libcxx/include/version
../../../third_party/libcxx/lib/abi/CHANGELOG.TXT
../../../third_party/libcxx/lib/abi/CMakeLists.txt
../../../third_party/libcxx/lib/abi/README.TXT
../../../third_party/libcxx/src/CMakeLists.txt
../../../third_party/libcxx/src/ryu/README.txt
../../../third_party/libcxx/src/support/solaris
../../../third_party/libcxx/test
../../../third_party/libcxx/utils
../../../third_party/libcxxabi/.clang-format
../../../third_party/libcxxabi/.git
../../../third_party/libcxxabi/.gitignore
../../../third_party/libcxxabi/CMakeLists.txt
../../../third_party/libcxxabi/CREDITS.TXT
../../../third_party/libcxxabi/cmake
../../../third_party/libcxxabi/fuzz/CMakeLists.txt
../../../third_party/libcxxabi/include/CMakeLists.txt
../../../third_party/libcxxabi/src/CMakeLists.txt
../../../third_party/libcxxabi/src/demangle/.clang-format
../../../third_party/libcxxabi/src/demangle/README.txt
../../../third_party/libcxxabi/test
../../../third_party/libcxxabi/www
../../../third_party/web_dependencies/canvaskit
../../../third_party/zlib/.git
../../../third_party/zlib/CMakeLists.txt
../../../third_party/zlib/DIR_METADATA
../../../third_party/zlib/OWNERS
../../../third_party/zlib/README.chromium
../../../third_party/zlib/contrib/bench/OWNERS
../../../third_party/zlib/contrib/minizip/Makefile
../../../third_party/zlib/contrib/minizip/README.chromium
../../../third_party/zlib/contrib/minizip/miniunz.c
../../../third_party/zlib/contrib/minizip/minizip.c
../../../third_party/zlib/contrib/minizip/minizip.md
../../../third_party/zlib/contrib/tests
../../../third_party/zlib/google/DEPS
../../../third_party/zlib/google/OWNERS
../../../third_party/zlib/google/compression_utils_unittest.cc
../../../third_party/zlib/google/test
../../../third_party/zlib/google/zip_reader_unittest.cc
../../../third_party/zlib/google/zip_unittest.cc
../../../third_party/zlib/patches/README
../../../third_party/zlib/zlib.3
../../../tools
| engine/ci/licenses_golden/excluded_files/0 | {
"file_path": "engine/ci/licenses_golden/excluded_files",
"repo_id": "engine",
"token_count": 91335
} | 201 |
# These symbols are looked up from within the executable at runtime and must
# be exported in the dynamic symbol table.
{
kDartVmSnapshotData;
kDartVmSnapshotInstructions;
kDartIsolateSnapshotData;
kDartIsolateSnapshotInstructions;
InternalFlutterGpu*;
kInternalFlutterGpu*;
};
| engine/common/exported_symbols.sym/0 | {
"file_path": "engine/common/exported_symbols.sym",
"repo_id": "engine",
"token_count": 94
} | 202 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_COMMON_TASK_RUNNERS_H_
#define FLUTTER_COMMON_TASK_RUNNERS_H_
#include <string>
#include "flutter/fml/macros.h"
#include "flutter/fml/task_runner.h"
namespace flutter {
class TaskRunners {
public:
TaskRunners(std::string label,
fml::RefPtr<fml::TaskRunner> platform,
fml::RefPtr<fml::TaskRunner> raster,
fml::RefPtr<fml::TaskRunner> ui,
fml::RefPtr<fml::TaskRunner> io);
TaskRunners(const TaskRunners& other);
~TaskRunners();
const std::string& GetLabel() const;
fml::RefPtr<fml::TaskRunner> GetPlatformTaskRunner() const;
fml::RefPtr<fml::TaskRunner> GetUITaskRunner() const;
fml::RefPtr<fml::TaskRunner> GetIOTaskRunner() const;
fml::RefPtr<fml::TaskRunner> GetRasterTaskRunner() const;
bool IsValid() const;
private:
const std::string label_;
fml::RefPtr<fml::TaskRunner> platform_;
fml::RefPtr<fml::TaskRunner> raster_;
fml::RefPtr<fml::TaskRunner> ui_;
fml::RefPtr<fml::TaskRunner> io_;
};
} // namespace flutter
#endif // FLUTTER_COMMON_TASK_RUNNERS_H_
| engine/common/task_runners.h/0 | {
"file_path": "engine/common/task_runners.h",
"repo_id": "engine",
"token_count": 496
} | 203 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_DISPLAY_LIST_DISPLAY_LIST_H_
#define FLUTTER_DISPLAY_LIST_DISPLAY_LIST_H_
#include <memory>
#include <optional>
#include "flutter/display_list/dl_sampling_options.h"
#include "flutter/display_list/geometry/dl_rtree.h"
#include "flutter/fml/logging.h"
// The Flutter DisplayList mechanism encapsulates a persistent sequence of
// rendering operations.
//
// This file contains the definitions for:
// DisplayList: the base class that holds the information about the
// sequence of operations and can dispatch them to a DlOpReceiver
// DlOpReceiver: a pure virtual interface which can be implemented to field
// the requests for purposes such as sending them to an SkCanvas
// or detecting various rendering optimization scenarios
// DisplayListBuilder: a class for constructing a DisplayList from DlCanvas
// method calls and which can act as a DlOpReceiver as well
//
// Other files include various class definitions for dealing with display
// lists, such as:
// skia/dl_sk_*.h: classes to interact between SkCanvas and DisplayList
// (SkCanvas->DisplayList adapter and vice versa)
//
// display_list_utils.h: various utility classes to ease implementing
// a DlOpReceiver, including NOP implementations of
// the attribute, clip, and transform methods,
// classes to track attributes, clips, and transforms
// and a class to compute the bounds of a DisplayList
// Any class implementing DlOpReceiver can inherit from
// these utility classes to simplify its creation
//
// The Flutter DisplayList mechanism is used in a similar manner to the Skia
// SkPicture mechanism.
//
// A DisplayList must be created using a DisplayListBuilder using its stateless
// methods inherited from DlCanvas.
//
// A DisplayList can be read back by implementing the DlOpReceiver virtual
// methods (with help from some of the classes in the utils file) and
// passing an instance to the Dispatch() method, or it can be rendered
// to Skia using a DlSkCanvasDispatcher.
//
// The mechanism is inspired by the SkLiteDL class that is not directly
// supported by Skia, but has been recommended as a basis for custom
// display lists for a number of their customers.
namespace flutter {
#define FOR_EACH_DISPLAY_LIST_OP(V) \
V(SetAntiAlias) \
V(SetInvertColors) \
\
V(SetStrokeCap) \
V(SetStrokeJoin) \
\
V(SetStyle) \
V(SetStrokeWidth) \
V(SetStrokeMiter) \
\
V(SetColor) \
V(SetBlendMode) \
\
V(SetPodPathEffect) \
V(ClearPathEffect) \
\
V(ClearColorFilter) \
V(SetPodColorFilter) \
\
V(ClearColorSource) \
V(SetPodColorSource) \
V(SetImageColorSource) \
V(SetRuntimeEffectColorSource) \
\
V(ClearImageFilter) \
V(SetPodImageFilter) \
V(SetSharedImageFilter) \
\
V(ClearMaskFilter) \
V(SetPodMaskFilter) \
\
V(Save) \
V(SaveLayer) \
V(SaveLayerBackdrop) \
V(Restore) \
\
V(Translate) \
V(Scale) \
V(Rotate) \
V(Skew) \
V(Transform2DAffine) \
V(TransformFullPerspective) \
V(TransformReset) \
\
V(ClipIntersectRect) \
V(ClipIntersectRRect) \
V(ClipIntersectPath) \
V(ClipDifferenceRect) \
V(ClipDifferenceRRect) \
V(ClipDifferencePath) \
\
V(DrawPaint) \
V(DrawColor) \
\
V(DrawLine) \
V(DrawRect) \
V(DrawOval) \
V(DrawCircle) \
V(DrawRRect) \
V(DrawDRRect) \
V(DrawArc) \
V(DrawPath) \
\
V(DrawPoints) \
V(DrawLines) \
V(DrawPolygon) \
V(DrawVertices) \
\
V(DrawImage) \
V(DrawImageWithAttr) \
V(DrawImageRect) \
V(DrawImageNine) \
V(DrawImageNineWithAttr) \
V(DrawAtlas) \
V(DrawAtlasCulled) \
\
V(DrawDisplayList) \
V(DrawTextBlob) \
V(DrawTextFrame) \
\
V(DrawShadow) \
V(DrawShadowTransparentOccluder)
#define DL_OP_TO_ENUM_VALUE(name) k##name,
enum class DisplayListOpType {
FOR_EACH_DISPLAY_LIST_OP(DL_OP_TO_ENUM_VALUE)
#ifdef IMPELLER_ENABLE_3D
DL_OP_TO_ENUM_VALUE(SetSceneColorSource)
#endif // IMPELLER_ENABLE_3D
};
#undef DL_OP_TO_ENUM_VALUE
class DlOpReceiver;
class DisplayListBuilder;
class SaveLayerOptions {
public:
static const SaveLayerOptions kWithAttributes;
static const SaveLayerOptions kNoAttributes;
SaveLayerOptions() : flags_(0) {}
SaveLayerOptions(const SaveLayerOptions& options) : flags_(options.flags_) {}
explicit SaveLayerOptions(const SaveLayerOptions* options)
: flags_(options->flags_) {}
SaveLayerOptions without_optimizations() const {
SaveLayerOptions options;
options.fRendersWithAttributes = fRendersWithAttributes;
options.fBoundsFromCaller = fBoundsFromCaller;
return options;
}
bool renders_with_attributes() const { return fRendersWithAttributes; }
SaveLayerOptions with_renders_with_attributes() const {
SaveLayerOptions options(this);
options.fRendersWithAttributes = true;
return options;
}
bool can_distribute_opacity() const { return fCanDistributeOpacity; }
SaveLayerOptions with_can_distribute_opacity() const {
SaveLayerOptions options(this);
options.fCanDistributeOpacity = true;
return options;
}
// Returns true iff the bounds for the saveLayer operation were provided
// by the caller, otherwise the bounds will have been computed by the
// DisplayListBuilder and provided for reference.
bool bounds_from_caller() const { return fBoundsFromCaller; }
SaveLayerOptions with_bounds_from_caller() const {
SaveLayerOptions options(this);
options.fBoundsFromCaller = true;
return options;
}
SaveLayerOptions without_bounds_from_caller() const {
SaveLayerOptions options(this);
options.fBoundsFromCaller = false;
return options;
}
bool bounds_were_calculated() const { return !fBoundsFromCaller; }
// Returns true iff the bounds for the saveLayer do not fully cover the
// contained rendering operations. This will only occur if the original
// caller supplied bounds and those bounds were not a strict superset
// of the content bounds computed by the DisplayListBuilder.
bool content_is_clipped() const { return fContentIsClipped; }
SaveLayerOptions with_content_is_clipped() const {
SaveLayerOptions options(this);
options.fContentIsClipped = true;
return options;
}
SaveLayerOptions& operator=(const SaveLayerOptions& other) {
flags_ = other.flags_;
return *this;
}
bool operator==(const SaveLayerOptions& other) const {
return flags_ == other.flags_;
}
bool operator!=(const SaveLayerOptions& other) const {
return flags_ != other.flags_;
}
private:
union {
struct {
unsigned fRendersWithAttributes : 1;
unsigned fCanDistributeOpacity : 1;
unsigned fBoundsFromCaller : 1;
unsigned fContentIsClipped : 1;
};
uint32_t flags_;
};
};
// Manages a buffer allocated with malloc.
class DisplayListStorage {
public:
DisplayListStorage() = default;
DisplayListStorage(DisplayListStorage&&) = default;
uint8_t* get() const { return ptr_.get(); }
void realloc(size_t count) {
ptr_.reset(static_cast<uint8_t*>(std::realloc(ptr_.release(), count)));
FML_CHECK(ptr_);
}
private:
struct FreeDeleter {
void operator()(uint8_t* p) { std::free(p); }
};
std::unique_ptr<uint8_t, FreeDeleter> ptr_;
};
class Culler;
// The base class that contains a sequence of rendering operations
// for dispatch to a DlOpReceiver. These objects must be instantiated
// through an instance of DisplayListBuilder::build().
class DisplayList : public SkRefCnt {
public:
DisplayList();
~DisplayList();
void Dispatch(DlOpReceiver& ctx) const;
void Dispatch(DlOpReceiver& ctx, const SkRect& cull_rect) const;
void Dispatch(DlOpReceiver& ctx, const SkIRect& cull_rect) const;
// From historical behavior, SkPicture always included nested bytes,
// but nested ops are only included if requested. The defaults used
// here for these accessors follow that pattern.
size_t bytes(bool nested = true) const {
return sizeof(DisplayList) + byte_count_ +
(nested ? nested_byte_count_ : 0);
}
unsigned int op_count(bool nested = false) const {
return op_count_ + (nested ? nested_op_count_ : 0);
}
uint32_t unique_id() const { return unique_id_; }
const SkRect& bounds() const { return bounds_; }
bool has_rtree() const { return rtree_ != nullptr; }
sk_sp<const DlRTree> rtree() const { return rtree_; }
bool Equals(const DisplayList* other) const;
bool Equals(const DisplayList& other) const { return Equals(&other); }
bool Equals(const sk_sp<const DisplayList>& other) const {
return Equals(other.get());
}
bool can_apply_group_opacity() const { return can_apply_group_opacity_; }
bool isUIThreadSafe() const { return is_ui_thread_safe_; }
/// @brief Indicates if there are any rendering operations in this
/// DisplayList that will modify a surface of transparent black
/// pixels.
///
/// This condition can be used to determine whether to create a cleared
/// surface, render a DisplayList into it, and then composite the
/// result into a scene. It is not uncommon for code in the engine to
/// come across such degenerate DisplayList objects when slicing up a
/// frame between platform views.
bool modifies_transparent_black() const {
return modifies_transparent_black_;
}
private:
DisplayList(DisplayListStorage&& ptr,
size_t byte_count,
unsigned int op_count,
size_t nested_byte_count,
unsigned int nested_op_count,
const SkRect& bounds,
bool can_apply_group_opacity,
bool is_ui_thread_safe,
bool modifies_transparent_black,
sk_sp<const DlRTree> rtree);
static uint32_t next_unique_id();
static void DisposeOps(uint8_t* ptr, uint8_t* end);
const DisplayListStorage storage_;
const size_t byte_count_;
const unsigned int op_count_;
const size_t nested_byte_count_;
const unsigned int nested_op_count_;
const uint32_t unique_id_;
const SkRect bounds_;
const bool can_apply_group_opacity_;
const bool is_ui_thread_safe_;
const bool modifies_transparent_black_;
const sk_sp<const DlRTree> rtree_;
void Dispatch(DlOpReceiver& ctx,
uint8_t* ptr,
uint8_t* end,
Culler& culler) const;
friend class DisplayListBuilder;
};
} // namespace flutter
#endif // FLUTTER_DISPLAY_LIST_DISPLAY_LIST_H_
| engine/display_list/display_list.h/0 | {
"file_path": "engine/display_list/display_list.h",
"repo_id": "engine",
"token_count": 5463
} | 204 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_DISPLAY_LIST_DL_OP_RECORDS_H_
#define FLUTTER_DISPLAY_LIST_DL_OP_RECORDS_H_
#include "flutter/display_list/display_list.h"
#include "flutter/display_list/dl_blend_mode.h"
#include "flutter/display_list/dl_op_receiver.h"
#include "flutter/display_list/dl_sampling_options.h"
#include "flutter/display_list/effects/dl_color_source.h"
#include "flutter/fml/macros.h"
#include "flutter/impeller/geometry/path.h"
#include "flutter/impeller/typographer/text_frame.h"
#include "third_party/skia/include/core/SkRSXform.h"
namespace flutter {
// Structure holding the information necessary to dispatch and
// potentially cull the DLOps during playback.
//
// Generally drawing ops will execute as long as |cur_index|
// is at or after |next_render_index|, so setting the latter
// to 0 will render all primitives and setting it to MAX_INT
// will skip all remaining rendering primitives.
//
// Save and saveLayer ops will execute as long as the next
// rendering index is before their closing restore index.
// They will also store their own restore index into the
// |next_restore_index| field for use by clip and transform ops.
//
// Clip and transform ops will only execute if the next
// render index is before the next restore index. Otherwise
// their modified state will not be used before it gets
// restored.
//
// Attribute ops always execute as they are too numerous and
// cheap to deal with a complicated "lifetime" tracking to
// determine if they will be used.
struct DispatchContext {
DlOpReceiver& receiver;
int cur_index;
int next_render_index;
int next_restore_index;
struct SaveInfo {
SaveInfo(int previous_restore_index, bool save_was_needed)
: previous_restore_index(previous_restore_index),
save_was_needed(save_was_needed) {}
int previous_restore_index;
bool save_was_needed;
};
std::vector<SaveInfo> save_infos;
};
// Most Ops can be bulk compared using memcmp because they contain
// only numeric values or constructs that are constructed from numeric
// values.
//
// Some contain sk_sp<> references which can also be bulk compared
// to see if they are pointing to the same reference. (Note that
// two sk_sp<> that refer to the same object are themselves ==.)
//
// Only a DLOp that wants to do a deep compare needs to override the
// DLOp::equals() method and return a value of kEqual or kNotEqual.
enum class DisplayListCompare {
// The Op is deferring comparisons to a bulk memcmp performed lazily
// across all bulk-comparable ops.
kUseBulkCompare,
// The Op provided a specific equals method that spotted a difference
kNotEqual,
// The Op provided a specific equals method that saw no differences
kEqual,
};
// "DLOpPackLabel" is just a label for the pack pragma so it can be popped
// later.
#pragma pack(push, DLOpPackLabel, 8)
// Assuming a 64-bit platform (most of our platforms at this time?)
// the following comments are a "worst case" assessment of how well
// these structures pack into memory. They may be packed more tightly
// on some of the 32-bit platforms that we see in older phones.
//
// Struct allocation in the DL memory is aligned to a void* boundary
// which means that the minimum (aligned) struct size will be 8 bytes.
// The DLOp base uses 4 bytes so each Op-specific struct gets 4 bytes
// of data for "free" and works best when it packs well into an 8-byte
// aligned size.
struct DLOp {
DisplayListOpType type : 8;
uint32_t size : 24;
DisplayListCompare equals(const DLOp* other) const {
return DisplayListCompare::kUseBulkCompare;
}
};
// 4 byte header + 4 byte payload packs into minimum 8 bytes
#define DEFINE_SET_BOOL_OP(name) \
struct Set##name##Op final : DLOp { \
static const auto kType = DisplayListOpType::kSet##name; \
\
explicit Set##name##Op(bool value) : value(value) {} \
\
const bool value; \
\
void dispatch(DispatchContext& ctx) const { \
ctx.receiver.set##name(value); \
} \
};
DEFINE_SET_BOOL_OP(AntiAlias)
DEFINE_SET_BOOL_OP(InvertColors)
#undef DEFINE_SET_BOOL_OP
// 4 byte header + 4 byte payload packs into minimum 8 bytes
#define DEFINE_SET_ENUM_OP(name) \
struct SetStroke##name##Op final : DLOp { \
static const auto kType = DisplayListOpType::kSetStroke##name; \
\
explicit SetStroke##name##Op(DlStroke##name value) : value(value) {} \
\
const DlStroke##name value; \
\
void dispatch(DispatchContext& ctx) const { \
ctx.receiver.setStroke##name(value); \
} \
};
DEFINE_SET_ENUM_OP(Cap)
DEFINE_SET_ENUM_OP(Join)
#undef DEFINE_SET_ENUM_OP
// 4 byte header + 4 byte payload packs into minimum 8 bytes
struct SetStyleOp final : DLOp {
static const auto kType = DisplayListOpType::kSetStyle;
explicit SetStyleOp(DlDrawStyle style) : style(style) {}
const DlDrawStyle style;
void dispatch(DispatchContext& ctx) const {
ctx.receiver.setDrawStyle(style);
}
};
// 4 byte header + 4 byte payload packs into minimum 8 bytes
struct SetStrokeWidthOp final : DLOp {
static const auto kType = DisplayListOpType::kSetStrokeWidth;
explicit SetStrokeWidthOp(float width) : width(width) {}
const float width;
void dispatch(DispatchContext& ctx) const {
ctx.receiver.setStrokeWidth(width);
}
};
// 4 byte header + 4 byte payload packs into minimum 8 bytes
struct SetStrokeMiterOp final : DLOp {
static const auto kType = DisplayListOpType::kSetStrokeMiter;
explicit SetStrokeMiterOp(float limit) : limit(limit) {}
const float limit;
void dispatch(DispatchContext& ctx) const {
ctx.receiver.setStrokeMiter(limit);
}
};
// 4 byte header + 4 byte payload packs into minimum 8 bytes
struct SetColorOp final : DLOp {
static const auto kType = DisplayListOpType::kSetColor;
explicit SetColorOp(DlColor color) : color(color) {}
const DlColor color;
void dispatch(DispatchContext& ctx) const { ctx.receiver.setColor(color); }
};
// 4 byte header + 4 byte payload packs into minimum 8 bytes
struct SetBlendModeOp final : DLOp {
static const auto kType = DisplayListOpType::kSetBlendMode;
explicit SetBlendModeOp(DlBlendMode mode) : mode(mode) {}
const DlBlendMode mode;
void dispatch(DispatchContext& ctx) const { //
ctx.receiver.setBlendMode(mode);
}
};
// Clear: 4 byte header + unused 4 byte payload uses 8 bytes
// (4 bytes unused)
// Set: 4 byte header + unused 4 byte struct padding + Dl<name>
// instance copied to the memory following the record
// yields a size and efficiency that has somewhere between
// 4 and 8 bytes unused
#define DEFINE_SET_CLEAR_DLATTR_OP(name, sk_name, field) \
struct Clear##name##Op final : DLOp { \
static const auto kType = DisplayListOpType::kClear##name; \
\
Clear##name##Op() {} \
\
void dispatch(DispatchContext& ctx) const { \
ctx.receiver.set##name(nullptr); \
} \
}; \
struct SetPod##name##Op final : DLOp { \
static const auto kType = DisplayListOpType::kSetPod##name; \
\
SetPod##name##Op() {} \
\
void dispatch(DispatchContext& ctx) const { \
const Dl##name* filter = reinterpret_cast<const Dl##name*>(this + 1); \
ctx.receiver.set##name(filter); \
} \
};
DEFINE_SET_CLEAR_DLATTR_OP(ColorFilter, ColorFilter, filter)
DEFINE_SET_CLEAR_DLATTR_OP(ImageFilter, ImageFilter, filter)
DEFINE_SET_CLEAR_DLATTR_OP(MaskFilter, MaskFilter, filter)
DEFINE_SET_CLEAR_DLATTR_OP(ColorSource, Shader, source)
DEFINE_SET_CLEAR_DLATTR_OP(PathEffect, PathEffect, effect)
#undef DEFINE_SET_CLEAR_DLATTR_OP
// 4 byte header + 80 bytes for the embedded DlImageColorSource
// uses 84 total bytes (4 bytes unused)
struct SetImageColorSourceOp : DLOp {
static const auto kType = DisplayListOpType::kSetImageColorSource;
explicit SetImageColorSourceOp(const DlImageColorSource* source)
: source(source->image(),
source->horizontal_tile_mode(),
source->vertical_tile_mode(),
source->sampling(),
source->matrix_ptr()) {}
const DlImageColorSource source;
void dispatch(DispatchContext& ctx) const {
ctx.receiver.setColorSource(&source);
}
};
// 56 bytes: 4 byte header, 4 byte padding, 8 for vtable, 8 * 2 for sk_sps, 24
// for the std::vector.
struct SetRuntimeEffectColorSourceOp : DLOp {
static const auto kType = DisplayListOpType::kSetRuntimeEffectColorSource;
explicit SetRuntimeEffectColorSourceOp(
const DlRuntimeEffectColorSource* source)
: source(source->runtime_effect(),
source->samplers(),
source->uniform_data()) {}
const DlRuntimeEffectColorSource source;
void dispatch(DispatchContext& ctx) const {
ctx.receiver.setColorSource(&source);
}
DisplayListCompare equals(const SetRuntimeEffectColorSourceOp* other) const {
return (source == other->source) ? DisplayListCompare::kEqual
: DisplayListCompare::kNotEqual;
}
};
#ifdef IMPELLER_ENABLE_3D
struct SetSceneColorSourceOp : DLOp {
static const auto kType = DisplayListOpType::kSetSceneColorSource;
explicit SetSceneColorSourceOp(const DlSceneColorSource* source)
: source(source->scene_node(), source->camera_matrix()) {}
const DlSceneColorSource source;
void dispatch(DispatchContext& ctx) const {
ctx.receiver.setColorSource(&source);
}
DisplayListCompare equals(const SetSceneColorSourceOp* other) const {
return (source == other->source) ? DisplayListCompare::kEqual
: DisplayListCompare::kNotEqual;
}
};
#endif // IMPELLER_ENABLE_3D
// 4 byte header + 16 byte payload uses 24 total bytes (4 bytes unused)
struct SetSharedImageFilterOp : DLOp {
static const auto kType = DisplayListOpType::kSetSharedImageFilter;
explicit SetSharedImageFilterOp(const DlImageFilter* filter)
: filter(filter->shared()) {}
const std::shared_ptr<DlImageFilter> filter;
void dispatch(DispatchContext& ctx) const {
ctx.receiver.setImageFilter(filter.get());
}
DisplayListCompare equals(const SetSharedImageFilterOp* other) const {
return Equals(filter, other->filter) ? DisplayListCompare::kEqual
: DisplayListCompare::kNotEqual;
}
};
// The base struct for all save() and saveLayer() ops
// 4 byte header + 8 byte payload packs into 16 bytes (4 bytes unused)
struct SaveOpBase : DLOp {
SaveOpBase() : options(), restore_index(0) {}
explicit SaveOpBase(const SaveLayerOptions& options)
: options(options), restore_index(0) {}
// options parameter is only used by saveLayer operations, but since
// it packs neatly into the empty space created by laying out the 64-bit
// offsets, it can be stored for free and defaulted to 0 for save operations.
SaveLayerOptions options;
int restore_index;
inline bool save_needed(DispatchContext& ctx) const {
bool needed = ctx.next_render_index <= restore_index;
ctx.save_infos.emplace_back(ctx.next_restore_index, needed);
ctx.next_restore_index = restore_index;
return needed;
}
};
// 16 byte SaveOpBase with no additional data (options is unsed here)
struct SaveOp final : SaveOpBase {
static const auto kType = DisplayListOpType::kSave;
SaveOp() : SaveOpBase() {}
void dispatch(DispatchContext& ctx) const {
if (save_needed(ctx)) {
ctx.receiver.save();
}
}
};
// The base struct for all saveLayer() ops
// 16 byte SaveOpBase + 16 byte payload packs into 32 bytes (4 bytes unused)
struct SaveLayerOpBase : SaveOpBase {
SaveLayerOpBase(const SaveLayerOptions& options, const SkRect& rect)
: SaveOpBase(options), rect(rect) {}
SkRect rect;
};
// 32 byte SaveLayerOpBase with no additional data
struct SaveLayerOp final : SaveLayerOpBase {
static const auto kType = DisplayListOpType::kSaveLayer;
SaveLayerOp(const SaveLayerOptions& options, const SkRect& rect)
: SaveLayerOpBase(options, rect) {}
void dispatch(DispatchContext& ctx) const {
if (save_needed(ctx)) {
ctx.receiver.saveLayer(rect, options);
}
}
};
// 32 byte SaveLayerOpBase + 16 byte payload packs into minimum 48 bytes
struct SaveLayerBackdropOp final : SaveLayerOpBase {
static const auto kType = DisplayListOpType::kSaveLayerBackdrop;
SaveLayerBackdropOp(const SaveLayerOptions& options,
const SkRect& rect,
const DlImageFilter* backdrop)
: SaveLayerOpBase(options, rect), backdrop(backdrop->shared()) {}
const std::shared_ptr<DlImageFilter> backdrop;
void dispatch(DispatchContext& ctx) const {
if (save_needed(ctx)) {
ctx.receiver.saveLayer(rect, options, backdrop.get());
}
}
DisplayListCompare equals(const SaveLayerBackdropOp* other) const {
return (options == other->options && rect == other->rect &&
Equals(backdrop, other->backdrop))
? DisplayListCompare::kEqual
: DisplayListCompare::kNotEqual;
}
};
// 4 byte header + no payload uses minimum 8 bytes (4 bytes unused)
struct RestoreOp final : DLOp {
static const auto kType = DisplayListOpType::kRestore;
RestoreOp() {}
void dispatch(DispatchContext& ctx) const {
DispatchContext::SaveInfo& info = ctx.save_infos.back();
if (info.save_was_needed) {
ctx.receiver.restore();
}
ctx.next_restore_index = info.previous_restore_index;
ctx.save_infos.pop_back();
}
};
struct TransformClipOpBase : DLOp {
inline bool op_needed(const DispatchContext& context) const {
return context.next_render_index <= context.next_restore_index;
}
};
// 4 byte header + 8 byte payload uses 12 bytes but is rounded up to 16 bytes
// (4 bytes unused)
struct TranslateOp final : TransformClipOpBase {
static const auto kType = DisplayListOpType::kTranslate;
TranslateOp(SkScalar tx, SkScalar ty) : tx(tx), ty(ty) {}
const SkScalar tx;
const SkScalar ty;
void dispatch(DispatchContext& ctx) const {
if (op_needed(ctx)) {
ctx.receiver.translate(tx, ty);
}
}
};
// 4 byte header + 8 byte payload uses 12 bytes but is rounded up to 16 bytes
// (4 bytes unused)
struct ScaleOp final : TransformClipOpBase {
static const auto kType = DisplayListOpType::kScale;
ScaleOp(SkScalar sx, SkScalar sy) : sx(sx), sy(sy) {}
const SkScalar sx;
const SkScalar sy;
void dispatch(DispatchContext& ctx) const {
if (op_needed(ctx)) {
ctx.receiver.scale(sx, sy);
}
}
};
// 4 byte header + 4 byte payload packs into minimum 8 bytes
struct RotateOp final : TransformClipOpBase {
static const auto kType = DisplayListOpType::kRotate;
explicit RotateOp(SkScalar degrees) : degrees(degrees) {}
const SkScalar degrees;
void dispatch(DispatchContext& ctx) const {
if (op_needed(ctx)) {
ctx.receiver.rotate(degrees);
}
}
};
// 4 byte header + 8 byte payload uses 12 bytes but is rounded up to 16 bytes
// (4 bytes unused)
struct SkewOp final : TransformClipOpBase {
static const auto kType = DisplayListOpType::kSkew;
SkewOp(SkScalar sx, SkScalar sy) : sx(sx), sy(sy) {}
const SkScalar sx;
const SkScalar sy;
void dispatch(DispatchContext& ctx) const {
if (op_needed(ctx)) {
ctx.receiver.skew(sx, sy);
}
}
};
// 4 byte header + 24 byte payload uses 28 bytes but is rounded up to 32 bytes
// (4 bytes unused)
struct Transform2DAffineOp final : TransformClipOpBase {
static const auto kType = DisplayListOpType::kTransform2DAffine;
// clang-format off
Transform2DAffineOp(SkScalar mxx, SkScalar mxy, SkScalar mxt,
SkScalar myx, SkScalar myy, SkScalar myt)
: mxx(mxx), mxy(mxy), mxt(mxt), myx(myx), myy(myy), myt(myt) {}
// clang-format on
const SkScalar mxx, mxy, mxt;
const SkScalar myx, myy, myt;
void dispatch(DispatchContext& ctx) const {
if (op_needed(ctx)) {
ctx.receiver.transform2DAffine(mxx, mxy, mxt, //
myx, myy, myt);
}
}
};
// 4 byte header + 64 byte payload uses 68 bytes which is rounded up to 72 bytes
// (4 bytes unused)
struct TransformFullPerspectiveOp final : TransformClipOpBase {
static const auto kType = DisplayListOpType::kTransformFullPerspective;
// clang-format off
TransformFullPerspectiveOp(
SkScalar mxx, SkScalar mxy, SkScalar mxz, SkScalar mxt,
SkScalar myx, SkScalar myy, SkScalar myz, SkScalar myt,
SkScalar mzx, SkScalar mzy, SkScalar mzz, SkScalar mzt,
SkScalar mwx, SkScalar mwy, SkScalar mwz, SkScalar mwt)
: mxx(mxx), mxy(mxy), mxz(mxz), mxt(mxt),
myx(myx), myy(myy), myz(myz), myt(myt),
mzx(mzx), mzy(mzy), mzz(mzz), mzt(mzt),
mwx(mwx), mwy(mwy), mwz(mwz), mwt(mwt) {}
// clang-format on
const SkScalar mxx, mxy, mxz, mxt;
const SkScalar myx, myy, myz, myt;
const SkScalar mzx, mzy, mzz, mzt;
const SkScalar mwx, mwy, mwz, mwt;
void dispatch(DispatchContext& ctx) const {
if (op_needed(ctx)) {
ctx.receiver.transformFullPerspective(mxx, mxy, mxz, mxt, //
myx, myy, myz, myt, //
mzx, mzy, mzz, mzt, //
mwx, mwy, mwz, mwt);
}
}
};
// 4 byte header with no payload.
struct TransformResetOp final : TransformClipOpBase {
static const auto kType = DisplayListOpType::kTransformReset;
TransformResetOp() = default;
void dispatch(DispatchContext& ctx) const {
if (op_needed(ctx)) {
ctx.receiver.transformReset();
}
}
};
// 4 byte header + 4 byte common payload packs into minimum 8 bytes
// SkRect is 16 more bytes, which packs efficiently into 24 bytes total
// SkRRect is 52 more bytes, which rounds up to 56 bytes (4 bytes unused)
// which packs into 64 bytes total
// CacheablePath is 128 more bytes, which packs efficiently into 136 bytes total
//
// We could pack the clip_op and the bool both into the free 4 bytes after
// the header, but the Windows compiler keeps wanting to expand that
// packing into more bytes than needed (even when they are declared as
// packed bit fields!)
#define DEFINE_CLIP_SHAPE_OP(shapetype, clipop) \
struct Clip##clipop##shapetype##Op final : TransformClipOpBase { \
static const auto kType = DisplayListOpType::kClip##clipop##shapetype; \
\
Clip##clipop##shapetype##Op(Sk##shapetype shape, bool is_aa) \
: is_aa(is_aa), shape(shape) {} \
\
const bool is_aa; \
const Sk##shapetype shape; \
\
void dispatch(DispatchContext& ctx) const { \
if (op_needed(ctx)) { \
ctx.receiver.clip##shapetype(shape, DlCanvas::ClipOp::k##clipop, \
is_aa); \
} \
} \
};
DEFINE_CLIP_SHAPE_OP(Rect, Intersect)
DEFINE_CLIP_SHAPE_OP(RRect, Intersect)
DEFINE_CLIP_SHAPE_OP(Rect, Difference)
DEFINE_CLIP_SHAPE_OP(RRect, Difference)
#undef DEFINE_CLIP_SHAPE_OP
#define DEFINE_CLIP_PATH_OP(clipop) \
struct Clip##clipop##PathOp final : TransformClipOpBase { \
static const auto kType = DisplayListOpType::kClip##clipop##Path; \
\
Clip##clipop##PathOp(const SkPath& path, bool is_aa) \
: is_aa(is_aa), cached_path(path) {} \
\
const bool is_aa; \
const DlOpReceiver::CacheablePath cached_path; \
\
void dispatch(DispatchContext& ctx) const { \
if (op_needed(ctx)) { \
if (ctx.receiver.PrefersImpellerPaths()) { \
ctx.receiver.clipPath(cached_path, DlCanvas::ClipOp::k##clipop, \
is_aa); \
} else { \
ctx.receiver.clipPath(cached_path.sk_path, \
DlCanvas::ClipOp::k##clipop, is_aa); \
} \
} \
} \
\
DisplayListCompare equals(const Clip##clipop##PathOp* other) const { \
return is_aa == other->is_aa && cached_path == other->cached_path \
? DisplayListCompare::kEqual \
: DisplayListCompare::kNotEqual; \
} \
};
DEFINE_CLIP_PATH_OP(Intersect)
DEFINE_CLIP_PATH_OP(Difference)
#undef DEFINE_CLIP_PATH_OP
struct DrawOpBase : DLOp {
inline bool op_needed(const DispatchContext& ctx) const {
return ctx.cur_index >= ctx.next_render_index;
}
};
// 4 byte header + no payload uses minimum 8 bytes (4 bytes unused)
struct DrawPaintOp final : DrawOpBase {
static const auto kType = DisplayListOpType::kDrawPaint;
DrawPaintOp() {}
void dispatch(DispatchContext& ctx) const {
if (op_needed(ctx)) {
ctx.receiver.drawPaint();
}
}
};
// 4 byte header + 8 byte payload uses 12 bytes but is rounded up to 16 bytes
// (4 bytes unused)
struct DrawColorOp final : DrawOpBase {
static const auto kType = DisplayListOpType::kDrawColor;
DrawColorOp(DlColor color, DlBlendMode mode) : color(color), mode(mode) {}
const DlColor color;
const DlBlendMode mode;
void dispatch(DispatchContext& ctx) const {
if (op_needed(ctx)) {
ctx.receiver.drawColor(color, mode);
}
}
};
// The common data is a 4 byte header with an unused 4 bytes
// SkRect is 16 more bytes, using 20 bytes which rounds up to 24 bytes total
// (4 bytes unused)
// SkOval is same as SkRect
// SkRRect is 52 more bytes, which packs efficiently into 56 bytes total
#define DEFINE_DRAW_1ARG_OP(op_name, arg_type, arg_name) \
struct Draw##op_name##Op final : DrawOpBase { \
static const auto kType = DisplayListOpType::kDraw##op_name; \
\
explicit Draw##op_name##Op(arg_type arg_name) : arg_name(arg_name) {} \
\
const arg_type arg_name; \
\
void dispatch(DispatchContext& ctx) const { \
if (op_needed(ctx)) { \
ctx.receiver.draw##op_name(arg_name); \
} \
} \
};
DEFINE_DRAW_1ARG_OP(Rect, SkRect, rect)
DEFINE_DRAW_1ARG_OP(Oval, SkRect, oval)
DEFINE_DRAW_1ARG_OP(RRect, SkRRect, rrect)
#undef DEFINE_DRAW_1ARG_OP
// 4 byte header + 128 byte payload uses 132 bytes but is rounded
// up to 136 bytes (4 bytes unused)
struct DrawPathOp final : DrawOpBase {
static const auto kType = DisplayListOpType::kDrawPath;
explicit DrawPathOp(const SkPath& path) : cached_path(path) {}
const DlOpReceiver::CacheablePath cached_path;
void dispatch(DispatchContext& ctx) const {
if (op_needed(ctx)) {
if (ctx.receiver.PrefersImpellerPaths()) {
ctx.receiver.drawPath(cached_path);
} else {
ctx.receiver.drawPath(cached_path.sk_path);
}
}
}
DisplayListCompare equals(const DrawPathOp* other) const {
return cached_path == other->cached_path ? DisplayListCompare::kEqual
: DisplayListCompare::kNotEqual;
}
};
// The common data is a 4 byte header with an unused 4 bytes
// 2 x SkPoint is 16 more bytes, using 20 bytes rounding up to 24 bytes total
// (4 bytes unused)
// SkPoint + SkScalar is 12 more bytes, packing efficiently into 16 bytes total
// 2 x SkRRect is 104 more bytes, using 108 and rounding up to 112 bytes total
// (4 bytes unused)
#define DEFINE_DRAW_2ARG_OP(op_name, type1, name1, type2, name2) \
struct Draw##op_name##Op final : DrawOpBase { \
static const auto kType = DisplayListOpType::kDraw##op_name; \
\
Draw##op_name##Op(type1 name1, type2 name2) \
: name1(name1), name2(name2) {} \
\
const type1 name1; \
const type2 name2; \
\
void dispatch(DispatchContext& ctx) const { \
if (op_needed(ctx)) { \
ctx.receiver.draw##op_name(name1, name2); \
} \
} \
};
DEFINE_DRAW_2ARG_OP(Line, SkPoint, p0, SkPoint, p1)
DEFINE_DRAW_2ARG_OP(Circle, SkPoint, center, SkScalar, radius)
DEFINE_DRAW_2ARG_OP(DRRect, SkRRect, outer, SkRRect, inner)
#undef DEFINE_DRAW_2ARG_OP
// 4 byte header + 28 byte payload packs efficiently into 32 bytes
struct DrawArcOp final : DrawOpBase {
static const auto kType = DisplayListOpType::kDrawArc;
DrawArcOp(SkRect bounds, SkScalar start, SkScalar sweep, bool center)
: bounds(bounds), start(start), sweep(sweep), center(center) {}
const SkRect bounds;
const SkScalar start;
const SkScalar sweep;
const bool center;
void dispatch(DispatchContext& ctx) const {
if (op_needed(ctx)) {
ctx.receiver.drawArc(bounds, start, sweep, center);
}
}
};
// 4 byte header + 4 byte fixed payload packs efficiently into 8 bytes
// But then there is a list of points following the structure which
// is guaranteed to be a multiple of 8 bytes (SkPoint is 8 bytes)
// so this op will always pack efficiently
// The point type is packed into 3 different OpTypes to avoid expanding
// the fixed payload beyond the 8 bytes
#define DEFINE_DRAW_POINTS_OP(name, mode) \
struct Draw##name##Op final : DrawOpBase { \
static const auto kType = DisplayListOpType::kDraw##name; \
\
explicit Draw##name##Op(uint32_t count) : count(count) {} \
\
const uint32_t count; \
\
void dispatch(DispatchContext& ctx) const { \
if (op_needed(ctx)) { \
const SkPoint* pts = reinterpret_cast<const SkPoint*>(this + 1); \
ctx.receiver.drawPoints(DlCanvas::PointMode::mode, count, pts); \
} \
} \
};
DEFINE_DRAW_POINTS_OP(Points, kPoints);
DEFINE_DRAW_POINTS_OP(Lines, kLines);
DEFINE_DRAW_POINTS_OP(Polygon, kPolygon);
#undef DEFINE_DRAW_POINTS_OP
// 4 byte header + 4 byte payload packs efficiently into 8 bytes
// The DlVertices object will be pod-allocated after this structure
// and can take any number of bytes so the final efficiency will
// depend on the size of the DlVertices.
// Note that the DlVertices object ends with an array of 16-bit
// indices so the alignment can be up to 6 bytes off leading to
// up to 6 bytes of overhead
struct DrawVerticesOp final : DrawOpBase {
static const auto kType = DisplayListOpType::kDrawVertices;
explicit DrawVerticesOp(DlBlendMode mode) : mode(mode) {}
const DlBlendMode mode;
void dispatch(DispatchContext& ctx) const {
if (op_needed(ctx)) {
const DlVertices* vertices =
reinterpret_cast<const DlVertices*>(this + 1);
ctx.receiver.drawVertices(vertices, mode);
}
}
};
// 4 byte header + 40 byte payload uses 44 bytes but is rounded up to 48 bytes
// (4 bytes unused)
#define DEFINE_DRAW_IMAGE_OP(name, with_attributes) \
struct name##Op final : DrawOpBase { \
static const auto kType = DisplayListOpType::k##name; \
\
name##Op(const sk_sp<DlImage>& image, \
const SkPoint& point, \
DlImageSampling sampling) \
: point(point), sampling(sampling), image(std::move(image)) {} \
\
const SkPoint point; \
const DlImageSampling sampling; \
const sk_sp<DlImage> image; \
\
void dispatch(DispatchContext& ctx) const { \
if (op_needed(ctx)) { \
ctx.receiver.drawImage(image, point, sampling, with_attributes); \
} \
} \
\
DisplayListCompare equals(const name##Op* other) const { \
return (point == other->point && sampling == other->sampling && \
image->Equals(other->image)) \
? DisplayListCompare::kEqual \
: DisplayListCompare::kNotEqual; \
} \
};
DEFINE_DRAW_IMAGE_OP(DrawImage, false)
DEFINE_DRAW_IMAGE_OP(DrawImageWithAttr, true)
#undef DEFINE_DRAW_IMAGE_OP
// 4 byte header + 72 byte payload uses 76 bytes but is rounded up to 80 bytes
// (4 bytes unused)
struct DrawImageRectOp final : DrawOpBase {
static const auto kType = DisplayListOpType::kDrawImageRect;
DrawImageRectOp(const sk_sp<DlImage>& image,
const SkRect& src,
const SkRect& dst,
DlImageSampling sampling,
bool render_with_attributes,
DlCanvas::SrcRectConstraint constraint)
: src(src),
dst(dst),
sampling(sampling),
render_with_attributes(render_with_attributes),
constraint(constraint),
image(image) {}
const SkRect src;
const SkRect dst;
const DlImageSampling sampling;
const bool render_with_attributes;
const DlCanvas::SrcRectConstraint constraint;
const sk_sp<DlImage> image;
void dispatch(DispatchContext& ctx) const {
if (op_needed(ctx)) {
ctx.receiver.drawImageRect(image, src, dst, sampling,
render_with_attributes, constraint);
}
}
DisplayListCompare equals(const DrawImageRectOp* other) const {
return (src == other->src && dst == other->dst &&
sampling == other->sampling &&
render_with_attributes == other->render_with_attributes &&
constraint == other->constraint && image->Equals(other->image))
? DisplayListCompare::kEqual
: DisplayListCompare::kNotEqual;
}
};
// 4 byte header + 44 byte payload packs efficiently into 48 bytes
#define DEFINE_DRAW_IMAGE_NINE_OP(name, render_with_attributes) \
struct name##Op final : DrawOpBase { \
static const auto kType = DisplayListOpType::k##name; \
\
name##Op(const sk_sp<DlImage>& image, \
const SkIRect& center, \
const SkRect& dst, \
DlFilterMode mode) \
: center(center), dst(dst), mode(mode), image(std::move(image)) {} \
\
const SkIRect center; \
const SkRect dst; \
const DlFilterMode mode; \
const sk_sp<DlImage> image; \
\
void dispatch(DispatchContext& ctx) const { \
if (op_needed(ctx)) { \
ctx.receiver.drawImageNine(image, center, dst, mode, \
render_with_attributes); \
} \
} \
\
DisplayListCompare equals(const name##Op* other) const { \
return (center == other->center && dst == other->dst && \
mode == other->mode && image->Equals(other->image)) \
? DisplayListCompare::kEqual \
: DisplayListCompare::kNotEqual; \
} \
};
DEFINE_DRAW_IMAGE_NINE_OP(DrawImageNine, false)
DEFINE_DRAW_IMAGE_NINE_OP(DrawImageNineWithAttr, true)
#undef DEFINE_DRAW_IMAGE_NINE_OP
// 4 byte header + 40 byte payload uses 44 bytes but is rounded up to 48 bytes
// (4 bytes unused)
// Each of these is then followed by a number of lists.
// SkRSXform list is a multiple of 16 bytes so it is always packed well
// SkRect list is also a multiple of 16 bytes so it also packs well
// DlColor list only packs well if the count is even, otherwise there
// can be 4 unusued bytes at the end.
struct DrawAtlasBaseOp : DrawOpBase {
DrawAtlasBaseOp(const sk_sp<DlImage>& atlas,
int count,
DlBlendMode mode,
DlImageSampling sampling,
bool has_colors,
bool render_with_attributes)
: count(count),
mode_index(static_cast<uint16_t>(mode)),
has_colors(has_colors),
render_with_attributes(render_with_attributes),
sampling(sampling),
atlas(atlas) {}
const int count;
const uint16_t mode_index;
const uint8_t has_colors;
const uint8_t render_with_attributes;
const DlImageSampling sampling;
const sk_sp<DlImage> atlas;
bool equals(const DrawAtlasBaseOp* other,
const void* pod_this,
const void* pod_other) const {
bool ret = (count == other->count && mode_index == other->mode_index &&
has_colors == other->has_colors &&
render_with_attributes == other->render_with_attributes &&
sampling == other->sampling && atlas->Equals(other->atlas));
if (ret) {
size_t bytes = count * (sizeof(SkRSXform) + sizeof(SkRect));
if (has_colors) {
bytes += count * sizeof(DlColor);
}
ret = (memcmp(pod_this, pod_other, bytes) == 0);
}
return ret;
}
};
// Packs into 48 bytes as per DrawAtlasBaseOp
// with array data following the struct also as per DrawAtlasBaseOp
struct DrawAtlasOp final : DrawAtlasBaseOp {
static const auto kType = DisplayListOpType::kDrawAtlas;
DrawAtlasOp(const sk_sp<DlImage>& atlas,
int count,
DlBlendMode mode,
DlImageSampling sampling,
bool has_colors,
bool render_with_attributes)
: DrawAtlasBaseOp(atlas,
count,
mode,
sampling,
has_colors,
render_with_attributes) {}
void dispatch(DispatchContext& ctx) const {
if (op_needed(ctx)) {
const SkRSXform* xform = reinterpret_cast<const SkRSXform*>(this + 1);
const SkRect* tex = reinterpret_cast<const SkRect*>(xform + count);
const DlColor* colors =
has_colors ? reinterpret_cast<const DlColor*>(tex + count) : nullptr;
const DlBlendMode mode = static_cast<DlBlendMode>(mode_index);
ctx.receiver.drawAtlas(atlas, xform, tex, colors, count, mode, sampling,
nullptr, render_with_attributes);
}
}
DisplayListCompare equals(const DrawAtlasOp* other) const {
const void* pod_this = reinterpret_cast<const void*>(this + 1);
const void* pod_other = reinterpret_cast<const void*>(other + 1);
return (DrawAtlasBaseOp::equals(other, pod_this, pod_other))
? DisplayListCompare::kEqual
: DisplayListCompare::kNotEqual;
}
};
// Packs into 48 bytes as per DrawAtlasBaseOp plus
// an additional 16 bytes for the cull rect resulting in a total
// of 56 bytes for the Culled drawAtlas.
// Also with array data following the struct as per DrawAtlasBaseOp
struct DrawAtlasCulledOp final : DrawAtlasBaseOp {
static const auto kType = DisplayListOpType::kDrawAtlasCulled;
DrawAtlasCulledOp(const sk_sp<DlImage>& atlas,
int count,
DlBlendMode mode,
DlImageSampling sampling,
bool has_colors,
const SkRect& cull_rect,
bool render_with_attributes)
: DrawAtlasBaseOp(atlas,
count,
mode,
sampling,
has_colors,
render_with_attributes),
cull_rect(cull_rect) {}
const SkRect cull_rect;
void dispatch(DispatchContext& ctx) const {
if (op_needed(ctx)) {
const SkRSXform* xform = reinterpret_cast<const SkRSXform*>(this + 1);
const SkRect* tex = reinterpret_cast<const SkRect*>(xform + count);
const DlColor* colors =
has_colors ? reinterpret_cast<const DlColor*>(tex + count) : nullptr;
const DlBlendMode mode = static_cast<DlBlendMode>(mode_index);
ctx.receiver.drawAtlas(atlas, xform, tex, colors, count, mode, sampling,
&cull_rect, render_with_attributes);
}
}
DisplayListCompare equals(const DrawAtlasCulledOp* other) const {
const void* pod_this = reinterpret_cast<const void*>(this + 1);
const void* pod_other = reinterpret_cast<const void*>(other + 1);
return (cull_rect == other->cull_rect &&
DrawAtlasBaseOp::equals(other, pod_this, pod_other))
? DisplayListCompare::kEqual
: DisplayListCompare::kNotEqual;
}
};
// 4 byte header + ptr aligned payload uses 12 bytes round up to 16
// (4 bytes unused)
struct DrawDisplayListOp final : DrawOpBase {
static const auto kType = DisplayListOpType::kDrawDisplayList;
explicit DrawDisplayListOp(const sk_sp<DisplayList>& display_list,
SkScalar opacity)
: opacity(opacity), display_list(display_list) {}
SkScalar opacity;
const sk_sp<DisplayList> display_list;
void dispatch(DispatchContext& ctx) const {
if (op_needed(ctx)) {
ctx.receiver.drawDisplayList(display_list, opacity);
}
}
DisplayListCompare equals(const DrawDisplayListOp* other) const {
return (opacity == other->opacity &&
display_list->Equals(other->display_list))
? DisplayListCompare::kEqual
: DisplayListCompare::kNotEqual;
}
};
// 4 byte header + 8 payload bytes + an aligned pointer take 24 bytes
// (4 unused to align the pointer)
struct DrawTextBlobOp final : DrawOpBase {
static const auto kType = DisplayListOpType::kDrawTextBlob;
DrawTextBlobOp(const sk_sp<SkTextBlob>& blob, SkScalar x, SkScalar y)
: x(x), y(y), blob(blob) {}
const SkScalar x;
const SkScalar y;
const sk_sp<SkTextBlob> blob;
void dispatch(DispatchContext& ctx) const {
if (op_needed(ctx)) {
ctx.receiver.drawTextBlob(blob, x, y);
}
}
};
struct DrawTextFrameOp final : DrawOpBase {
static const auto kType = DisplayListOpType::kDrawTextFrame;
DrawTextFrameOp(const std::shared_ptr<impeller::TextFrame>& text_frame,
SkScalar x,
SkScalar y)
: x(x), y(y), text_frame(text_frame) {}
const SkScalar x;
const SkScalar y;
const std::shared_ptr<impeller::TextFrame> text_frame;
void dispatch(DispatchContext& ctx) const {
if (op_needed(ctx)) {
ctx.receiver.drawTextFrame(text_frame, x, y);
}
}
};
// 4 byte header + 140 byte payload packs evenly into 140 bytes
#define DEFINE_DRAW_SHADOW_OP(name, transparent_occluder) \
struct Draw##name##Op final : DrawOpBase { \
static const auto kType = DisplayListOpType::kDraw##name; \
\
Draw##name##Op(const SkPath& path, \
DlColor color, \
SkScalar elevation, \
SkScalar dpr) \
: color(color), elevation(elevation), dpr(dpr), cached_path(path) {} \
\
const DlColor color; \
const SkScalar elevation; \
const SkScalar dpr; \
const DlOpReceiver::CacheablePath cached_path; \
\
void dispatch(DispatchContext& ctx) const { \
if (op_needed(ctx)) { \
if (ctx.receiver.PrefersImpellerPaths()) { \
ctx.receiver.drawShadow(cached_path, color, elevation, \
transparent_occluder, dpr); \
} else { \
ctx.receiver.drawShadow(cached_path.sk_path, color, elevation, \
transparent_occluder, dpr); \
} \
} \
} \
\
DisplayListCompare equals(const Draw##name##Op* other) const { \
return color == other->color && elevation == other->elevation && \
dpr == other->dpr && cached_path == other->cached_path \
? DisplayListCompare::kEqual \
: DisplayListCompare::kNotEqual; \
} \
};
DEFINE_DRAW_SHADOW_OP(Shadow, false)
DEFINE_DRAW_SHADOW_OP(ShadowTransparentOccluder, true)
#undef DEFINE_DRAW_SHADOW_OP
#pragma pack(pop, DLOpPackLabel)
} // namespace flutter
#endif // FLUTTER_DISPLAY_LIST_DL_OP_RECORDS_H_
| engine/display_list/dl_op_records.h/0 | {
"file_path": "engine/display_list/dl_op_records.h",
"repo_id": "engine",
"token_count": 23361
} | 205 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_DISPLAY_LIST_EFFECTS_DL_IMAGE_FILTER_H_
#define FLUTTER_DISPLAY_LIST_EFFECTS_DL_IMAGE_FILTER_H_
#include <utility>
#include "flutter/display_list/dl_attributes.h"
#include "flutter/display_list/dl_sampling_options.h"
#include "flutter/display_list/dl_tile_mode.h"
#include "flutter/display_list/effects/dl_color_filter.h"
#include "flutter/display_list/utils/dl_comparable.h"
#include "flutter/fml/logging.h"
#include "third_party/skia/include/core/SkMatrix.h"
namespace flutter {
// The DisplayList ImageFilter class. This class implements all of the
// facilities and adheres to the design goals of the |DlAttribute| base
// class.
//
// The objects here define operations that can take a location and one or
// more input pixels and produce a color for that output pixel
// An enumerated type for the supported ImageFilter operations.
enum class DlImageFilterType {
kBlur,
kDilate,
kErode,
kMatrix,
kCompose,
kColorFilter,
kLocalMatrix,
};
class DlBlurImageFilter;
class DlDilateImageFilter;
class DlErodeImageFilter;
class DlMatrixImageFilter;
class DlLocalMatrixImageFilter;
class DlComposeImageFilter;
class DlColorFilterImageFilter;
class DlImageFilter : public DlAttribute<DlImageFilter, DlImageFilterType> {
public:
enum class MatrixCapability {
kTranslate,
kScaleTranslate,
kComplex,
};
// Return a DlBlurImageFilter pointer to this object iff it is a Blur
// type of ImageFilter, otherwise return nullptr.
virtual const DlBlurImageFilter* asBlur() const { return nullptr; }
// Return a DlDilateImageFilter pointer to this object iff it is a Dilate
// type of ImageFilter, otherwise return nullptr.
virtual const DlDilateImageFilter* asDilate() const { return nullptr; }
// Return a DlErodeImageFilter pointer to this object iff it is an Erode
// type of ImageFilter, otherwise return nullptr.
virtual const DlErodeImageFilter* asErode() const { return nullptr; }
// Return a DlMatrixImageFilter pointer to this object iff it is a Matrix
// type of ImageFilter, otherwise return nullptr.
virtual const DlMatrixImageFilter* asMatrix() const { return nullptr; }
virtual const DlLocalMatrixImageFilter* asLocalMatrix() const {
return nullptr;
}
virtual std::shared_ptr<DlImageFilter> makeWithLocalMatrix(
const SkMatrix& matrix) const;
// Return a DlComposeImageFilter pointer to this object iff it is a Compose
// type of ImageFilter, otherwise return nullptr.
virtual const DlComposeImageFilter* asCompose() const { return nullptr; }
// Return a DlColorFilterImageFilter pointer to this object iff it is a
// ColorFilter type of ImageFilter, otherwise return nullptr.
virtual const DlColorFilterImageFilter* asColorFilter() const {
return nullptr;
}
// Return a boolean indicating whether the image filtering operation will
// modify transparent black. This is typically used to determine if applying
// the ImageFilter to a temporary saveLayer buffer will turn the surrounding
// pixels non-transparent and therefore expand the bounds.
virtual bool modifies_transparent_black() const = 0;
// Return the bounds of the output for this image filtering operation
// based on the supplied input bounds where both are measured in the local
// (untransformed) coordinate space.
//
// The method will return a pointer to the output_bounds parameter if it
// can successfully compute the output bounds of the filter, otherwise the
// method will return a nullptr and the output_bounds will be filled with
// a best guess for the answer, even if just a copy of the input_bounds.
virtual SkRect* map_local_bounds(const SkRect& input_bounds,
SkRect& output_bounds) const = 0;
// Return the device bounds of the output for this image filtering operation
// based on the supplied input device bounds where both are measured in the
// pixel coordinate space and relative to the given rendering ctm. The
// transform matrix is used to adjust the filter parameters for when it
// is used in a rendering operation (for example, the blur radius of a
// Blur filter will expand based on the ctm).
//
// The method will return a pointer to the output_bounds parameter if it
// can successfully compute the output bounds of the filter, otherwise the
// method will return a nullptr and the output_bounds will be filled with
// a best guess for the answer, even if just a copy of the input_bounds.
virtual SkIRect* map_device_bounds(const SkIRect& input_bounds,
const SkMatrix& ctm,
SkIRect& output_bounds) const = 0;
// Return the input bounds that will be needed in order for the filter to
// properly fill the indicated output_bounds under the specified
// transformation matrix. Both output_bounds and input_bounds are taken to
// be relative to the transformed coordinate space of the provided |ctm|.
//
// The method will return a pointer to the input_bounds parameter if it
// can successfully compute the required input bounds, otherwise the
// method will return a nullptr and the input_bounds will be filled with
// a best guess for the answer, even if just a copy of the output_bounds.
virtual SkIRect* get_input_device_bounds(const SkIRect& output_bounds,
const SkMatrix& ctm,
SkIRect& input_bounds) const = 0;
virtual MatrixCapability matrix_capability() const {
return MatrixCapability::kScaleTranslate;
}
protected:
static SkVector map_vectors_affine(const SkMatrix& ctm,
SkScalar x,
SkScalar y) {
FML_DCHECK(SkScalarIsFinite(x) && x >= 0);
FML_DCHECK(SkScalarIsFinite(y) && y >= 0);
FML_DCHECK(ctm.isFinite() && !ctm.hasPerspective());
// The x and y scalars would have been used to expand a local space
// rectangle which is then transformed by ctm. In order to do the
// expansion correctly, we should look at the relevant math. The
// 4 corners will be moved outward by the following vectors:
// (UL,UR,LR,LL) = ((-x, -y), (+x, -y), (+x, +y), (-x, +y))
// After applying the transform, each of these vectors could be
// pointing in any direction so we need to examine each transformed
// delta vector and how it affected the bounds.
// Looking at just the affine 2x3 entries of the CTM we can delta
// transform these corner offsets and get the following:
// UL = dCTM(-x, -y) = (- x*m00 - y*m01, - x*m10 - y*m11)
// UR = dCTM(+x, -y) = ( x*m00 - y*m01, x*m10 - y*m11)
// LR = dCTM(+x, +y) = ( x*m00 + y*m01, x*m10 + y*m11)
// LL = dCTM(-x, +y) = (- x*m00 + y*m01, - x*m10 + y*m11)
// The X vectors are all some variation of adding or subtracting
// the sum of x*m00 and y*m01 or their difference. Similarly the Y
// vectors are +/- the associated sum/difference of x*m10 and y*m11.
// The largest displacements, both left/right or up/down, will
// happen when the signs of the m00/m01/m10/m11 matrix entries
// coincide with the signs of the scalars, i.e. are all positive.
return {x * abs(ctm[0]) + y * abs(ctm[1]),
x * abs(ctm[3]) + y * abs(ctm[4])};
}
static SkIRect* inset_device_bounds(const SkIRect& input_bounds,
SkScalar radius_x,
SkScalar radius_y,
const SkMatrix& ctm,
SkIRect& output_bounds) {
if (ctm.isFinite()) {
if (ctm.hasPerspective()) {
SkMatrix inverse;
if (ctm.invert(&inverse)) {
SkRect local_bounds = inverse.mapRect(SkRect::Make(input_bounds));
local_bounds.inset(radius_x, radius_y);
output_bounds = ctm.mapRect(local_bounds).roundOut();
return &output_bounds;
}
} else {
SkVector device_radius = map_vectors_affine(ctm, radius_x, radius_y);
output_bounds = input_bounds.makeInset(floor(device_radius.fX), //
floor(device_radius.fY));
return &output_bounds;
}
}
output_bounds = input_bounds;
return nullptr;
}
static SkIRect* outset_device_bounds(const SkIRect& input_bounds,
SkScalar radius_x,
SkScalar radius_y,
const SkMatrix& ctm,
SkIRect& output_bounds) {
if (ctm.isFinite()) {
if (ctm.hasPerspective()) {
SkMatrix inverse;
if (ctm.invert(&inverse)) {
SkRect local_bounds = inverse.mapRect(SkRect::Make(input_bounds));
local_bounds.outset(radius_x, radius_y);
output_bounds = ctm.mapRect(local_bounds).roundOut();
return &output_bounds;
}
} else {
SkVector device_radius = map_vectors_affine(ctm, radius_x, radius_y);
output_bounds = input_bounds.makeOutset(ceil(device_radius.fX), //
ceil(device_radius.fY));
return &output_bounds;
}
}
output_bounds = input_bounds;
return nullptr;
}
};
class DlBlurImageFilter final : public DlImageFilter {
public:
DlBlurImageFilter(SkScalar sigma_x, SkScalar sigma_y, DlTileMode tile_mode)
: sigma_x_(sigma_x), sigma_y_(sigma_y), tile_mode_(tile_mode) {}
explicit DlBlurImageFilter(const DlBlurImageFilter* filter)
: DlBlurImageFilter(filter->sigma_x_,
filter->sigma_y_,
filter->tile_mode_) {}
DlBlurImageFilter(const DlBlurImageFilter& filter)
: DlBlurImageFilter(&filter) {}
static std::shared_ptr<DlImageFilter> Make(SkScalar sigma_x,
SkScalar sigma_y,
DlTileMode tile_mode) {
if (!SkScalarIsFinite(sigma_x) || !SkScalarIsFinite(sigma_y)) {
return nullptr;
}
if (sigma_x < SK_ScalarNearlyZero && sigma_y < SK_ScalarNearlyZero) {
return nullptr;
}
sigma_x = (sigma_x < SK_ScalarNearlyZero) ? 0 : sigma_x;
sigma_y = (sigma_y < SK_ScalarNearlyZero) ? 0 : sigma_y;
return std::make_shared<DlBlurImageFilter>(sigma_x, sigma_y, tile_mode);
}
std::shared_ptr<DlImageFilter> shared() const override {
return std::make_shared<DlBlurImageFilter>(this);
}
DlImageFilterType type() const override { return DlImageFilterType::kBlur; }
size_t size() const override { return sizeof(*this); }
const DlBlurImageFilter* asBlur() const override { return this; }
bool modifies_transparent_black() const override { return false; }
SkRect* map_local_bounds(const SkRect& input_bounds,
SkRect& output_bounds) const override {
output_bounds = input_bounds.makeOutset(sigma_x_ * 3.0f, sigma_y_ * 3.0f);
return &output_bounds;
}
SkIRect* map_device_bounds(const SkIRect& input_bounds,
const SkMatrix& ctm,
SkIRect& output_bounds) const override {
return outset_device_bounds(input_bounds, sigma_x_ * 3.0f, sigma_y_ * 3.0f,
ctm, output_bounds);
}
SkIRect* get_input_device_bounds(const SkIRect& output_bounds,
const SkMatrix& ctm,
SkIRect& input_bounds) const override {
// Blurs are symmetric in terms of output-for-input and input-for-output
return map_device_bounds(output_bounds, ctm, input_bounds);
}
SkScalar sigma_x() const { return sigma_x_; }
SkScalar sigma_y() const { return sigma_y_; }
DlTileMode tile_mode() const { return tile_mode_; }
protected:
bool equals_(const DlImageFilter& other) const override {
FML_DCHECK(other.type() == DlImageFilterType::kBlur);
auto that = static_cast<const DlBlurImageFilter*>(&other);
return (sigma_x_ == that->sigma_x_ && sigma_y_ == that->sigma_y_ &&
tile_mode_ == that->tile_mode_);
}
private:
SkScalar sigma_x_;
SkScalar sigma_y_;
DlTileMode tile_mode_;
};
class DlDilateImageFilter final : public DlImageFilter {
public:
DlDilateImageFilter(SkScalar radius_x, SkScalar radius_y)
: radius_x_(radius_x), radius_y_(radius_y) {}
explicit DlDilateImageFilter(const DlDilateImageFilter* filter)
: DlDilateImageFilter(filter->radius_x_, filter->radius_y_) {}
DlDilateImageFilter(const DlDilateImageFilter& filter)
: DlDilateImageFilter(&filter) {}
static std::shared_ptr<DlImageFilter> Make(SkScalar radius_x,
SkScalar radius_y) {
if (SkScalarIsFinite(radius_x) && radius_x > SK_ScalarNearlyZero &&
SkScalarIsFinite(radius_y) && radius_y > SK_ScalarNearlyZero) {
return std::make_shared<DlDilateImageFilter>(radius_x, radius_y);
}
return nullptr;
}
std::shared_ptr<DlImageFilter> shared() const override {
return std::make_shared<DlDilateImageFilter>(this);
}
DlImageFilterType type() const override { return DlImageFilterType::kDilate; }
size_t size() const override { return sizeof(*this); }
const DlDilateImageFilter* asDilate() const override { return this; }
bool modifies_transparent_black() const override { return false; }
SkRect* map_local_bounds(const SkRect& input_bounds,
SkRect& output_bounds) const override {
output_bounds = input_bounds.makeOutset(radius_x_, radius_y_);
return &output_bounds;
}
SkIRect* map_device_bounds(const SkIRect& input_bounds,
const SkMatrix& ctm,
SkIRect& output_bounds) const override {
return outset_device_bounds(input_bounds, radius_x_, radius_y_, ctm,
output_bounds);
}
SkIRect* get_input_device_bounds(const SkIRect& output_bounds,
const SkMatrix& ctm,
SkIRect& input_bounds) const override {
return inset_device_bounds(output_bounds, radius_x_, radius_y_, ctm,
input_bounds);
}
SkScalar radius_x() const { return radius_x_; }
SkScalar radius_y() const { return radius_y_; }
protected:
bool equals_(const DlImageFilter& other) const override {
FML_DCHECK(other.type() == DlImageFilterType::kDilate);
auto that = static_cast<const DlDilateImageFilter*>(&other);
return (radius_x_ == that->radius_x_ && radius_y_ == that->radius_y_);
}
private:
SkScalar radius_x_;
SkScalar radius_y_;
};
class DlErodeImageFilter final : public DlImageFilter {
public:
DlErodeImageFilter(SkScalar radius_x, SkScalar radius_y)
: radius_x_(radius_x), radius_y_(radius_y) {}
explicit DlErodeImageFilter(const DlErodeImageFilter* filter)
: DlErodeImageFilter(filter->radius_x_, filter->radius_y_) {}
DlErodeImageFilter(const DlErodeImageFilter& filter)
: DlErodeImageFilter(&filter) {}
static std::shared_ptr<DlImageFilter> Make(SkScalar radius_x,
SkScalar radius_y) {
if (SkScalarIsFinite(radius_x) && radius_x > SK_ScalarNearlyZero &&
SkScalarIsFinite(radius_y) && radius_y > SK_ScalarNearlyZero) {
return std::make_shared<DlErodeImageFilter>(radius_x, radius_y);
}
return nullptr;
}
std::shared_ptr<DlImageFilter> shared() const override {
return std::make_shared<DlErodeImageFilter>(this);
}
DlImageFilterType type() const override { return DlImageFilterType::kErode; }
size_t size() const override { return sizeof(*this); }
const DlErodeImageFilter* asErode() const override { return this; }
bool modifies_transparent_black() const override { return false; }
SkRect* map_local_bounds(const SkRect& input_bounds,
SkRect& output_bounds) const override {
output_bounds = input_bounds.makeInset(radius_x_, radius_y_);
return &output_bounds;
}
SkIRect* map_device_bounds(const SkIRect& input_bounds,
const SkMatrix& ctm,
SkIRect& output_bounds) const override {
return inset_device_bounds(input_bounds, radius_x_, radius_y_, ctm,
output_bounds);
}
SkIRect* get_input_device_bounds(const SkIRect& output_bounds,
const SkMatrix& ctm,
SkIRect& input_bounds) const override {
return outset_device_bounds(output_bounds, radius_x_, radius_y_, ctm,
input_bounds);
}
SkScalar radius_x() const { return radius_x_; }
SkScalar radius_y() const { return radius_y_; }
protected:
bool equals_(const DlImageFilter& other) const override {
FML_DCHECK(other.type() == DlImageFilterType::kErode);
auto that = static_cast<const DlErodeImageFilter*>(&other);
return (radius_x_ == that->radius_x_ && radius_y_ == that->radius_y_);
}
private:
SkScalar radius_x_;
SkScalar radius_y_;
};
class DlMatrixImageFilter final : public DlImageFilter {
public:
DlMatrixImageFilter(const SkMatrix& matrix, DlImageSampling sampling)
: matrix_(matrix), sampling_(sampling) {}
explicit DlMatrixImageFilter(const DlMatrixImageFilter* filter)
: DlMatrixImageFilter(filter->matrix_, filter->sampling_) {}
DlMatrixImageFilter(const DlMatrixImageFilter& filter)
: DlMatrixImageFilter(&filter) {}
static std::shared_ptr<DlImageFilter> Make(const SkMatrix& matrix,
DlImageSampling sampling) {
if (matrix.isFinite() && !matrix.isIdentity()) {
return std::make_shared<DlMatrixImageFilter>(matrix, sampling);
}
return nullptr;
}
std::shared_ptr<DlImageFilter> shared() const override {
return std::make_shared<DlMatrixImageFilter>(this);
}
DlImageFilterType type() const override { return DlImageFilterType::kMatrix; }
size_t size() const override { return sizeof(*this); }
const SkMatrix& matrix() const { return matrix_; }
DlImageSampling sampling() const { return sampling_; }
const DlMatrixImageFilter* asMatrix() const override { return this; }
bool modifies_transparent_black() const override { return false; }
SkRect* map_local_bounds(const SkRect& input_bounds,
SkRect& output_bounds) const override {
output_bounds = matrix_.mapRect(input_bounds);
return &output_bounds;
}
SkIRect* map_device_bounds(const SkIRect& input_bounds,
const SkMatrix& ctm,
SkIRect& output_bounds) const override {
SkMatrix matrix;
if (!ctm.invert(&matrix)) {
output_bounds = input_bounds;
return nullptr;
}
matrix.postConcat(matrix_);
matrix.postConcat(ctm);
SkRect device_rect;
matrix.mapRect(&device_rect, SkRect::Make(input_bounds));
output_bounds = device_rect.roundOut();
return &output_bounds;
}
SkIRect* get_input_device_bounds(const SkIRect& output_bounds,
const SkMatrix& ctm,
SkIRect& input_bounds) const override {
SkMatrix matrix = SkMatrix::Concat(ctm, matrix_);
SkMatrix inverse;
if (!matrix.invert(&inverse)) {
input_bounds = output_bounds;
return nullptr;
}
inverse.postConcat(ctm);
SkRect bounds;
bounds.set(output_bounds);
inverse.mapRect(&bounds);
input_bounds = bounds.roundOut();
return &input_bounds;
}
protected:
bool equals_(const DlImageFilter& other) const override {
FML_DCHECK(other.type() == DlImageFilterType::kMatrix);
auto that = static_cast<const DlMatrixImageFilter*>(&other);
return (matrix_ == that->matrix_ && sampling_ == that->sampling_);
}
private:
SkMatrix matrix_;
DlImageSampling sampling_;
};
class DlComposeImageFilter final : public DlImageFilter {
public:
DlComposeImageFilter(std::shared_ptr<const DlImageFilter> outer,
std::shared_ptr<const DlImageFilter> inner)
: outer_(std::move(outer)), inner_(std::move(inner)) {}
DlComposeImageFilter(const DlImageFilter* outer, const DlImageFilter* inner)
: outer_(outer->shared()), inner_(inner->shared()) {}
DlComposeImageFilter(const DlImageFilter& outer, const DlImageFilter& inner)
: DlComposeImageFilter(&outer, &inner) {}
explicit DlComposeImageFilter(const DlComposeImageFilter* filter)
: DlComposeImageFilter(filter->outer_, filter->inner_) {}
DlComposeImageFilter(const DlComposeImageFilter& filter)
: DlComposeImageFilter(&filter) {}
static std::shared_ptr<const DlImageFilter> Make(
std::shared_ptr<const DlImageFilter> outer,
std::shared_ptr<const DlImageFilter> inner) {
if (!outer) {
return inner;
}
if (!inner) {
return outer;
}
return std::make_shared<DlComposeImageFilter>(outer, inner);
}
std::shared_ptr<DlImageFilter> shared() const override {
return std::make_shared<DlComposeImageFilter>(this);
}
DlImageFilterType type() const override {
return DlImageFilterType::kCompose;
}
size_t size() const override { return sizeof(*this); }
std::shared_ptr<const DlImageFilter> outer() const { return outer_; }
std::shared_ptr<const DlImageFilter> inner() const { return inner_; }
const DlComposeImageFilter* asCompose() const override { return this; }
bool modifies_transparent_black() const override {
if (inner_ && inner_->modifies_transparent_black()) {
return true;
}
if (outer_ && outer_->modifies_transparent_black()) {
return true;
}
return false;
}
SkRect* map_local_bounds(const SkRect& input_bounds,
SkRect& output_bounds) const override;
SkIRect* map_device_bounds(const SkIRect& input_bounds,
const SkMatrix& ctm,
SkIRect& output_bounds) const override;
SkIRect* get_input_device_bounds(const SkIRect& output_bounds,
const SkMatrix& ctm,
SkIRect& input_bounds) const override;
MatrixCapability matrix_capability() const override {
return std::min(outer_->matrix_capability(), inner_->matrix_capability());
}
protected:
bool equals_(const DlImageFilter& other) const override {
FML_DCHECK(other.type() == DlImageFilterType::kCompose);
auto that = static_cast<const DlComposeImageFilter*>(&other);
return (Equals(outer_, that->outer_) && Equals(inner_, that->inner_));
}
private:
std::shared_ptr<const DlImageFilter> outer_;
std::shared_ptr<const DlImageFilter> inner_;
};
class DlColorFilterImageFilter final : public DlImageFilter {
public:
explicit DlColorFilterImageFilter(std::shared_ptr<const DlColorFilter> filter)
: color_filter_(std::move(filter)) {}
explicit DlColorFilterImageFilter(const DlColorFilter* filter)
: color_filter_(filter->shared()) {}
explicit DlColorFilterImageFilter(const DlColorFilter& filter)
: color_filter_(filter.shared()) {}
explicit DlColorFilterImageFilter(const DlColorFilterImageFilter* filter)
: DlColorFilterImageFilter(filter->color_filter_) {}
DlColorFilterImageFilter(const DlColorFilterImageFilter& filter)
: DlColorFilterImageFilter(&filter) {}
static std::shared_ptr<DlImageFilter> Make(
const std::shared_ptr<const DlColorFilter>& filter) {
if (filter) {
return std::make_shared<DlColorFilterImageFilter>(filter);
}
return nullptr;
}
std::shared_ptr<DlImageFilter> shared() const override {
return std::make_shared<DlColorFilterImageFilter>(color_filter_);
}
DlImageFilterType type() const override {
return DlImageFilterType::kColorFilter;
}
size_t size() const override { return sizeof(*this); }
const std::shared_ptr<const DlColorFilter> color_filter() const {
return color_filter_;
}
const DlColorFilterImageFilter* asColorFilter() const override {
return this;
}
bool modifies_transparent_black() const override {
if (color_filter_) {
return color_filter_->modifies_transparent_black();
}
return false;
}
SkRect* map_local_bounds(const SkRect& input_bounds,
SkRect& output_bounds) const override {
output_bounds = input_bounds;
return modifies_transparent_black() ? nullptr : &output_bounds;
}
SkIRect* map_device_bounds(const SkIRect& input_bounds,
const SkMatrix& ctm,
SkIRect& output_bounds) const override {
output_bounds = input_bounds;
return modifies_transparent_black() ? nullptr : &output_bounds;
}
SkIRect* get_input_device_bounds(const SkIRect& output_bounds,
const SkMatrix& ctm,
SkIRect& input_bounds) const override {
return map_device_bounds(output_bounds, ctm, input_bounds);
}
MatrixCapability matrix_capability() const override {
return MatrixCapability::kComplex;
}
std::shared_ptr<DlImageFilter> makeWithLocalMatrix(
const SkMatrix& matrix) const override {
return shared();
}
protected:
bool equals_(const DlImageFilter& other) const override {
FML_DCHECK(other.type() == DlImageFilterType::kColorFilter);
auto that = static_cast<const DlColorFilterImageFilter*>(&other);
return Equals(color_filter_, that->color_filter_);
}
private:
std::shared_ptr<const DlColorFilter> color_filter_;
};
class DlLocalMatrixImageFilter final : public DlImageFilter {
public:
explicit DlLocalMatrixImageFilter(const SkMatrix& matrix,
std::shared_ptr<DlImageFilter> filter)
: matrix_(matrix), image_filter_(std::move(filter)) {}
explicit DlLocalMatrixImageFilter(const DlLocalMatrixImageFilter* filter)
: DlLocalMatrixImageFilter(filter->matrix_, filter->image_filter_) {}
DlLocalMatrixImageFilter(const DlLocalMatrixImageFilter& filter)
: DlLocalMatrixImageFilter(&filter) {}
std::shared_ptr<DlImageFilter> shared() const override {
return std::make_shared<DlLocalMatrixImageFilter>(this);
}
DlImageFilterType type() const override {
return DlImageFilterType::kLocalMatrix;
}
size_t size() const override { return sizeof(*this); }
const SkMatrix& matrix() const { return matrix_; }
const std::shared_ptr<DlImageFilter> image_filter() const {
return image_filter_;
}
const DlLocalMatrixImageFilter* asLocalMatrix() const override {
return this;
}
bool modifies_transparent_black() const override {
if (!image_filter_) {
return false;
}
return image_filter_->modifies_transparent_black();
}
SkRect* map_local_bounds(const SkRect& input_bounds,
SkRect& output_bounds) const override {
if (!image_filter_) {
output_bounds = input_bounds;
return &output_bounds;
}
return image_filter_->map_local_bounds(input_bounds, output_bounds);
}
SkIRect* map_device_bounds(const SkIRect& input_bounds,
const SkMatrix& ctm,
SkIRect& output_bounds) const override {
if (!image_filter_) {
output_bounds = input_bounds;
return &output_bounds;
}
return image_filter_->map_device_bounds(
input_bounds, SkMatrix::Concat(ctm, matrix_), output_bounds);
}
SkIRect* get_input_device_bounds(const SkIRect& output_bounds,
const SkMatrix& ctm,
SkIRect& input_bounds) const override {
if (!image_filter_) {
input_bounds = output_bounds;
return &input_bounds;
}
return image_filter_->get_input_device_bounds(
output_bounds, SkMatrix::Concat(ctm, matrix_), input_bounds);
}
protected:
bool equals_(const DlImageFilter& other) const override {
FML_DCHECK(other.type() == DlImageFilterType::kLocalMatrix);
auto that = static_cast<const DlLocalMatrixImageFilter*>(&other);
return (matrix_ == that->matrix_ &&
Equals(image_filter_, that->image_filter_));
}
private:
SkMatrix matrix_;
std::shared_ptr<DlImageFilter> image_filter_;
};
} // namespace flutter
#endif // FLUTTER_DISPLAY_LIST_EFFECTS_DL_IMAGE_FILTER_H_
| engine/display_list/effects/dl_image_filter.h/0 | {
"file_path": "engine/display_list/effects/dl_image_filter.h",
"repo_id": "engine",
"token_count": 11688
} | 206 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/display_list/image/dl_image.h"
#include "flutter/display_list/image/dl_image_skia.h"
namespace flutter {
sk_sp<DlImage> DlImage::Make(const SkImage* image) {
return Make(sk_ref_sp(image));
}
sk_sp<DlImage> DlImage::Make(sk_sp<SkImage> image) {
return sk_make_sp<DlImageSkia>(std::move(image));
}
DlImage::DlImage() = default;
DlImage::~DlImage() = default;
int DlImage::width() const {
return dimensions().fWidth;
};
int DlImage::height() const {
return dimensions().fHeight;
};
SkIRect DlImage::bounds() const {
return SkIRect::MakeSize(dimensions());
}
std::optional<std::string> DlImage::get_error() const {
return std::nullopt;
}
} // namespace flutter
| engine/display_list/image/dl_image.cc/0 | {
"file_path": "engine/display_list/image/dl_image.cc",
"repo_id": "engine",
"token_count": 314
} | 207 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <utility>
#include "flutter/display_list/display_list.h"
#include "flutter/display_list/dl_builder.h"
#include "flutter/display_list/dl_op_flags.h"
#include "flutter/display_list/dl_sampling_options.h"
#include "flutter/display_list/skia/dl_sk_canvas.h"
#include "flutter/display_list/skia/dl_sk_conversions.h"
#include "flutter/display_list/skia/dl_sk_dispatcher.h"
#include "flutter/display_list/testing/dl_test_snippets.h"
#include "flutter/display_list/testing/dl_test_surface_provider.h"
#include "flutter/display_list/utils/dl_comparable.h"
#include "flutter/fml/file.h"
#include "flutter/fml/math.h"
#include "flutter/testing/display_list_testing.h"
#include "flutter/testing/testing.h"
#ifdef IMPELLER_SUPPORTS_RENDERING
#include "flutter/impeller/typographer/backends/skia/text_frame_skia.h"
#endif // IMPELLER_SUPPORTS_RENDERING
#include "third_party/skia/include/core/SkBBHFactory.h"
#include "third_party/skia/include/core/SkColorFilter.h"
#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkFontMgr.h"
#include "third_party/skia/include/core/SkPictureRecorder.h"
#include "third_party/skia/include/core/SkStream.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/core/SkTypeface.h"
#include "third_party/skia/include/effects/SkGradientShader.h"
#include "third_party/skia/include/effects/SkImageFilters.h"
#include "third_party/skia/include/encode/SkPngEncoder.h"
#include "third_party/skia/include/gpu/GrDirectContext.h"
#include "third_party/skia/include/gpu/GrRecordingContext.h"
#include "third_party/skia/include/gpu/GrTypes.h"
#include "txt/platform.h"
namespace flutter {
namespace testing {
using ClipOp = DlCanvas::ClipOp;
using PointMode = DlCanvas::PointMode;
constexpr int kTestWidth = 200;
constexpr int kTestHeight = 200;
constexpr int kRenderWidth = 100;
constexpr int kRenderHeight = 100;
constexpr int kRenderHalfWidth = 50;
constexpr int kRenderHalfHeight = 50;
constexpr int kRenderLeft = (kTestWidth - kRenderWidth) / 2;
constexpr int kRenderTop = (kTestHeight - kRenderHeight) / 2;
constexpr int kRenderRight = kRenderLeft + kRenderWidth;
constexpr int kRenderBottom = kRenderTop + kRenderHeight;
constexpr int kRenderCenterX = (kRenderLeft + kRenderRight) / 2;
constexpr int kRenderCenterY = (kRenderTop + kRenderBottom) / 2;
constexpr SkScalar kRenderRadius = std::min(kRenderWidth, kRenderHeight) / 2.0;
constexpr SkScalar kRenderCornerRadius = kRenderRadius / 5.0;
constexpr SkPoint kTestCenter = SkPoint::Make(kTestWidth / 2, kTestHeight / 2);
constexpr SkRect kTestBounds2 = SkRect::MakeWH(kTestWidth, kTestHeight);
constexpr SkRect kRenderBounds =
SkRect::MakeLTRB(kRenderLeft, kRenderTop, kRenderRight, kRenderBottom);
// The tests try 3 miter limit values, 0.0, 4.0 (the default), and 10.0
// These values will allow us to construct a diamond that spans the
// width or height of the render box and still show the miter for 4.0
// and 10.0.
// These values were discovered by drawing a diamond path in Skia fiddle
// and then playing with the cross-axis size until the miter was about
// as large as it could get before it got cut off.
// The X offsets which will be used for tall vertical diamonds are
// expressed in terms of the rendering height to obtain the proper angle
constexpr SkScalar kMiterExtremeDiamondOffsetX = kRenderHeight * 0.04;
constexpr SkScalar kMiter10DiamondOffsetX = kRenderHeight * 0.051;
constexpr SkScalar kMiter4DiamondOffsetX = kRenderHeight * 0.14;
// The Y offsets which will be used for long horizontal diamonds are
// expressed in terms of the rendering width to obtain the proper angle
constexpr SkScalar kMiterExtremeDiamondOffsetY = kRenderWidth * 0.04;
constexpr SkScalar kMiter10DiamondOffsetY = kRenderWidth * 0.051;
constexpr SkScalar kMiter4DiamondOffsetY = kRenderWidth * 0.14;
// Render 3 vertical and horizontal diamonds each
// designed to break at the tested miter limits
// 0.0, 4.0 and 10.0
// Center is biased by 0.5 to include more pixel centers in the
// thin miters
constexpr SkScalar kXOffset0 = kRenderCenterX + 0.5;
constexpr SkScalar kXOffsetL1 = kXOffset0 - kMiter4DiamondOffsetX;
constexpr SkScalar kXOffsetL2 = kXOffsetL1 - kMiter10DiamondOffsetX;
constexpr SkScalar kXOffsetL3 = kXOffsetL2 - kMiter10DiamondOffsetX;
constexpr SkScalar kXOffsetR1 = kXOffset0 + kMiter4DiamondOffsetX;
constexpr SkScalar kXOffsetR2 = kXOffsetR1 + kMiterExtremeDiamondOffsetX;
constexpr SkScalar kXOffsetR3 = kXOffsetR2 + kMiterExtremeDiamondOffsetX;
constexpr SkPoint kVerticalMiterDiamondPoints[] = {
// Vertical diamonds:
// M10 M4 Mextreme
// /\ /|\ /\ top of RenderBounds
// / \ / | \ / \ to
// <----X--+--X----> RenderCenter
// \ / \ | / \ / to
// \/ \|/ \/ bottom of RenderBounds
// clang-format off
SkPoint::Make(kXOffsetL3, kRenderCenterY),
SkPoint::Make(kXOffsetL2, kRenderTop),
SkPoint::Make(kXOffsetL1, kRenderCenterY),
SkPoint::Make(kXOffset0, kRenderTop),
SkPoint::Make(kXOffsetR1, kRenderCenterY),
SkPoint::Make(kXOffsetR2, kRenderTop),
SkPoint::Make(kXOffsetR3, kRenderCenterY),
SkPoint::Make(kXOffsetR2, kRenderBottom),
SkPoint::Make(kXOffsetR1, kRenderCenterY),
SkPoint::Make(kXOffset0, kRenderBottom),
SkPoint::Make(kXOffsetL1, kRenderCenterY),
SkPoint::Make(kXOffsetL2, kRenderBottom),
SkPoint::Make(kXOffsetL3, kRenderCenterY),
// clang-format on
};
const int kVerticalMiterDiamondPointCount =
sizeof(kVerticalMiterDiamondPoints) /
sizeof(kVerticalMiterDiamondPoints[0]);
constexpr SkScalar kYOffset0 = kRenderCenterY + 0.5;
constexpr SkScalar kYOffsetU1 = kXOffset0 - kMiter4DiamondOffsetY;
constexpr SkScalar kYOffsetU2 = kYOffsetU1 - kMiter10DiamondOffsetY;
constexpr SkScalar kYOffsetU3 = kYOffsetU2 - kMiter10DiamondOffsetY;
constexpr SkScalar kYOffsetD1 = kXOffset0 + kMiter4DiamondOffsetY;
constexpr SkScalar kYOffsetD2 = kYOffsetD1 + kMiterExtremeDiamondOffsetY;
constexpr SkScalar kYOffsetD3 = kYOffsetD2 + kMiterExtremeDiamondOffsetY;
const SkPoint kHorizontalMiterDiamondPoints[] = {
// Horizontal diamonds
// Same configuration as Vertical diamonds above but
// rotated 90 degrees
// clang-format off
SkPoint::Make(kRenderCenterX, kYOffsetU3),
SkPoint::Make(kRenderLeft, kYOffsetU2),
SkPoint::Make(kRenderCenterX, kYOffsetU1),
SkPoint::Make(kRenderLeft, kYOffset0),
SkPoint::Make(kRenderCenterX, kYOffsetD1),
SkPoint::Make(kRenderLeft, kYOffsetD2),
SkPoint::Make(kRenderCenterX, kYOffsetD3),
SkPoint::Make(kRenderRight, kYOffsetD2),
SkPoint::Make(kRenderCenterX, kYOffsetD1),
SkPoint::Make(kRenderRight, kYOffset0),
SkPoint::Make(kRenderCenterX, kYOffsetU1),
SkPoint::Make(kRenderRight, kYOffsetU2),
SkPoint::Make(kRenderCenterX, kYOffsetU3),
// clang-format on
};
const int kHorizontalMiterDiamondPointCount =
(sizeof(kHorizontalMiterDiamondPoints) /
sizeof(kHorizontalMiterDiamondPoints[0]));
class SkImageSampling {
public:
static constexpr SkSamplingOptions kNearestNeighbor =
SkSamplingOptions(SkFilterMode::kNearest);
static constexpr SkSamplingOptions kLinear =
SkSamplingOptions(SkFilterMode::kLinear);
static constexpr SkSamplingOptions kMipmapLinear =
SkSamplingOptions(SkFilterMode::kLinear, SkMipmapMode::kLinear);
static constexpr SkSamplingOptions kCubic =
SkSamplingOptions(SkCubicResampler{1 / 3.0f, 1 / 3.0f});
};
static void DrawCheckerboard(DlCanvas* canvas) {
DlPaint p0, p1;
p0.setDrawStyle(DlDrawStyle::kFill);
p0.setColor(DlColor(0xff00fe00)); // off-green
p1.setDrawStyle(DlDrawStyle::kFill);
p1.setColor(DlColor::kBlue());
// Some pixels need some transparency for DstIn testing
p1.setAlpha(128);
int cbdim = 5;
int width = canvas->GetBaseLayerSize().width();
int height = canvas->GetBaseLayerSize().height();
for (int y = 0; y < width; y += cbdim) {
for (int x = 0; x < height; x += cbdim) {
DlPaint& cellp = ((x + y) & 1) == 0 ? p0 : p1;
canvas->DrawRect(SkRect::MakeXYWH(x, y, cbdim, cbdim), cellp);
}
}
}
static void DrawCheckerboard(SkCanvas* canvas) {
DlSkCanvasAdapter dl_canvas(canvas);
DrawCheckerboard(&dl_canvas);
}
static std::shared_ptr<DlImageColorSource> MakeColorSource(
const sk_sp<DlImage>& image) {
return std::make_shared<DlImageColorSource>(image, //
DlTileMode::kRepeat, //
DlTileMode::kRepeat, //
DlImageSampling::kLinear);
}
static sk_sp<SkShader> MakeColorSource(const sk_sp<SkImage>& image) {
return image->makeShader(SkTileMode::kRepeat, //
SkTileMode::kRepeat, //
SkImageSampling::kLinear);
}
// Used to show "INFO" warnings about tests that are omitted on certain
// backends, but only once for the entire test run to avoid warning spam
class OncePerBackendWarning {
public:
explicit OncePerBackendWarning(const std::string& warning)
: warning_(warning) {}
void warn(const std::string& name) {
if (warnings_sent_.find(name) == warnings_sent_.end()) {
warnings_sent_.insert(name);
FML_LOG(INFO) << warning_ << " on " << name;
}
}
private:
std::string warning_;
std::set<std::string> warnings_sent_;
};
// A class to specify how much tolerance to allow in bounds estimates.
// For some attributes, the machinery must make some conservative
// assumptions as to the extent of the bounds, but some of our test
// parameters do not produce bounds that expand by the full conservative
// estimates. This class provides a number of tweaks to apply to the
// pixel bounds to account for the conservative factors.
//
// An instance is passed along through the methods and if any test adds
// a paint attribute or other modifier that will cause a more conservative
// estimate for bounds, it can modify the factors here to account for it.
// Ideally, all tests will be executed with geometry that will trigger
// the conservative cases anyway and all attributes will be combined with
// other attributes that make their output more predictable, but in those
// cases where a given test sequence cannot really provide attributes to
// demonstrate the worst case scenario, they can modify these factors to
// avoid false bounds overflow notifications.
class BoundsTolerance {
public:
BoundsTolerance() = default;
BoundsTolerance(const BoundsTolerance&) = default;
BoundsTolerance addBoundsPadding(SkScalar bounds_pad_x,
SkScalar bounds_pad_y) const {
BoundsTolerance copy = BoundsTolerance(*this);
copy.bounds_pad_.offset(bounds_pad_x, bounds_pad_y);
return copy;
}
BoundsTolerance mulScale(SkScalar scale_x, SkScalar scale_y) const {
BoundsTolerance copy = BoundsTolerance(*this);
copy.scale_.fX *= scale_x;
copy.scale_.fY *= scale_y;
return copy;
}
BoundsTolerance addAbsolutePadding(SkScalar absolute_pad_x,
SkScalar absolute_pad_y) const {
BoundsTolerance copy = BoundsTolerance(*this);
copy.absolute_pad_.offset(absolute_pad_x, absolute_pad_y);
return copy;
}
BoundsTolerance addPostClipPadding(SkScalar absolute_pad_x,
SkScalar absolute_pad_y) const {
BoundsTolerance copy = BoundsTolerance(*this);
copy.clip_pad_.offset(absolute_pad_x, absolute_pad_y);
return copy;
}
BoundsTolerance addDiscreteOffset(SkScalar discrete_offset) const {
BoundsTolerance copy = BoundsTolerance(*this);
copy.discrete_offset_ += discrete_offset;
return copy;
}
BoundsTolerance clip(SkRect clip) const {
BoundsTolerance copy = BoundsTolerance(*this);
if (!copy.clip_.intersect(clip)) {
copy.clip_.setEmpty();
}
return copy;
}
static SkRect Scale(const SkRect& rect, const SkPoint& scales) {
SkScalar outset_x = rect.width() * (scales.fX - 1);
SkScalar outset_y = rect.height() * (scales.fY - 1);
return rect.makeOutset(outset_x, outset_y);
}
bool overflows(SkIRect pix_bounds,
int worst_bounds_pad_x,
int worst_bounds_pad_y) const {
SkRect allowed = SkRect::Make(pix_bounds);
allowed.outset(bounds_pad_.fX, bounds_pad_.fY);
allowed = Scale(allowed, scale_);
allowed.outset(absolute_pad_.fX, absolute_pad_.fY);
if (!allowed.intersect(clip_)) {
allowed.setEmpty();
}
allowed.outset(clip_pad_.fX, clip_pad_.fY);
SkIRect rounded = allowed.roundOut();
int pad_left = std::max(0, pix_bounds.fLeft - rounded.fLeft);
int pad_top = std::max(0, pix_bounds.fTop - rounded.fTop);
int pad_right = std::max(0, pix_bounds.fRight - rounded.fRight);
int pad_bottom = std::max(0, pix_bounds.fBottom - rounded.fBottom);
int allowed_pad_x = std::max(pad_left, pad_right);
int allowed_pad_y = std::max(pad_top, pad_bottom);
if (worst_bounds_pad_x > allowed_pad_x ||
worst_bounds_pad_y > allowed_pad_y) {
FML_LOG(ERROR) << "acceptable bounds padding: " //
<< allowed_pad_x << ", " << allowed_pad_y;
}
return (worst_bounds_pad_x > allowed_pad_x ||
worst_bounds_pad_y > allowed_pad_y);
}
SkScalar discrete_offset() const { return discrete_offset_; }
bool operator==(BoundsTolerance const& other) const {
return bounds_pad_ == other.bounds_pad_ && scale_ == other.scale_ &&
absolute_pad_ == other.absolute_pad_ && clip_ == other.clip_ &&
clip_pad_ == other.clip_pad_ &&
discrete_offset_ == other.discrete_offset_;
}
private:
SkPoint bounds_pad_ = {0, 0};
SkPoint scale_ = {1, 1};
SkPoint absolute_pad_ = {0, 0};
SkRect clip_ = {-1E9, -1E9, 1E9, 1E9};
SkPoint clip_pad_ = {0, 0};
SkScalar discrete_offset_ = 0;
};
template <typename C, typename P, typename I>
struct RenderContext {
C canvas;
P paint;
I image;
};
using SkSetupContext = RenderContext<SkCanvas*, SkPaint&, sk_sp<SkImage>>;
using DlSetupContext = RenderContext<DlCanvas*, DlPaint&, sk_sp<DlImage>>;
using SkRenderContext =
RenderContext<SkCanvas*, const SkPaint&, sk_sp<SkImage>>;
using DlRenderContext =
RenderContext<DlCanvas*, const DlPaint&, sk_sp<DlImage>>;
using SkSetup = const std::function<void(const SkSetupContext&)>;
using SkRenderer = const std::function<void(const SkRenderContext&)>;
using DlSetup = const std::function<void(const DlSetupContext&)>;
using DlRenderer = const std::function<void(const DlRenderContext&)>;
static const SkSetup kEmptySkSetup = [](const SkSetupContext&) {};
static const SkRenderer kEmptySkRenderer = [](const SkRenderContext&) {};
static const DlSetup kEmptyDlSetup = [](const DlSetupContext&) {};
static const DlRenderer kEmptyDlRenderer = [](const DlRenderContext&) {};
using PixelFormat = DlSurfaceProvider::PixelFormat;
using BackendType = DlSurfaceProvider::BackendType;
class RenderResult {
public:
virtual ~RenderResult() = default;
virtual sk_sp<SkImage> image() const = 0;
virtual int width() const = 0;
virtual int height() const = 0;
virtual const uint32_t* addr32(int x, int y) const = 0;
virtual void write(const std::string& path) const = 0;
};
class SkRenderResult final : public RenderResult {
public:
explicit SkRenderResult(const sk_sp<SkSurface>& surface,
bool take_snapshot = false) {
SkImageInfo info = surface->imageInfo();
info = SkImageInfo::MakeN32Premul(info.dimensions());
addr_ = malloc(info.computeMinByteSize() * info.height());
pixmap_.reset(info, addr_, info.minRowBytes());
surface->readPixels(pixmap_, 0, 0);
if (take_snapshot) {
image_ = surface->makeImageSnapshot();
}
}
~SkRenderResult() override { free(addr_); }
sk_sp<SkImage> image() const override { return image_; }
int width() const override { return pixmap_.width(); }
int height() const override { return pixmap_.height(); }
const uint32_t* addr32(int x, int y) const override {
return pixmap_.addr32(x, y);
}
void write(const std::string& path) const {
auto stream = SkFILEWStream(path.c_str());
SkPngEncoder::Options options;
SkPngEncoder::Encode(&stream, pixmap_, options);
stream.flush();
}
private:
sk_sp<SkImage> image_;
SkPixmap pixmap_;
void* addr_ = nullptr;
};
class ImpellerRenderResult final : public RenderResult {
public:
explicit ImpellerRenderResult(sk_sp<DlPixelData> screenshot,
SkRect render_bounds)
: screenshot_(std::move(screenshot)), render_bounds_(render_bounds) {}
~ImpellerRenderResult() override = default;
sk_sp<SkImage> image() const override { return nullptr; };
int width() const override { return screenshot_->width(); };
int height() const override { return screenshot_->height(); }
const uint32_t* addr32(int x, int y) const override {
return screenshot_->addr32(x, y);
}
void write(const std::string& path) const override {
screenshot_->write(path);
}
const SkRect& render_bounds() const { return render_bounds_; }
private:
const sk_sp<DlPixelData> screenshot_;
SkRect render_bounds_;
};
struct RenderJobInfo {
int width = kTestWidth;
int height = kTestHeight;
DlColor bg = DlColor::kTransparent();
SkScalar scale = SK_Scalar1;
SkScalar opacity = SK_Scalar1;
};
struct JobRenderer {
virtual void Render(SkCanvas* canvas, const RenderJobInfo& info) = 0;
virtual bool targets_impeller() const { return false; }
};
struct MatrixClipJobRenderer : public JobRenderer {
public:
const SkMatrix& setup_matrix() const {
FML_CHECK(is_setup_);
return setup_matrix_;
}
const SkIRect& setup_clip_bounds() const {
FML_CHECK(is_setup_);
return setup_clip_bounds_;
}
protected:
bool is_setup_ = false;
SkMatrix setup_matrix_;
SkIRect setup_clip_bounds_;
};
struct SkJobRenderer : public MatrixClipJobRenderer {
explicit SkJobRenderer(const SkSetup& sk_setup,
const SkRenderer& sk_render,
const SkRenderer& sk_restore,
const sk_sp<SkImage>& sk_image)
: sk_setup_(sk_setup),
sk_render_(sk_render),
sk_restore_(sk_restore),
sk_image_(sk_image) {}
void Render(SkCanvas* canvas, const RenderJobInfo& info) override {
FML_DCHECK(info.opacity == SK_Scalar1);
SkPaint paint;
sk_setup_({canvas, paint, sk_image_});
setup_paint_ = paint;
setup_matrix_ = canvas->getTotalMatrix();
setup_clip_bounds_ = canvas->getDeviceClipBounds();
is_setup_ = true;
sk_render_({canvas, paint, sk_image_});
sk_restore_({canvas, paint, sk_image_});
}
sk_sp<SkPicture> MakePicture(const RenderJobInfo& info) {
SkPictureRecorder recorder;
SkRTreeFactory rtree_factory;
SkCanvas* cv = recorder.beginRecording(kTestBounds2, &rtree_factory);
Render(cv, info);
return recorder.finishRecordingAsPicture();
}
const SkPaint& setup_paint() const {
FML_CHECK(is_setup_);
return setup_paint_;
}
private:
const SkSetup sk_setup_;
const SkRenderer sk_render_;
const SkRenderer sk_restore_;
sk_sp<SkImage> sk_image_;
SkPaint setup_paint_;
};
struct DlJobRenderer : public MatrixClipJobRenderer {
explicit DlJobRenderer(const DlSetup& dl_setup,
const DlRenderer& dl_render,
const DlRenderer& dl_restore,
const sk_sp<DlImage>& dl_image)
: dl_setup_(dl_setup),
dl_render_(dl_render),
dl_restore_(dl_restore),
dl_image_(dl_image) {}
void Render(SkCanvas* sk_canvas, const RenderJobInfo& info) override {
DlSkCanvasAdapter canvas(sk_canvas);
Render(&canvas, info);
}
void Render(DlCanvas* canvas, const RenderJobInfo& info) {
FML_DCHECK(info.opacity == SK_Scalar1);
DlPaint paint;
dl_setup_({canvas, paint, dl_image_});
setup_paint_ = paint;
setup_matrix_ = canvas->GetTransform();
setup_clip_bounds_ = canvas->GetDestinationClipBounds().roundOut();
is_setup_ = true;
dl_render_({canvas, paint, dl_image_});
dl_restore_({canvas, paint, dl_image_});
}
sk_sp<DisplayList> MakeDisplayList(const RenderJobInfo& info) {
DisplayListBuilder builder(kTestBounds2);
Render(&builder, info);
return builder.Build();
}
const DlPaint& setup_paint() const {
FML_CHECK(is_setup_);
return setup_paint_;
}
bool targets_impeller() const override {
return dl_image_->impeller_texture() != nullptr;
}
private:
const DlSetup dl_setup_;
const DlRenderer dl_render_;
const DlRenderer dl_restore_;
const sk_sp<DlImage> dl_image_;
DlPaint setup_paint_;
};
struct SkPictureJobRenderer : public JobRenderer {
explicit SkPictureJobRenderer(sk_sp<SkPicture> picture)
: picture_(std::move(picture)) {}
void Render(SkCanvas* canvas, const RenderJobInfo& info) {
FML_DCHECK(info.opacity == SK_Scalar1);
picture_->playback(canvas);
}
private:
sk_sp<SkPicture> picture_;
};
struct DisplayListJobRenderer : public JobRenderer {
explicit DisplayListJobRenderer(sk_sp<DisplayList> display_list)
: display_list_(std::move(display_list)) {}
void Render(SkCanvas* canvas, const RenderJobInfo& info) {
DlSkCanvasAdapter(canvas).DrawDisplayList(display_list_, info.opacity);
}
private:
sk_sp<DisplayList> display_list_;
};
class RenderEnvironment {
public:
RenderEnvironment(const DlSurfaceProvider* provider, PixelFormat format)
: provider_(provider), format_(format) {
if (provider->supports(format)) {
surface_1x_ =
provider->MakeOffscreenSurface(kTestWidth, kTestHeight, format);
surface_2x_ = provider->MakeOffscreenSurface(kTestWidth * 2,
kTestHeight * 2, format);
}
}
static RenderEnvironment Make565(const DlSurfaceProvider* provider) {
return RenderEnvironment(provider, PixelFormat::k565PixelFormat);
}
static RenderEnvironment MakeN32(const DlSurfaceProvider* provider) {
return RenderEnvironment(provider, PixelFormat::kN32PremulPixelFormat);
}
void init_ref(SkSetup& sk_setup,
SkRenderer& sk_renderer,
DlSetup& dl_setup,
DlRenderer& dl_renderer,
DlRenderer& imp_renderer,
DlColor bg = DlColor::kTransparent()) {
SkJobRenderer sk_job(sk_setup, sk_renderer, kEmptySkRenderer, kTestSkImage);
RenderJobInfo info = {
.bg = bg,
};
ref_sk_result_ = getResult(info, sk_job);
DlJobRenderer dl_job(dl_setup, dl_renderer, kEmptyDlRenderer, kTestDlImage);
ref_dl_result_ = getResult(info, dl_job);
ref_dl_paint_ = dl_job.setup_paint();
ref_matrix_ = dl_job.setup_matrix();
ref_clip_bounds_ = dl_job.setup_clip_bounds();
ASSERT_EQ(sk_job.setup_matrix(), ref_matrix_);
ASSERT_EQ(sk_job.setup_clip_bounds(), ref_clip_bounds_);
if (provider_->supports_impeller()) {
test_impeller_image_ = makeTestImpellerImage(provider_);
DlJobRenderer imp_job(dl_setup, imp_renderer, kEmptyDlRenderer,
test_impeller_image_);
ref_impeller_result_ = getImpellerResult(info, imp_job);
}
}
std::unique_ptr<RenderResult> getResult(const RenderJobInfo& info,
JobRenderer& renderer) const {
auto surface = getSurface(info.width, info.height);
FML_DCHECK(surface != nullptr);
auto canvas = surface->getCanvas();
canvas->clear(ToSk(info.bg));
int restore_count = canvas->save();
canvas->scale(info.scale, info.scale);
renderer.Render(canvas, info);
canvas->restoreToCount(restore_count);
if (GrDirectContext* dContext =
GrAsDirectContext(surface->recordingContext())) {
dContext->flushAndSubmit(surface.get(), GrSyncCpu::kYes);
}
return std::make_unique<SkRenderResult>(surface);
}
std::unique_ptr<RenderResult> getResult(sk_sp<DisplayList> dl) const {
DisplayListJobRenderer job(std::move(dl));
RenderJobInfo info = {};
return getResult(info, job);
}
std::unique_ptr<ImpellerRenderResult> getImpellerResult(
const RenderJobInfo& info,
DlJobRenderer& renderer) const {
FML_DCHECK(info.scale == SK_Scalar1);
DisplayListBuilder builder;
builder.Clear(info.bg);
auto render_dl = renderer.MakeDisplayList(info);
builder.DrawDisplayList(render_dl);
auto dl = builder.Build();
auto snap = provider_->ImpellerSnapshot(dl, kTestWidth, kTestHeight);
return std::make_unique<ImpellerRenderResult>(std::move(snap),
render_dl->bounds());
}
const DlSurfaceProvider* provider() const { return provider_; }
bool valid() const { return provider_->supports(format_); }
const std::string backend_name() const { return provider_->backend_name(); }
bool supports_impeller() const { return provider_->supports_impeller(); }
PixelFormat format() const { return format_; }
const DlPaint& ref_dl_paint() const { return ref_dl_paint_; }
const SkMatrix& ref_matrix() const { return ref_matrix_; }
const SkIRect& ref_clip_bounds() const { return ref_clip_bounds_; }
const RenderResult* ref_sk_result() const { return ref_sk_result_.get(); }
const RenderResult* ref_dl_result() const { return ref_dl_result_.get(); }
const ImpellerRenderResult* ref_impeller_result() const {
return ref_impeller_result_.get();
}
const sk_sp<SkImage> sk_image() const { return kTestSkImage; }
const sk_sp<DlImage> dl_image() const { return kTestDlImage; }
const sk_sp<DlImage> impeller_image() const { return test_impeller_image_; }
private:
sk_sp<SkSurface> getSurface(int width, int height) const {
FML_DCHECK(valid());
FML_DCHECK(surface_1x_ != nullptr);
FML_DCHECK(surface_2x_ != nullptr);
if (width == kTestWidth && height == kTestHeight) {
return surface_1x_->sk_surface();
}
if (width == kTestWidth * 2 && height == kTestHeight * 2) {
return surface_2x_->sk_surface();
}
FML_LOG(ERROR) << "Test surface size (" << width << " x " << height
<< ") not supported.";
FML_DCHECK(false);
return nullptr;
}
const DlSurfaceProvider* provider_;
const PixelFormat format_;
std::shared_ptr<DlSurfaceInstance> surface_1x_;
std::shared_ptr<DlSurfaceInstance> surface_2x_;
DlPaint ref_dl_paint_;
SkMatrix ref_matrix_;
SkIRect ref_clip_bounds_;
std::unique_ptr<RenderResult> ref_sk_result_;
std::unique_ptr<RenderResult> ref_dl_result_;
std::unique_ptr<ImpellerRenderResult> ref_impeller_result_;
sk_sp<DlImage> test_impeller_image_;
static const sk_sp<SkImage> kTestSkImage;
static const sk_sp<DlImage> kTestDlImage;
static const sk_sp<SkImage> makeTestSkImage() {
sk_sp<SkSurface> surface = SkSurfaces::Raster(
SkImageInfo::MakeN32Premul(kRenderWidth, kRenderHeight));
DrawCheckerboard(surface->getCanvas());
return surface->makeImageSnapshot();
}
static const sk_sp<DlImage> makeTestImpellerImage(
const DlSurfaceProvider* provider) {
FML_DCHECK(provider->supports_impeller());
DisplayListBuilder builder(SkRect::MakeWH(kRenderWidth, kRenderHeight));
DrawCheckerboard(&builder);
return provider->MakeImpellerImage(builder.Build(), //
kRenderWidth, kRenderHeight);
}
};
const sk_sp<SkImage> RenderEnvironment::kTestSkImage = makeTestSkImage();
const sk_sp<DlImage> RenderEnvironment::kTestDlImage =
DlImage::Make(kTestSkImage);
class CaseParameters {
public:
explicit CaseParameters(std::string info)
: CaseParameters(std::move(info), kEmptySkSetup, kEmptyDlSetup) {}
CaseParameters(std::string info, SkSetup& sk_setup, DlSetup& dl_setup)
: CaseParameters(std::move(info),
sk_setup,
dl_setup,
kEmptySkRenderer,
kEmptyDlRenderer,
DlColor(SK_ColorTRANSPARENT),
false,
false,
false) {}
CaseParameters(std::string info,
SkSetup& sk_setup,
DlSetup& dl_setup,
SkRenderer& sk_restore,
DlRenderer& dl_restore,
DlColor bg,
bool has_diff_clip,
bool has_mutating_save_layer,
bool fuzzy_compare_components)
: info_(std::move(info)),
bg_(bg),
sk_setup_(sk_setup),
dl_setup_(dl_setup),
sk_restore_(sk_restore),
dl_restore_(dl_restore),
has_diff_clip_(has_diff_clip),
has_mutating_save_layer_(has_mutating_save_layer),
fuzzy_compare_components_(fuzzy_compare_components) {}
CaseParameters with_restore(SkRenderer& sk_restore,
DlRenderer& dl_restore,
bool mutating_layer,
bool fuzzy_compare_components = false) {
return CaseParameters(info_, sk_setup_, dl_setup_, sk_restore, dl_restore,
bg_, has_diff_clip_, mutating_layer,
fuzzy_compare_components);
}
CaseParameters with_bg(DlColor bg) {
return CaseParameters(info_, sk_setup_, dl_setup_, sk_restore_, dl_restore_,
bg, has_diff_clip_, has_mutating_save_layer_,
fuzzy_compare_components_);
}
CaseParameters with_diff_clip() {
return CaseParameters(info_, sk_setup_, dl_setup_, sk_restore_, dl_restore_,
bg_, true, has_mutating_save_layer_,
fuzzy_compare_components_);
}
std::string info() const { return info_; }
DlColor bg() const { return bg_; }
bool has_diff_clip() const { return has_diff_clip_; }
bool has_mutating_save_layer() const { return has_mutating_save_layer_; }
bool fuzzy_compare_components() const { return fuzzy_compare_components_; }
SkSetup sk_setup() const { return sk_setup_; }
DlSetup dl_setup() const { return dl_setup_; }
SkRenderer sk_restore() const { return sk_restore_; }
DlRenderer dl_restore() const { return dl_restore_; }
private:
const std::string info_;
const DlColor bg_;
const SkSetup sk_setup_;
const DlSetup dl_setup_;
const SkRenderer sk_restore_;
const DlRenderer dl_restore_;
const bool has_diff_clip_;
const bool has_mutating_save_layer_;
const bool fuzzy_compare_components_;
};
class TestParameters {
public:
TestParameters(const SkRenderer& sk_renderer,
const DlRenderer& dl_renderer,
const DisplayListAttributeFlags& flags)
: TestParameters(sk_renderer, dl_renderer, dl_renderer, flags) {}
TestParameters(const SkRenderer& sk_renderer,
const DlRenderer& dl_renderer,
const DlRenderer& imp_renderer,
const DisplayListAttributeFlags& flags)
: sk_renderer_(sk_renderer),
dl_renderer_(dl_renderer),
imp_renderer_(imp_renderer),
flags_(flags) {}
bool uses_paint() const { return !flags_.ignores_paint(); }
bool uses_gradient() const { return flags_.applies_shader(); }
bool impeller_compatible(const DlPaint& paint) const {
if (is_draw_text_blob()) {
// Non-color text is rendered as paths
if (paint.getColorSourcePtr() && !paint.getColorSourcePtr()->asColor()) {
return false;
}
// Non-filled text (stroke or stroke and fill) is rendered as paths
if (paint.getDrawStyle() != DlDrawStyle::kFill) {
return false;
}
}
return true;
}
bool should_match(const RenderEnvironment& env,
const CaseParameters& caseP,
const DlPaint& attr,
const MatrixClipJobRenderer& renderer) const {
if (caseP.has_mutating_save_layer()) {
return false;
}
if (env.ref_clip_bounds() != renderer.setup_clip_bounds() ||
caseP.has_diff_clip()) {
return false;
}
if (env.ref_matrix() != renderer.setup_matrix() && !flags_.is_flood()) {
return false;
}
if (flags_.ignores_paint()) {
return true;
}
const DlPaint& ref_attr = env.ref_dl_paint();
if (flags_.applies_anti_alias() && //
ref_attr.isAntiAlias() != attr.isAntiAlias()) {
if (renderer.targets_impeller()) {
// Impeller only does MSAA, ignoring the AA attribute
// https://github.com/flutter/flutter/issues/104721
} else {
return false;
}
}
if (flags_.applies_color() && //
ref_attr.getColor() != attr.getColor()) {
return false;
}
if (flags_.applies_blend() && //
ref_attr.getBlendMode() != attr.getBlendMode()) {
return false;
}
if (flags_.applies_color_filter() && //
(ref_attr.isInvertColors() != attr.isInvertColors() ||
NotEquals(ref_attr.getColorFilter(), attr.getColorFilter()))) {
return false;
}
if (flags_.applies_mask_filter() && //
NotEquals(ref_attr.getMaskFilter(), attr.getMaskFilter())) {
return false;
}
if (flags_.applies_image_filter() && //
ref_attr.getImageFilter() != attr.getImageFilter()) {
return false;
}
if (flags_.applies_shader() && //
NotEquals(ref_attr.getColorSource(), attr.getColorSource())) {
return false;
}
bool is_stroked = flags_.is_stroked(attr.getDrawStyle());
if (flags_.is_stroked(ref_attr.getDrawStyle()) != is_stroked) {
return false;
}
DisplayListSpecialGeometryFlags geo_flags =
flags_.WithPathEffect(attr.getPathEffect().get(), is_stroked);
if (flags_.applies_path_effect() && //
ref_attr.getPathEffect() != attr.getPathEffect()) {
if (renderer.targets_impeller()) {
// Impeller ignores DlPathEffect objects:
// https://github.com/flutter/flutter/issues/109736
} else {
switch (attr.getPathEffect()->type()) {
case DlPathEffectType::kDash: {
if (is_stroked && !ignores_dashes()) {
return false;
}
break;
}
}
}
}
if (!is_stroked) {
return true;
}
if (ref_attr.getStrokeWidth() != attr.getStrokeWidth()) {
return false;
}
if (geo_flags.may_have_end_caps() && //
getCap(ref_attr, geo_flags) != getCap(attr, geo_flags)) {
return false;
}
if (geo_flags.may_have_joins()) {
if (ref_attr.getStrokeJoin() != attr.getStrokeJoin()) {
return false;
}
if (ref_attr.getStrokeJoin() == DlStrokeJoin::kMiter) {
SkScalar ref_miter = ref_attr.getStrokeMiter();
SkScalar test_miter = attr.getStrokeMiter();
// miter limit < 1.4 affects right angles
if (geo_flags.may_have_acute_joins() || //
ref_miter < 1.4 || test_miter < 1.4) {
if (ref_miter != test_miter) {
return false;
}
}
}
}
return true;
}
DlStrokeCap getCap(const DlPaint& attr,
DisplayListSpecialGeometryFlags geo_flags) const {
DlStrokeCap cap = attr.getStrokeCap();
if (geo_flags.butt_cap_becomes_square() && cap == DlStrokeCap::kButt) {
return DlStrokeCap::kSquare;
}
return cap;
}
const BoundsTolerance adjust(const BoundsTolerance& tolerance,
const DlPaint& paint,
const SkMatrix& matrix) const {
if (is_draw_text_blob() && tolerance.discrete_offset() > 0) {
// drawTextBlob needs just a little more leeway when using a
// discrete path effect.
return tolerance.addBoundsPadding(2, 2);
}
if (is_draw_line()) {
return lineAdjust(tolerance, paint, matrix);
}
if (is_draw_arc_center()) {
if (paint.getDrawStyle() != DlDrawStyle::kFill &&
paint.getStrokeJoin() == DlStrokeJoin::kMiter) {
// the miter join at the center of an arc does not really affect
// its bounds in any of our test cases, but the bounds code needs
// to take it into account for the cases where it might, so we
// relax our tolerance to reflect the miter bounds padding.
SkScalar miter_pad =
paint.getStrokeMiter() * paint.getStrokeWidth() * 0.5f;
return tolerance.addBoundsPadding(miter_pad, miter_pad);
}
}
return tolerance;
}
const BoundsTolerance lineAdjust(const BoundsTolerance& tolerance,
const DlPaint& paint,
const SkMatrix& matrix) const {
SkScalar adjust = 0.0;
SkScalar half_width = paint.getStrokeWidth() * 0.5f;
if (tolerance.discrete_offset() > 0) {
// When a discrete path effect is added, the bounds calculations must
// allow for miters in any direction, but a horizontal line will not
// have miters in the horizontal direction, similarly for vertical
// lines, and diagonal lines will have miters off at a "45 degree"
// angle that don't expand the bounds much at all.
// Also, the discrete offset will not move any points parallel with
// the line, so provide tolerance for both miters and offset.
adjust =
half_width * paint.getStrokeMiter() + tolerance.discrete_offset();
}
auto path_effect = paint.getPathEffect();
DisplayListSpecialGeometryFlags geo_flags =
flags_.WithPathEffect(path_effect.get(), true);
if (paint.getStrokeCap() == DlStrokeCap::kButt &&
!geo_flags.butt_cap_becomes_square()) {
adjust = std::max(adjust, half_width);
}
if (adjust == 0) {
return tolerance;
}
SkScalar h_tolerance;
SkScalar v_tolerance;
if (is_horizontal_line()) {
FML_DCHECK(!is_vertical_line());
h_tolerance = adjust;
v_tolerance = 0;
} else if (is_vertical_line()) {
h_tolerance = 0;
v_tolerance = adjust;
} else {
// The perpendicular miters just do not impact the bounds of
// diagonal lines at all as they are aimed in the wrong direction
// to matter. So allow tolerance in both axes.
h_tolerance = v_tolerance = adjust;
}
BoundsTolerance new_tolerance =
tolerance.addBoundsPadding(h_tolerance, v_tolerance);
return new_tolerance;
}
const SkRenderer& sk_renderer() const { return sk_renderer_; }
const DlRenderer& dl_renderer() const { return dl_renderer_; }
const DlRenderer& imp_renderer() const { return imp_renderer_; }
// Tests that call drawTextBlob with an sk_ref paint attribute will cause
// those attributes to be stored in an internal Skia cache so we need
// to expect that the |sk_ref.unique()| call will fail in those cases.
// See: (TBD(flar) - file Skia bug)
bool is_draw_text_blob() const { return is_draw_text_blob_; }
bool is_draw_display_list() const { return is_draw_display_list_; }
bool is_draw_line() const { return is_draw_line_; }
bool is_draw_arc_center() const { return is_draw_arc_center_; }
bool is_draw_path() const { return is_draw_path_; }
bool is_horizontal_line() const { return is_horizontal_line_; }
bool is_vertical_line() const { return is_vertical_line_; }
bool ignores_dashes() const { return ignores_dashes_; }
TestParameters& set_draw_text_blob() {
is_draw_text_blob_ = true;
return *this;
}
TestParameters& set_draw_display_list() {
is_draw_display_list_ = true;
return *this;
}
TestParameters& set_draw_line() {
is_draw_line_ = true;
return *this;
}
TestParameters& set_draw_arc_center() {
is_draw_arc_center_ = true;
return *this;
}
TestParameters& set_draw_path() {
is_draw_path_ = true;
return *this;
}
TestParameters& set_ignores_dashes() {
ignores_dashes_ = true;
return *this;
}
TestParameters& set_horizontal_line() {
is_horizontal_line_ = true;
return *this;
}
TestParameters& set_vertical_line() {
is_vertical_line_ = true;
return *this;
}
private:
const SkRenderer sk_renderer_;
const DlRenderer dl_renderer_;
const DlRenderer imp_renderer_;
const DisplayListAttributeFlags flags_;
bool is_draw_text_blob_ = false;
bool is_draw_display_list_ = false;
bool is_draw_line_ = false;
bool is_draw_arc_center_ = false;
bool is_draw_path_ = false;
bool ignores_dashes_ = false;
bool is_horizontal_line_ = false;
bool is_vertical_line_ = false;
};
class CanvasCompareTester {
public:
static std::vector<BackendType> TestBackends;
static std::string ImpellerFailureImageDirectory;
static bool SaveImpellerFailureImages;
static std::vector<std::string> ImpellerFailureImages;
static std::unique_ptr<DlSurfaceProvider> GetProvider(BackendType type) {
auto provider = DlSurfaceProvider::Create(type);
if (provider == nullptr) {
FML_LOG(ERROR) << "provider " << DlSurfaceProvider::BackendName(type)
<< " not supported (ignoring)";
return nullptr;
}
provider->InitializeSurface(kTestWidth, kTestHeight,
PixelFormat::kN32PremulPixelFormat);
return provider;
}
static bool AddProvider(BackendType type) {
auto provider = GetProvider(type);
if (!provider) {
return false;
}
CanvasCompareTester::TestBackends.push_back(type);
return true;
}
static BoundsTolerance DefaultTolerance;
static void RenderAll(const TestParameters& params,
const BoundsTolerance& tolerance = DefaultTolerance) {
for (auto& back_end : TestBackends) {
auto provider = GetProvider(back_end);
RenderEnvironment env = RenderEnvironment::MakeN32(provider.get());
env.init_ref(kEmptySkSetup, params.sk_renderer(), //
kEmptyDlSetup, params.dl_renderer(), params.imp_renderer());
quickCompareToReference(env, "default");
if (env.supports_impeller()) {
auto impeller_result = env.ref_impeller_result();
if (!checkPixels(impeller_result, impeller_result->render_bounds(),
"Impeller reference")) {
std::string test_name =
::testing::UnitTest::GetInstance()->current_test_info()->name();
save_to_png(impeller_result, test_name + " (Impeller reference)",
"base rendering was blank or out of bounds");
}
} else {
static OncePerBackendWarning warnings("No Impeller output tests");
warnings.warn(env.backend_name());
}
RenderWithTransforms(params, env, tolerance);
RenderWithClips(params, env, tolerance);
RenderWithSaveRestore(params, env, tolerance);
// Only test attributes if the canvas version uses the paint object
if (params.uses_paint()) {
RenderWithAttributes(params, env, tolerance);
}
}
}
static void RenderWithSaveRestore(const TestParameters& testP,
const RenderEnvironment& env,
const BoundsTolerance& tolerance) {
SkRect clip =
SkRect::MakeXYWH(kRenderCenterX - 1, kRenderCenterY - 1, 2, 2);
SkRect rect = SkRect::MakeXYWH(kRenderCenterX, kRenderCenterY, 10, 10);
DlColor alpha_layer_color = DlColor::kCyan().withAlpha(0x7f);
SkRenderer sk_safe_restore = [=](const SkRenderContext& ctx) {
// Draw another primitive to disable peephole optimizations
ctx.canvas->drawRect(kRenderBounds.makeOffset(500, 500), SkPaint());
ctx.canvas->restore();
};
DlRenderer dl_safe_restore = [=](const DlRenderContext& ctx) {
// Draw another primitive to disable peephole optimizations
// As the rendering op rejection in the DisplayList Builder
// gets smarter and smarter, this operation has had to get
// sneakier and sneakier about specifying an operation that
// won't practically show up in the output, but technically
// can't be culled.
ctx.canvas->DrawRect(
SkRect::MakeXYWH(kRenderCenterX, kRenderCenterY, 0.0001, 0.0001),
DlPaint());
ctx.canvas->Restore();
};
SkRenderer sk_opt_restore = [=](const SkRenderContext& ctx) {
// Just a simple restore to allow peephole optimizations to occur
ctx.canvas->restore();
};
DlRenderer dl_opt_restore = [=](const DlRenderContext& ctx) {
// Just a simple restore to allow peephole optimizations to occur
ctx.canvas->Restore();
};
SkRect layer_bounds = kRenderBounds.makeInset(15, 15);
RenderWith(testP, env, tolerance,
CaseParameters(
"With prior save/clip/restore",
[=](const SkSetupContext& ctx) {
ctx.canvas->save();
ctx.canvas->clipRect(clip, SkClipOp::kIntersect, false);
SkPaint p2;
ctx.canvas->drawRect(rect, p2);
p2.setBlendMode(SkBlendMode::kClear);
ctx.canvas->drawRect(rect, p2);
ctx.canvas->restore();
},
[=](const DlSetupContext& ctx) {
ctx.canvas->Save();
ctx.canvas->ClipRect(clip, ClipOp::kIntersect, false);
DlPaint p2;
ctx.canvas->DrawRect(rect, p2);
p2.setBlendMode(DlBlendMode::kClear);
ctx.canvas->DrawRect(rect, p2);
ctx.canvas->Restore();
}));
RenderWith(testP, env, tolerance,
CaseParameters(
"saveLayer no paint, no bounds",
[=](const SkSetupContext& ctx) {
ctx.canvas->saveLayer(nullptr, nullptr);
},
[=](const DlSetupContext& ctx) {
ctx.canvas->SaveLayer(nullptr, nullptr);
})
.with_restore(sk_safe_restore, dl_safe_restore, false));
RenderWith(testP, env, tolerance,
CaseParameters(
"saveLayer no paint, with bounds",
[=](const SkSetupContext& ctx) {
ctx.canvas->saveLayer(layer_bounds, nullptr);
},
[=](const DlSetupContext& ctx) {
ctx.canvas->SaveLayer(&layer_bounds, nullptr);
})
.with_restore(sk_safe_restore, dl_safe_restore, true));
RenderWith(testP, env, tolerance,
CaseParameters(
"saveLayer with alpha, no bounds",
[=](const SkSetupContext& ctx) {
SkPaint save_p;
save_p.setColor(ToSk(alpha_layer_color));
ctx.canvas->saveLayer(nullptr, &save_p);
},
[=](const DlSetupContext& ctx) {
DlPaint save_p;
save_p.setColor(alpha_layer_color);
ctx.canvas->SaveLayer(nullptr, &save_p);
})
.with_restore(sk_safe_restore, dl_safe_restore, true));
RenderWith(testP, env, tolerance,
CaseParameters(
"saveLayer with peephole alpha, no bounds",
[=](const SkSetupContext& ctx) {
SkPaint save_p;
save_p.setColor(ToSk(alpha_layer_color));
ctx.canvas->saveLayer(nullptr, &save_p);
},
[=](const DlSetupContext& ctx) {
DlPaint save_p;
save_p.setColor(alpha_layer_color);
ctx.canvas->SaveLayer(nullptr, &save_p);
})
.with_restore(sk_opt_restore, dl_opt_restore, true, true));
RenderWith(testP, env, tolerance,
CaseParameters(
"saveLayer with alpha and bounds",
[=](const SkSetupContext& ctx) {
SkPaint save_p;
save_p.setColor(ToSk(alpha_layer_color));
ctx.canvas->saveLayer(layer_bounds, &save_p);
},
[=](const DlSetupContext& ctx) {
DlPaint save_p;
save_p.setColor(alpha_layer_color);
ctx.canvas->SaveLayer(&layer_bounds, &save_p);
})
.with_restore(sk_safe_restore, dl_safe_restore, true));
{
// Being able to see a backdrop blur requires a non-default background
// so we create a new environment for these tests that has a checkerboard
// background that can be blurred by the backdrop filter. We also want
// to avoid the rendered primitive from obscuring the blurred background
// so we set an alpha value which works for all primitives except for
// drawColor which can override the alpha with its color, but it now uses
// a non-opaque color to avoid that problem.
RenderEnvironment backdrop_env =
RenderEnvironment::MakeN32(env.provider());
SkSetup sk_backdrop_setup = [=](const SkSetupContext& ctx) {
SkPaint setup_p;
setup_p.setShader(MakeColorSource(ctx.image));
ctx.canvas->drawPaint(setup_p);
};
DlSetup dl_backdrop_setup = [=](const DlSetupContext& ctx) {
DlPaint setup_p;
setup_p.setColorSource(MakeColorSource(ctx.image));
ctx.canvas->DrawPaint(setup_p);
};
SkSetup sk_content_setup = [=](const SkSetupContext& ctx) {
ctx.paint.setAlpha(ctx.paint.getAlpha() / 2);
};
DlSetup dl_content_setup = [=](const DlSetupContext& ctx) {
ctx.paint.setAlpha(ctx.paint.getAlpha() / 2);
};
backdrop_env.init_ref(sk_backdrop_setup, testP.sk_renderer(),
dl_backdrop_setup, testP.dl_renderer(),
testP.imp_renderer());
quickCompareToReference(backdrop_env, "backdrop");
DlBlurImageFilter dl_backdrop(5, 5, DlTileMode::kDecal);
auto sk_backdrop =
SkImageFilters::Blur(5, 5, SkTileMode::kDecal, nullptr);
RenderWith(testP, backdrop_env, tolerance,
CaseParameters(
"saveLayer with backdrop",
[=](const SkSetupContext& ctx) {
sk_backdrop_setup(ctx);
ctx.canvas->saveLayer(SkCanvas::SaveLayerRec(
nullptr, nullptr, sk_backdrop.get(), 0));
sk_content_setup(ctx);
},
[=](const DlSetupContext& ctx) {
dl_backdrop_setup(ctx);
ctx.canvas->SaveLayer(nullptr, nullptr, &dl_backdrop);
dl_content_setup(ctx);
})
.with_restore(sk_safe_restore, dl_safe_restore, true));
RenderWith(testP, backdrop_env, tolerance,
CaseParameters(
"saveLayer with bounds and backdrop",
[=](const SkSetupContext& ctx) {
sk_backdrop_setup(ctx);
ctx.canvas->saveLayer(SkCanvas::SaveLayerRec(
&layer_bounds, nullptr, sk_backdrop.get(), 0));
sk_content_setup(ctx);
},
[=](const DlSetupContext& ctx) {
dl_backdrop_setup(ctx);
ctx.canvas->SaveLayer(&layer_bounds, nullptr,
&dl_backdrop);
dl_content_setup(ctx);
})
.with_restore(sk_safe_restore, dl_safe_restore, true));
RenderWith(testP, backdrop_env, tolerance,
CaseParameters(
"clipped saveLayer with backdrop",
[=](const SkSetupContext& ctx) {
sk_backdrop_setup(ctx);
ctx.canvas->clipRect(layer_bounds);
ctx.canvas->saveLayer(SkCanvas::SaveLayerRec(
nullptr, nullptr, sk_backdrop.get(), 0));
sk_content_setup(ctx);
},
[=](const DlSetupContext& ctx) {
dl_backdrop_setup(ctx);
ctx.canvas->ClipRect(layer_bounds);
ctx.canvas->SaveLayer(nullptr, nullptr, &dl_backdrop);
dl_content_setup(ctx);
})
.with_restore(sk_safe_restore, dl_safe_restore, true));
}
{
// clang-format off
constexpr float rotate_alpha_color_matrix[20] = {
0, 1, 0, 0 , 0,
0, 0, 1, 0 , 0,
1, 0, 0, 0 , 0,
0, 0, 0, 0.5, 0,
};
// clang-format on
DlMatrixColorFilter dl_alpha_rotate_filter(rotate_alpha_color_matrix);
auto sk_alpha_rotate_filter =
SkColorFilters::Matrix(rotate_alpha_color_matrix);
{
RenderWith(testP, env, tolerance,
CaseParameters(
"saveLayer ColorFilter, no bounds",
[=](const SkSetupContext& ctx) {
SkPaint save_p;
save_p.setColorFilter(sk_alpha_rotate_filter);
ctx.canvas->saveLayer(nullptr, &save_p);
ctx.paint.setStrokeWidth(5.0);
},
[=](const DlSetupContext& ctx) {
DlPaint save_p;
save_p.setColorFilter(&dl_alpha_rotate_filter);
ctx.canvas->SaveLayer(nullptr, &save_p);
ctx.paint.setStrokeWidth(5.0);
})
.with_restore(sk_safe_restore, dl_safe_restore, true));
}
{
RenderWith(testP, env, tolerance,
CaseParameters(
"saveLayer ColorFilter and bounds",
[=](const SkSetupContext& ctx) {
SkPaint save_p;
save_p.setColorFilter(sk_alpha_rotate_filter);
ctx.canvas->saveLayer(kRenderBounds, &save_p);
ctx.paint.setStrokeWidth(5.0);
},
[=](const DlSetupContext& ctx) {
DlPaint save_p;
save_p.setColorFilter(&dl_alpha_rotate_filter);
ctx.canvas->SaveLayer(&kRenderBounds, &save_p);
ctx.paint.setStrokeWidth(5.0);
})
.with_restore(sk_safe_restore, dl_safe_restore, true));
}
}
{
// clang-format off
constexpr float color_matrix[20] = {
0.5, 0, 0, 0, 0.5,
0, 0.5, 0, 0, 0.5,
0, 0, 0.5, 0, 0.5,
0, 0, 0, 1, 0,
};
// clang-format on
DlMatrixColorFilter dl_color_filter(color_matrix);
DlColorFilterImageFilter dl_cf_image_filter(dl_color_filter);
auto sk_cf_image_filter = SkImageFilters::ColorFilter(
SkColorFilters::Matrix(color_matrix), nullptr);
{
RenderWith(testP, env, tolerance,
CaseParameters(
"saveLayer ImageFilter, no bounds",
[=](const SkSetupContext& ctx) {
SkPaint save_p;
save_p.setImageFilter(sk_cf_image_filter);
ctx.canvas->saveLayer(nullptr, &save_p);
ctx.paint.setStrokeWidth(5.0);
},
[=](const DlSetupContext& ctx) {
DlPaint save_p;
save_p.setImageFilter(&dl_cf_image_filter);
ctx.canvas->SaveLayer(nullptr, &save_p);
ctx.paint.setStrokeWidth(5.0);
})
.with_restore(sk_safe_restore, dl_safe_restore, true));
}
{
RenderWith(testP, env, tolerance,
CaseParameters(
"saveLayer ImageFilter and bounds",
[=](const SkSetupContext& ctx) {
SkPaint save_p;
save_p.setImageFilter(sk_cf_image_filter);
ctx.canvas->saveLayer(kRenderBounds, &save_p);
ctx.paint.setStrokeWidth(5.0);
},
[=](const DlSetupContext& ctx) {
DlPaint save_p;
save_p.setImageFilter(&dl_cf_image_filter);
ctx.canvas->SaveLayer(&kRenderBounds, &save_p);
ctx.paint.setStrokeWidth(5.0);
})
.with_restore(sk_safe_restore, dl_safe_restore, true));
}
}
}
static void RenderWithAttributes(const TestParameters& testP,
const RenderEnvironment& env,
const BoundsTolerance& tolerance) {
RenderWith(testP, env, tolerance, CaseParameters("Defaults Test"));
{
// CPU renderer with default line width of 0 does not show antialiasing
// for stroked primitives, so we make a new reference with a non-trivial
// stroke width to demonstrate the differences
RenderEnvironment aa_env = RenderEnvironment::MakeN32(env.provider());
// Tweak the bounds tolerance for the displacement of 1/10 of a pixel
const BoundsTolerance aa_tolerance = tolerance.addBoundsPadding(1, 1);
auto sk_aa_setup = [=](SkSetupContext ctx, bool is_aa) {
ctx.canvas->translate(0.1, 0.1);
ctx.paint.setAntiAlias(is_aa);
ctx.paint.setStrokeWidth(5.0);
};
auto dl_aa_setup = [=](DlSetupContext ctx, bool is_aa) {
ctx.canvas->Translate(0.1, 0.1);
ctx.paint.setAntiAlias(is_aa);
ctx.paint.setStrokeWidth(5.0);
};
aa_env.init_ref(
[=](const SkSetupContext& ctx) { sk_aa_setup(ctx, false); },
testP.sk_renderer(),
[=](const DlSetupContext& ctx) { dl_aa_setup(ctx, false); },
testP.dl_renderer(), testP.imp_renderer());
quickCompareToReference(aa_env, "AntiAlias");
RenderWith(
testP, aa_env, aa_tolerance,
CaseParameters(
"AntiAlias == True",
[=](const SkSetupContext& ctx) { sk_aa_setup(ctx, true); },
[=](const DlSetupContext& ctx) { dl_aa_setup(ctx, true); }));
RenderWith(
testP, aa_env, aa_tolerance,
CaseParameters(
"AntiAlias == False",
[=](const SkSetupContext& ctx) { sk_aa_setup(ctx, false); },
[=](const DlSetupContext& ctx) { dl_aa_setup(ctx, false); }));
}
RenderWith( //
testP, env, tolerance,
CaseParameters(
"Color == Blue",
[=](const SkSetupContext& ctx) {
ctx.paint.setColor(SK_ColorBLUE);
},
[=](const DlSetupContext& ctx) {
ctx.paint.setColor(DlColor::kBlue());
}));
RenderWith( //
testP, env, tolerance,
CaseParameters(
"Color == Green",
[=](const SkSetupContext& ctx) {
ctx.paint.setColor(SK_ColorGREEN);
},
[=](const DlSetupContext& ctx) {
ctx.paint.setColor(DlColor::kGreen());
}));
RenderWithStrokes(testP, env, tolerance);
{
// half opaque cyan
DlColor blendable_color = DlColor::kCyan().withAlpha(0x7f);
DlColor bg = DlColor::kWhite();
RenderWith(testP, env, tolerance,
CaseParameters(
"Blend == SrcIn",
[=](const SkSetupContext& ctx) {
ctx.paint.setBlendMode(SkBlendMode::kSrcIn);
ctx.paint.setColor(blendable_color.argb());
},
[=](const DlSetupContext& ctx) {
ctx.paint.setBlendMode(DlBlendMode::kSrcIn);
ctx.paint.setColor(blendable_color);
})
.with_bg(bg));
RenderWith(testP, env, tolerance,
CaseParameters(
"Blend == DstIn",
[=](const SkSetupContext& ctx) {
ctx.paint.setBlendMode(SkBlendMode::kDstIn);
ctx.paint.setColor(blendable_color.argb());
},
[=](const DlSetupContext& ctx) {
ctx.paint.setBlendMode(DlBlendMode::kDstIn);
ctx.paint.setColor(blendable_color);
})
.with_bg(bg));
}
{
// Being able to see a blur requires some non-default attributes,
// like a non-trivial stroke width and a shader rather than a color
// (for drawPaint) so we create a new environment for these tests.
RenderEnvironment blur_env = RenderEnvironment::MakeN32(env.provider());
SkSetup sk_blur_setup = [=](const SkSetupContext& ctx) {
ctx.paint.setShader(MakeColorSource(ctx.image));
ctx.paint.setStrokeWidth(5.0);
};
DlSetup dl_blur_setup = [=](const DlSetupContext& ctx) {
ctx.paint.setColorSource(MakeColorSource(ctx.image));
ctx.paint.setStrokeWidth(5.0);
};
blur_env.init_ref(sk_blur_setup, testP.sk_renderer(), //
dl_blur_setup, testP.dl_renderer(),
testP.imp_renderer());
quickCompareToReference(blur_env, "blur");
DlBlurImageFilter dl_filter_decal_5(5.0, 5.0, DlTileMode::kDecal);
auto sk_filter_decal_5 =
SkImageFilters::Blur(5.0, 5.0, SkTileMode::kDecal, nullptr);
BoundsTolerance blur_5_tolerance = tolerance.addBoundsPadding(4, 4);
{
RenderWith(testP, blur_env, blur_5_tolerance,
CaseParameters(
"ImageFilter == Decal Blur 5",
[=](const SkSetupContext& ctx) {
sk_blur_setup(ctx);
ctx.paint.setImageFilter(sk_filter_decal_5);
},
[=](const DlSetupContext& ctx) {
dl_blur_setup(ctx);
ctx.paint.setImageFilter(&dl_filter_decal_5);
}));
}
DlBlurImageFilter dl_filter_clamp_5(5.0, 5.0, DlTileMode::kClamp);
auto sk_filter_clamp_5 =
SkImageFilters::Blur(5.0, 5.0, SkTileMode::kClamp, nullptr);
{
RenderWith(testP, blur_env, blur_5_tolerance,
CaseParameters(
"ImageFilter == Clamp Blur 5",
[=](const SkSetupContext& ctx) {
sk_blur_setup(ctx);
ctx.paint.setImageFilter(sk_filter_clamp_5);
},
[=](const DlSetupContext& ctx) {
dl_blur_setup(ctx);
ctx.paint.setImageFilter(&dl_filter_clamp_5);
}));
}
}
{
// Being able to see a dilate requires some non-default attributes,
// like a non-trivial stroke width and a shader rather than a color
// (for drawPaint) so we create a new environment for these tests.
RenderEnvironment dilate_env = RenderEnvironment::MakeN32(env.provider());
SkSetup sk_dilate_setup = [=](const SkSetupContext& ctx) {
ctx.paint.setShader(MakeColorSource(ctx.image));
ctx.paint.setStrokeWidth(5.0);
};
DlSetup dl_dilate_setup = [=](const DlSetupContext& ctx) {
ctx.paint.setColorSource(MakeColorSource(ctx.image));
ctx.paint.setStrokeWidth(5.0);
};
dilate_env.init_ref(sk_dilate_setup, testP.sk_renderer(), //
dl_dilate_setup, testP.dl_renderer(),
testP.imp_renderer());
quickCompareToReference(dilate_env, "dilate");
DlDilateImageFilter dl_dilate_filter_5(5.0, 5.0);
auto sk_dilate_filter_5 = SkImageFilters::Dilate(5.0, 5.0, nullptr);
RenderWith(testP, dilate_env, tolerance,
CaseParameters(
"ImageFilter == Dilate 5",
[=](const SkSetupContext& ctx) {
sk_dilate_setup(ctx);
ctx.paint.setImageFilter(sk_dilate_filter_5);
},
[=](const DlSetupContext& ctx) {
dl_dilate_setup(ctx);
ctx.paint.setImageFilter(&dl_dilate_filter_5);
}));
}
{
// Being able to see an erode requires some non-default attributes,
// like a non-trivial stroke width and a shader rather than a color
// (for drawPaint) so we create a new environment for these tests.
RenderEnvironment erode_env = RenderEnvironment::MakeN32(env.provider());
SkSetup sk_erode_setup = [=](const SkSetupContext& ctx) {
ctx.paint.setShader(MakeColorSource(ctx.image));
ctx.paint.setStrokeWidth(6.0);
};
DlSetup dl_erode_setup = [=](const DlSetupContext& ctx) {
ctx.paint.setColorSource(MakeColorSource(ctx.image));
ctx.paint.setStrokeWidth(6.0);
};
erode_env.init_ref(sk_erode_setup, testP.sk_renderer(), //
dl_erode_setup, testP.dl_renderer(),
testP.imp_renderer());
quickCompareToReference(erode_env, "erode");
// do not erode too much, because some tests assert there are enough
// pixels that are changed.
DlErodeImageFilter dl_erode_filter_1(1.0, 1.0);
auto sk_erode_filter_1 = SkImageFilters::Erode(1.0, 1.0, nullptr);
RenderWith(testP, erode_env, tolerance,
CaseParameters(
"ImageFilter == Erode 1",
[=](const SkSetupContext& ctx) {
sk_erode_setup(ctx);
ctx.paint.setImageFilter(sk_erode_filter_1);
},
[=](const DlSetupContext& ctx) {
dl_erode_setup(ctx);
ctx.paint.setImageFilter(&dl_erode_filter_1);
}));
}
{
// clang-format off
constexpr float rotate_color_matrix[20] = {
0, 1, 0, 0, 0,
0, 0, 1, 0, 0,
1, 0, 0, 0, 0,
0, 0, 0, 1, 0,
};
constexpr float invert_color_matrix[20] = {
-1.0, 0, 0, 1.0, 0,
0, -1.0, 0, 1.0, 0,
0, 0, -1.0, 1.0, 0,
1.0, 1.0, 1.0, 1.0, 0,
};
// clang-format on
DlMatrixColorFilter dl_color_filter(rotate_color_matrix);
auto sk_color_filter = SkColorFilters::Matrix(rotate_color_matrix);
{
DlColor bg = DlColor::kWhite();
RenderWith(testP, env, tolerance,
CaseParameters(
"ColorFilter == RotateRGB",
[=](const SkSetupContext& ctx) {
ctx.paint.setColor(SK_ColorYELLOW);
ctx.paint.setColorFilter(sk_color_filter);
},
[=](const DlSetupContext& ctx) {
ctx.paint.setColor(DlColor::kYellow());
ctx.paint.setColorFilter(&dl_color_filter);
})
.with_bg(bg));
}
{
DlColor bg = DlColor::kWhite();
RenderWith(testP, env, tolerance,
CaseParameters(
"ColorFilter == Invert",
[=](const SkSetupContext& ctx) {
ctx.paint.setColor(SK_ColorYELLOW);
ctx.paint.setColorFilter(
SkColorFilters::Matrix(invert_color_matrix));
},
[=](const DlSetupContext& ctx) {
ctx.paint.setColor(DlColor::kYellow());
ctx.paint.setInvertColors(true);
})
.with_bg(bg));
}
}
{
const DlBlurMaskFilter dl_mask_filter(DlBlurStyle::kNormal, 5.0);
auto sk_mask_filter = SkMaskFilter::MakeBlur(kNormal_SkBlurStyle, 5.0);
BoundsTolerance blur_5_tolerance = tolerance.addBoundsPadding(4, 4);
{
// Stroked primitives need some non-trivial stroke size to be blurred
RenderWith(testP, env, blur_5_tolerance,
CaseParameters(
"MaskFilter == Blur 5",
[=](const SkSetupContext& ctx) {
ctx.paint.setStrokeWidth(5.0);
ctx.paint.setMaskFilter(sk_mask_filter);
},
[=](const DlSetupContext& ctx) {
ctx.paint.setStrokeWidth(5.0);
ctx.paint.setMaskFilter(&dl_mask_filter);
}));
}
}
{
SkPoint end_points[] = {
SkPoint::Make(kRenderBounds.fLeft, kRenderBounds.fTop),
SkPoint::Make(kRenderBounds.fRight, kRenderBounds.fBottom),
};
DlColor dl_colors[] = {
DlColor::kGreen(),
DlColor::kYellow().withAlpha(0x7f),
DlColor::kBlue(),
};
SkColor sk_colors[] = {
SK_ColorGREEN,
SkColorSetA(SK_ColorYELLOW, 0x7f),
SK_ColorBLUE,
};
float stops[] = {
0.0,
0.5,
1.0,
};
auto dl_gradient =
DlColorSource::MakeLinear(end_points[0], end_points[1], 3, dl_colors,
stops, DlTileMode::kMirror);
auto sk_gradient = SkGradientShader::MakeLinear(
end_points, sk_colors, stops, 3, SkTileMode::kMirror, 0, nullptr);
{
RenderWith(testP, env, tolerance,
CaseParameters(
"LinearGradient GYB",
[=](const SkSetupContext& ctx) {
ctx.paint.setShader(sk_gradient);
ctx.paint.setDither(testP.uses_gradient());
},
[=](const DlSetupContext& ctx) {
ctx.paint.setColorSource(dl_gradient);
}));
}
}
}
static void RenderWithStrokes(const TestParameters& testP,
const RenderEnvironment& env,
const BoundsTolerance& tolerance_in) {
// The test cases were generated with geometry that will try to fill
// out the various miter limits used for testing, but they can be off
// by a couple of pixels so we will relax bounds testing for strokes by
// a couple of pixels.
BoundsTolerance tolerance = tolerance_in.addBoundsPadding(2, 2);
RenderWith(testP, env, tolerance,
CaseParameters(
"Fill",
[=](const SkSetupContext& ctx) {
ctx.paint.setStyle(SkPaint::kFill_Style);
},
[=](const DlSetupContext& ctx) {
ctx.paint.setDrawStyle(DlDrawStyle::kFill);
}));
// Skia on HW produces a strong miter consistent with width=1.0
// for any width less than a pixel, but the bounds computations of
// both DL and SkPicture do not account for this. We will get
// OOB pixel errors for the highly mitered drawPath geometry if
// we don't set stroke width to 1.0 for that test on HW.
// See https://bugs.chromium.org/p/skia/issues/detail?id=14046
bool no_hairlines =
testP.is_draw_path() &&
env.provider()->backend_type() != BackendType::kSoftwareBackend;
RenderWith(testP, env, tolerance,
CaseParameters(
"Stroke + defaults",
[=](const SkSetupContext& ctx) {
if (no_hairlines) {
ctx.paint.setStrokeWidth(1.0);
}
ctx.paint.setStyle(SkPaint::kStroke_Style);
},
[=](const DlSetupContext& ctx) {
if (no_hairlines) {
ctx.paint.setStrokeWidth(1.0);
}
ctx.paint.setDrawStyle(DlDrawStyle::kStroke);
}));
RenderWith(testP, env, tolerance,
CaseParameters(
"Fill + unnecessary StrokeWidth 10",
[=](const SkSetupContext& ctx) {
ctx.paint.setStyle(SkPaint::kFill_Style);
ctx.paint.setStrokeWidth(10.0);
},
[=](const DlSetupContext& ctx) {
ctx.paint.setDrawStyle(DlDrawStyle::kFill);
ctx.paint.setStrokeWidth(10.0);
}));
RenderEnvironment stroke_base_env =
RenderEnvironment::MakeN32(env.provider());
SkSetup sk_stroke_setup = [=](const SkSetupContext& ctx) {
ctx.paint.setStyle(SkPaint::kStroke_Style);
ctx.paint.setStrokeWidth(5.0);
};
DlSetup dl_stroke_setup = [=](const DlSetupContext& ctx) {
ctx.paint.setDrawStyle(DlDrawStyle::kStroke);
ctx.paint.setStrokeWidth(5.0);
};
stroke_base_env.init_ref(sk_stroke_setup, testP.sk_renderer(),
dl_stroke_setup, testP.dl_renderer(),
testP.imp_renderer());
quickCompareToReference(stroke_base_env, "stroke");
RenderWith(testP, stroke_base_env, tolerance,
CaseParameters(
"Stroke Width 10",
[=](const SkSetupContext& ctx) {
ctx.paint.setStyle(SkPaint::kStroke_Style);
ctx.paint.setStrokeWidth(10.0);
},
[=](const DlSetupContext& ctx) {
ctx.paint.setDrawStyle(DlDrawStyle::kStroke);
ctx.paint.setStrokeWidth(10.0);
}));
RenderWith(testP, stroke_base_env, tolerance,
CaseParameters(
"Stroke Width 5",
[=](const SkSetupContext& ctx) {
ctx.paint.setStyle(SkPaint::kStroke_Style);
ctx.paint.setStrokeWidth(5.0);
},
[=](const DlSetupContext& ctx) {
ctx.paint.setDrawStyle(DlDrawStyle::kStroke);
ctx.paint.setStrokeWidth(5.0);
}));
RenderWith(testP, stroke_base_env, tolerance,
CaseParameters(
"Stroke Width 5, Square Cap",
[=](const SkSetupContext& ctx) {
ctx.paint.setStyle(SkPaint::kStroke_Style);
ctx.paint.setStrokeWidth(5.0);
ctx.paint.setStrokeCap(SkPaint::kSquare_Cap);
},
[=](const DlSetupContext& ctx) {
ctx.paint.setDrawStyle(DlDrawStyle::kStroke);
ctx.paint.setStrokeWidth(5.0);
ctx.paint.setStrokeCap(DlStrokeCap::kSquare);
}));
RenderWith(testP, stroke_base_env, tolerance,
CaseParameters(
"Stroke Width 5, Round Cap",
[=](const SkSetupContext& ctx) {
ctx.paint.setStyle(SkPaint::kStroke_Style);
ctx.paint.setStrokeWidth(5.0);
ctx.paint.setStrokeCap(SkPaint::kRound_Cap);
},
[=](const DlSetupContext& ctx) {
ctx.paint.setDrawStyle(DlDrawStyle::kStroke);
ctx.paint.setStrokeWidth(5.0);
ctx.paint.setStrokeCap(DlStrokeCap::kRound);
}));
RenderWith(testP, stroke_base_env, tolerance,
CaseParameters(
"Stroke Width 5, Bevel Join",
[=](const SkSetupContext& ctx) {
ctx.paint.setStyle(SkPaint::kStroke_Style);
ctx.paint.setStrokeWidth(5.0);
ctx.paint.setStrokeJoin(SkPaint::kBevel_Join);
},
[=](const DlSetupContext& ctx) {
ctx.paint.setDrawStyle(DlDrawStyle::kStroke);
ctx.paint.setStrokeWidth(5.0);
ctx.paint.setStrokeJoin(DlStrokeJoin::kBevel);
}));
RenderWith(testP, stroke_base_env, tolerance,
CaseParameters(
"Stroke Width 5, Round Join",
[=](const SkSetupContext& ctx) {
ctx.paint.setStyle(SkPaint::kStroke_Style);
ctx.paint.setStrokeWidth(5.0);
ctx.paint.setStrokeJoin(SkPaint::kRound_Join);
},
[=](const DlSetupContext& ctx) {
ctx.paint.setDrawStyle(DlDrawStyle::kStroke);
ctx.paint.setStrokeWidth(5.0);
ctx.paint.setStrokeJoin(DlStrokeJoin::kRound);
}));
RenderWith(testP, stroke_base_env, tolerance,
CaseParameters(
"Stroke Width 5, Miter 10",
[=](const SkSetupContext& ctx) {
ctx.paint.setStyle(SkPaint::kStroke_Style);
ctx.paint.setStrokeWidth(5.0);
ctx.paint.setStrokeMiter(10.0);
ctx.paint.setStrokeJoin(SkPaint::kMiter_Join);
},
[=](const DlSetupContext& ctx) {
ctx.paint.setDrawStyle(DlDrawStyle::kStroke);
ctx.paint.setStrokeWidth(5.0);
ctx.paint.setStrokeMiter(10.0);
ctx.paint.setStrokeJoin(DlStrokeJoin::kMiter);
}));
RenderWith(testP, stroke_base_env, tolerance,
CaseParameters(
"Stroke Width 5, Miter 0",
[=](const SkSetupContext& ctx) {
ctx.paint.setStyle(SkPaint::kStroke_Style);
ctx.paint.setStrokeWidth(5.0);
ctx.paint.setStrokeMiter(0.0);
ctx.paint.setStrokeJoin(SkPaint::kMiter_Join);
},
[=](const DlSetupContext& ctx) {
ctx.paint.setDrawStyle(DlDrawStyle::kStroke);
ctx.paint.setStrokeWidth(5.0);
ctx.paint.setStrokeMiter(0.0);
ctx.paint.setStrokeJoin(DlStrokeJoin::kMiter);
}));
{
const SkScalar test_dashes_1[] = {29.0, 2.0};
const SkScalar test_dashes_2[] = {17.0, 1.5};
auto dl_dash_effect = DlDashPathEffect::Make(test_dashes_1, 2, 0.0f);
auto sk_dash_effect = SkDashPathEffect::Make(test_dashes_1, 2, 0.0f);
{
RenderWith(testP, stroke_base_env, tolerance,
CaseParameters(
"PathEffect without forced stroking == Dash-29-2",
[=](const SkSetupContext& ctx) {
// Provide some non-trivial stroke size to get dashed
ctx.paint.setStrokeWidth(5.0);
ctx.paint.setPathEffect(sk_dash_effect);
},
[=](const DlSetupContext& ctx) {
// Provide some non-trivial stroke size to get dashed
ctx.paint.setStrokeWidth(5.0);
ctx.paint.setPathEffect(dl_dash_effect);
}));
}
{
RenderWith(testP, stroke_base_env, tolerance,
CaseParameters(
"PathEffect == Dash-29-2",
[=](const SkSetupContext& ctx) {
// Need stroke style to see dashing properly
ctx.paint.setStyle(SkPaint::kStroke_Style);
// Provide some non-trivial stroke size to get dashed
ctx.paint.setStrokeWidth(5.0);
ctx.paint.setPathEffect(sk_dash_effect);
},
[=](const DlSetupContext& ctx) {
// Need stroke style to see dashing properly
ctx.paint.setDrawStyle(DlDrawStyle::kStroke);
// Provide some non-trivial stroke size to get dashed
ctx.paint.setStrokeWidth(5.0);
ctx.paint.setPathEffect(dl_dash_effect);
}));
}
dl_dash_effect = DlDashPathEffect::Make(test_dashes_2, 2, 0.0f);
sk_dash_effect = SkDashPathEffect::Make(test_dashes_2, 2, 0.0f);
{
RenderWith(testP, stroke_base_env, tolerance,
CaseParameters(
"PathEffect == Dash-17-1.5",
[=](const SkSetupContext& ctx) {
// Need stroke style to see dashing properly
ctx.paint.setStyle(SkPaint::kStroke_Style);
// Provide some non-trivial stroke size to get dashed
ctx.paint.setStrokeWidth(5.0);
ctx.paint.setPathEffect(sk_dash_effect);
},
[=](const DlSetupContext& ctx) {
// Need stroke style to see dashing properly
ctx.paint.setDrawStyle(DlDrawStyle::kStroke);
// Provide some non-trivial stroke size to get dashed
ctx.paint.setStrokeWidth(5.0);
ctx.paint.setPathEffect(dl_dash_effect);
}));
}
}
}
static void RenderWithTransforms(const TestParameters& testP,
const RenderEnvironment& env,
const BoundsTolerance& tolerance) {
// If the rendering method does not fill the corners of the original
// bounds, then the estimate under rotation or skewing will be off
// so we scale the padding by about 5% to compensate.
BoundsTolerance skewed_tolerance = tolerance.mulScale(1.05, 1.05);
RenderWith( //
testP, env, tolerance,
CaseParameters(
"Translate 5, 10", //
[=](const SkSetupContext& ctx) { ctx.canvas->translate(5, 10); },
[=](const DlSetupContext& ctx) { ctx.canvas->Translate(5, 10); }));
RenderWith( //
testP, env, tolerance,
CaseParameters(
"Scale +5%", //
[=](const SkSetupContext& ctx) { ctx.canvas->scale(1.05, 1.05); },
[=](const DlSetupContext& ctx) { ctx.canvas->Scale(1.05, 1.05); }));
RenderWith( //
testP, env, skewed_tolerance,
CaseParameters(
"Rotate 5 degrees", //
[=](const SkSetupContext& ctx) { ctx.canvas->rotate(5); },
[=](const DlSetupContext& ctx) { ctx.canvas->Rotate(5); }));
RenderWith( //
testP, env, skewed_tolerance,
CaseParameters(
"Skew 5%", //
[=](const SkSetupContext& ctx) { ctx.canvas->skew(0.05, 0.05); },
[=](const DlSetupContext& ctx) { ctx.canvas->Skew(0.05, 0.05); }));
{
// This rather odd transform can cause slight differences in
// computing in-bounds samples depending on which base rendering
// routine Skia uses. Making sure our matrix values are powers
// of 2 reduces, but does not eliminate, these slight differences
// in calculation when we are comparing rendering with an alpha
// to rendering opaque colors in the group opacity tests, for
// example.
SkScalar tweak = 1.0 / 16.0;
SkMatrix tx = SkMatrix::MakeAll(1.0 + tweak, tweak, 5, //
tweak, 1.0 + tweak, 10, //
0, 0, 1);
RenderWith( //
testP, env, skewed_tolerance,
CaseParameters(
"Transform 2D Affine",
[=](const SkSetupContext& ctx) { ctx.canvas->concat(tx); },
[=](const DlSetupContext& ctx) { ctx.canvas->Transform(tx); }));
}
{
SkM44 m44 = SkM44(1, 0, 0, kRenderCenterX, //
0, 1, 0, kRenderCenterY, //
0, 0, 1, 0, //
0, 0, .001, 1);
m44.preConcat(
SkM44::Rotate({1, 0, 0}, math::kPi / 60)); // 3 degrees around X
m44.preConcat(
SkM44::Rotate({0, 1, 0}, math::kPi / 45)); // 4 degrees around Y
m44.preTranslate(-kRenderCenterX, -kRenderCenterY);
RenderWith( //
testP, env, skewed_tolerance,
CaseParameters(
"Transform Full Perspective",
[=](const SkSetupContext& ctx) { ctx.canvas->concat(m44); },
[=](const DlSetupContext& ctx) { ctx.canvas->Transform(m44); }));
}
}
static void RenderWithClips(const TestParameters& testP,
const RenderEnvironment& env,
const BoundsTolerance& diff_tolerance) {
// We used to use an inset of 15.5 pixels here, but since Skia's rounding
// behavior at the center of pixels does not match between HW and SW, we
// ended up with some clips including different pixels between the two
// destinations and this interacted poorly with the carefully chosen
// geometry in some of the tests which was designed to have just the
// right features fully filling the clips based on the SW rounding. By
// moving to a 15.4 inset, the edge of the clip is never on the "rounding
// edge" of a pixel.
SkRect r_clip = kRenderBounds.makeInset(15.4, 15.4);
BoundsTolerance intersect_tolerance = diff_tolerance.clip(r_clip);
intersect_tolerance = intersect_tolerance.addPostClipPadding(1, 1);
RenderWith(testP, env, intersect_tolerance,
CaseParameters(
"Hard ClipRect inset by 15.4",
[=](const SkSetupContext& ctx) {
ctx.canvas->clipRect(r_clip, SkClipOp::kIntersect, false);
},
[=](const DlSetupContext& ctx) {
ctx.canvas->ClipRect(r_clip, ClipOp::kIntersect, false);
}));
RenderWith(testP, env, intersect_tolerance,
CaseParameters(
"AntiAlias ClipRect inset by 15.4",
[=](const SkSetupContext& ctx) {
ctx.canvas->clipRect(r_clip, SkClipOp::kIntersect, true);
},
[=](const DlSetupContext& ctx) {
ctx.canvas->ClipRect(r_clip, ClipOp::kIntersect, true);
}));
RenderWith(testP, env, diff_tolerance,
CaseParameters(
"Hard ClipRect Diff, inset by 15.4",
[=](const SkSetupContext& ctx) {
ctx.canvas->clipRect(r_clip, SkClipOp::kDifference, false);
},
[=](const DlSetupContext& ctx) {
ctx.canvas->ClipRect(r_clip, ClipOp::kDifference, false);
})
.with_diff_clip());
// This test RR clip used to use very small radii, but due to
// optimizations in the HW rrect rasterization, this caused small
// bulges in the corners of the RRect which were interpreted as
// "clip overruns" by the clip OOB pixel testing code. Using less
// abusively small radii fixes the problem.
SkRRect rr_clip = SkRRect::MakeRectXY(r_clip, 9, 9);
RenderWith(testP, env, intersect_tolerance,
CaseParameters(
"Hard ClipRRect with radius of 15.4",
[=](const SkSetupContext& ctx) {
ctx.canvas->clipRRect(rr_clip, SkClipOp::kIntersect,
false);
},
[=](const DlSetupContext& ctx) {
ctx.canvas->ClipRRect(rr_clip, ClipOp::kIntersect, false);
}));
RenderWith(testP, env, intersect_tolerance,
CaseParameters(
"AntiAlias ClipRRect with radius of 15.4",
[=](const SkSetupContext& ctx) {
ctx.canvas->clipRRect(rr_clip, SkClipOp::kIntersect, true);
},
[=](const DlSetupContext& ctx) {
ctx.canvas->ClipRRect(rr_clip, ClipOp::kIntersect, true);
}));
RenderWith(testP, env, diff_tolerance,
CaseParameters(
"Hard ClipRRect Diff, with radius of 15.4",
[=](const SkSetupContext& ctx) {
ctx.canvas->clipRRect(rr_clip, SkClipOp::kDifference,
false);
},
[=](const DlSetupContext& ctx) {
ctx.canvas->ClipRRect(rr_clip, ClipOp::kDifference, false);
})
.with_diff_clip());
SkPath path_clip = SkPath();
path_clip.setFillType(SkPathFillType::kEvenOdd);
path_clip.addRect(r_clip);
path_clip.addCircle(kRenderCenterX, kRenderCenterY, 1.0);
RenderWith(testP, env, intersect_tolerance,
CaseParameters(
"Hard ClipPath inset by 15.4",
[=](const SkSetupContext& ctx) {
ctx.canvas->clipPath(path_clip, SkClipOp::kIntersect,
false);
},
[=](const DlSetupContext& ctx) {
ctx.canvas->ClipPath(path_clip, ClipOp::kIntersect, false);
}));
RenderWith(testP, env, intersect_tolerance,
CaseParameters(
"AntiAlias ClipPath inset by 15.4",
[=](const SkSetupContext& ctx) {
ctx.canvas->clipPath(path_clip, SkClipOp::kIntersect,
true);
},
[=](const DlSetupContext& ctx) {
ctx.canvas->ClipPath(path_clip, ClipOp::kIntersect, true);
}));
RenderWith(
testP, env, diff_tolerance,
CaseParameters(
"Hard ClipPath Diff, inset by 15.4",
[=](const SkSetupContext& ctx) {
ctx.canvas->clipPath(path_clip, SkClipOp::kDifference, false);
},
[=](const DlSetupContext& ctx) {
ctx.canvas->ClipPath(path_clip, ClipOp::kDifference, false);
})
.with_diff_clip());
}
enum class DirectoryStatus {
kExisted,
kCreated,
kFailed,
};
static DirectoryStatus CheckDir(const std::string& dir) {
auto ret =
fml::OpenDirectory(dir.c_str(), false, fml::FilePermission::kRead);
if (ret.is_valid()) {
return DirectoryStatus::kExisted;
}
ret =
fml::OpenDirectory(dir.c_str(), true, fml::FilePermission::kReadWrite);
if (ret.is_valid()) {
return DirectoryStatus::kCreated;
}
FML_LOG(ERROR) << "Could not create directory (" << dir
<< ") for impeller failure images" << ", ret = " << ret.get()
<< ", errno = " << errno;
return DirectoryStatus::kFailed;
}
static void SetupImpellerFailureImageDirectory() {
std::string base_dir = "./impeller_failure_images";
if (CheckDir(base_dir) == DirectoryStatus::kFailed) {
return;
}
for (int i = 0; i < 10000; i++) {
std::string sub_dir = std::to_string(i);
while (sub_dir.length() < 4) {
sub_dir = "0" + sub_dir;
}
std::string try_dir = base_dir + "/" + sub_dir;
switch (CheckDir(try_dir)) {
case DirectoryStatus::kExisted:
break;
case DirectoryStatus::kCreated:
ImpellerFailureImageDirectory = try_dir;
return;
case DirectoryStatus::kFailed:
return;
}
}
FML_LOG(ERROR) << "Too many output directories for Impeller failure images";
}
static void save_to_png(const RenderResult* result,
const std::string& op_desc,
const std::string& reason) {
if (!SaveImpellerFailureImages) {
return;
}
if (ImpellerFailureImageDirectory.length() == 0) {
SetupImpellerFailureImageDirectory();
if (ImpellerFailureImageDirectory.length() == 0) {
SaveImpellerFailureImages = false;
return;
}
}
std::string filename = ImpellerFailureImageDirectory + "/";
for (const char& ch : op_desc) {
filename += (ch == ':' || ch == ' ') ? '_' : ch;
}
filename = filename + ".png";
result->write(filename);
ImpellerFailureImages.push_back(filename);
FML_LOG(ERROR) << reason << ": " << filename;
}
static void RenderWith(const TestParameters& testP,
const RenderEnvironment& env,
const BoundsTolerance& tolerance_in,
const CaseParameters& caseP) {
std::string test_name =
::testing::UnitTest::GetInstance()->current_test_info()->name();
const std::string info =
env.backend_name() + ": " + test_name + " (" + caseP.info() + ")";
const DlColor bg = caseP.bg();
RenderJobInfo base_info = {
.bg = bg,
};
// sk_result is a direct rendering via SkCanvas to SkSurface
// DisplayList mechanisms are not involved in this operation
SkJobRenderer sk_job(caseP.sk_setup(), //
testP.sk_renderer(), //
caseP.sk_restore(), //
env.sk_image());
auto sk_result = env.getResult(base_info, sk_job);
DlJobRenderer dl_job(caseP.dl_setup(), //
testP.dl_renderer(), //
caseP.dl_restore(), //
env.dl_image());
auto dl_result = env.getResult(base_info, dl_job);
EXPECT_EQ(sk_job.setup_matrix(), dl_job.setup_matrix());
EXPECT_EQ(sk_job.setup_clip_bounds(), dl_job.setup_clip_bounds());
ASSERT_EQ(sk_result->width(), kTestWidth) << info;
ASSERT_EQ(sk_result->height(), kTestHeight) << info;
ASSERT_EQ(dl_result->width(), kTestWidth) << info;
ASSERT_EQ(dl_result->height(), kTestHeight) << info;
const BoundsTolerance tolerance =
testP.adjust(tolerance_in, dl_job.setup_paint(), dl_job.setup_matrix());
const sk_sp<SkPicture> sk_picture = sk_job.MakePicture(base_info);
const sk_sp<DisplayList> display_list = dl_job.MakeDisplayList(base_info);
SkRect sk_bounds = sk_picture->cullRect();
checkPixels(sk_result.get(), sk_bounds, info + " (Skia reference)", bg);
if (testP.should_match(env, caseP, dl_job.setup_paint(), dl_job)) {
quickCompareToReference(env.ref_sk_result(), sk_result.get(), true,
info + " (attribute should not have effect)");
} else {
quickCompareToReference(env.ref_sk_result(), sk_result.get(), false,
info + " (attribute should affect rendering)");
}
// If either the reference setup or the test setup contain attributes
// that Impeller doesn't support, we skip the Impeller testing. This
// is mostly stroked or patterned text which is vectored through drawPath
// for Impeller.
if (env.supports_impeller() &&
testP.impeller_compatible(dl_job.setup_paint()) &&
testP.impeller_compatible(env.ref_dl_paint())) {
DlJobRenderer imp_job(caseP.dl_setup(), //
testP.imp_renderer(), //
caseP.dl_restore(), //
env.impeller_image());
auto imp_result = env.getImpellerResult(base_info, imp_job);
std::string imp_info = info + " (Impeller)";
bool success = checkPixels(imp_result.get(), imp_result->render_bounds(),
imp_info, bg);
if (testP.should_match(env, caseP, imp_job.setup_paint(), imp_job)) {
success = success && //
quickCompareToReference( //
env.ref_impeller_result(), imp_result.get(), true,
imp_info + " (attribute should not have effect)");
} else {
success = success && //
quickCompareToReference( //
env.ref_impeller_result(), imp_result.get(), false,
imp_info + " (attribute should affect rendering)");
}
if (SaveImpellerFailureImages && !success) {
FML_LOG(ERROR) << "Impeller issue encountered for: "
<< *imp_job.MakeDisplayList(base_info);
save_to_png(imp_result.get(), info + " (Impeller Result)",
"output saved in");
save_to_png(env.ref_impeller_result(), info + " (Impeller Reference)",
"compare to reference without attributes");
save_to_png(sk_result.get(), info + " (Skia Result)",
"and to Skia reference with attributes");
save_to_png(env.ref_sk_result(), info + " (Skia Reference)",
"and to Skia reference without attributes");
}
}
quickCompareToReference(sk_result.get(), dl_result.get(), true,
info + " (DlCanvas output matches SkCanvas)");
{
SkRect dl_bounds = display_list->bounds();
if (!sk_bounds.roundOut().contains(dl_bounds)) {
FML_LOG(ERROR) << "For " << info;
FML_LOG(ERROR) << "sk ref: " //
<< sk_bounds.fLeft << ", " << sk_bounds.fTop << " => "
<< sk_bounds.fRight << ", " << sk_bounds.fBottom;
FML_LOG(ERROR) << "dl: " //
<< dl_bounds.fLeft << ", " << dl_bounds.fTop << " => "
<< dl_bounds.fRight << ", " << dl_bounds.fBottom;
if (!dl_bounds.contains(sk_bounds)) {
FML_LOG(ERROR) << "DisplayList bounds are too small!";
}
if (!dl_bounds.isEmpty() &&
!sk_bounds.roundOut().contains(dl_bounds.roundOut())) {
FML_LOG(ERROR) << "###### DisplayList bounds larger than reference!";
}
}
// This EXPECT sometimes triggers, but when it triggers and I examine
// the ref_bounds, they are always unnecessarily large and since the
// pixel OOB tests in the compare method do not trigger, we will trust
// the DL bounds.
// EXPECT_TRUE(dl_bounds.contains(ref_bounds)) << info;
// When we are drawing a DisplayList, the display_list built above
// will contain just a single drawDisplayList call plus the case
// attribute. The sk_picture will, however, contain a list of all
// of the embedded calls in the display list and so the op counts
// will not be equal between the two.
if (!testP.is_draw_display_list()) {
EXPECT_EQ(static_cast<int>(display_list->op_count()),
sk_picture->approximateOpCount())
<< info;
EXPECT_EQ(static_cast<int>(display_list->op_count()),
sk_picture->approximateOpCount())
<< info;
}
DisplayListJobRenderer dl_builder_job(display_list);
auto dl_builder_result = env.getResult(base_info, dl_builder_job);
if (caseP.fuzzy_compare_components()) {
compareToReference(
dl_builder_result.get(), dl_result.get(),
info + " (DlCanvas DL output close to Builder Dl output)",
&dl_bounds, &tolerance, bg, true);
} else {
quickCompareToReference(
dl_builder_result.get(), dl_result.get(), true,
info + " (DlCanvas DL output matches Builder Dl output)");
}
compareToReference(dl_result.get(), sk_result.get(),
info + " (DisplayList built directly -> surface)",
&dl_bounds, &tolerance, bg,
caseP.fuzzy_compare_components());
if (display_list->can_apply_group_opacity()) {
checkGroupOpacity(env, display_list, dl_result.get(),
info + " with Group Opacity", bg);
}
}
{
// This sequence uses an SkPicture generated previously from the SkCanvas
// calls and a DisplayList generated previously from the DlCanvas calls
// and renders both back under a transform (scale(2x)) to see if their
// rendering is affected differently by a change of matrix between
// recording time and rendering time.
const int test_width_2 = kTestWidth * 2;
const int test_height_2 = kTestHeight * 2;
const SkScalar test_scale = 2.0;
SkPictureJobRenderer sk_job_x2(sk_picture);
RenderJobInfo info_2x = {
.width = test_width_2,
.height = test_height_2,
.bg = bg,
.scale = test_scale,
};
auto ref_x2_result = env.getResult(info_2x, sk_job_x2);
ASSERT_EQ(ref_x2_result->width(), test_width_2) << info;
ASSERT_EQ(ref_x2_result->height(), test_height_2) << info;
DisplayListJobRenderer dl_job_x2(display_list);
auto test_x2_result = env.getResult(info_2x, dl_job_x2);
compareToReference(test_x2_result.get(), ref_x2_result.get(),
info + " (Both rendered scaled 2x)", nullptr, nullptr,
bg, caseP.fuzzy_compare_components(), //
test_width_2, test_height_2, false);
}
}
static bool fuzzyCompare(uint32_t pixel_a, uint32_t pixel_b, int fudge) {
for (int i = 0; i < 32; i += 8) {
int comp_a = (pixel_a >> i) & 0xff;
int comp_b = (pixel_b >> i) & 0xff;
if (std::abs(comp_a - comp_b) > fudge) {
return false;
}
}
return true;
}
static int groupOpacityFudgeFactor(const RenderEnvironment& env) {
if (env.format() == PixelFormat::k565PixelFormat) {
return 9;
}
if (env.provider()->backend_type() == BackendType::kOpenGlBackend) {
// OpenGL gets a little fuzzy at times. Still, "within 5" (aka +/-4)
// for byte samples is not bad, though the other backends give +/-1
return 5;
}
return 2;
}
static void checkGroupOpacity(const RenderEnvironment& env,
const sk_sp<DisplayList>& display_list,
const RenderResult* ref_result,
const std::string& info,
DlColor bg) {
SkScalar opacity = 128.0 / 255.0;
DisplayListJobRenderer opacity_job(display_list);
RenderJobInfo opacity_info = {
.bg = bg,
.opacity = opacity,
};
auto group_opacity_result = env.getResult(opacity_info, opacity_job);
ASSERT_EQ(group_opacity_result->width(), kTestWidth) << info;
ASSERT_EQ(group_opacity_result->height(), kTestHeight) << info;
ASSERT_EQ(ref_result->width(), kTestWidth) << info;
ASSERT_EQ(ref_result->height(), kTestHeight) << info;
int pixels_touched = 0;
int pixels_different = 0;
int max_diff = 0;
// We need to allow some slight differences per component due to the
// fact that rearranging discrete calculations can compound round off
// errors. Off-by-2 is enough for 8 bit components, but for the 565
// tests we allow at least 9 which is the maximum distance between
// samples when converted to 8 bits. (You might think it would be a
// max step of 8 converting 5 bits to 8 bits, but it is really
// converting 31 steps to 255 steps with an average step size of
// 8.23 - 24 of the steps are by 8, but 7 of them are by 9.)
int fudge = groupOpacityFudgeFactor(env);
for (int y = 0; y < kTestHeight; y++) {
const uint32_t* ref_row = ref_result->addr32(0, y);
const uint32_t* test_row = group_opacity_result->addr32(0, y);
for (int x = 0; x < kTestWidth; x++) {
uint32_t ref_pixel = ref_row[x];
uint32_t test_pixel = test_row[x];
if (ref_pixel != bg.argb() || test_pixel != bg.argb()) {
pixels_touched++;
for (int i = 0; i < 32; i += 8) {
int ref_comp = (ref_pixel >> i) & 0xff;
int bg_comp = (bg.argb() >> i) & 0xff;
SkScalar faded_comp = bg_comp + (ref_comp - bg_comp) * opacity;
int test_comp = (test_pixel >> i) & 0xff;
if (std::abs(faded_comp - test_comp) > fudge) {
int diff = std::abs(faded_comp - test_comp);
if (max_diff < diff) {
max_diff = diff;
}
pixels_different++;
break;
}
}
}
}
}
ASSERT_GT(pixels_touched, 20) << info;
if (pixels_different > 1) {
FML_LOG(ERROR) << "max diff == " << max_diff << " for " << info;
}
ASSERT_LE(pixels_different, 1) << info;
}
static bool checkPixels(const RenderResult* ref_result,
const SkRect ref_bounds,
const std::string& info,
const DlColor bg = DlColor::kTransparent()) {
uint32_t untouched = bg.premultipliedArgb();
int pixels_touched = 0;
int pixels_oob = 0;
SkIRect i_bounds = ref_bounds.roundOut();
EXPECT_EQ(ref_result->width(), kTestWidth) << info;
EXPECT_EQ(ref_result->height(), kTestWidth) << info;
for (int y = 0; y < kTestHeight; y++) {
const uint32_t* ref_row = ref_result->addr32(0, y);
for (int x = 0; x < kTestWidth; x++) {
if (ref_row[x] != untouched) {
pixels_touched++;
if (!i_bounds.contains(x, y)) {
pixels_oob++;
}
}
}
}
EXPECT_EQ(pixels_oob, 0) << info;
EXPECT_GT(pixels_touched, 0) << info;
return pixels_oob == 0 && pixels_touched > 0;
}
static int countModifiedTransparentPixels(const RenderResult* ref_result,
const RenderResult* test_result) {
int count = 0;
for (int y = 0; y < kTestHeight; y++) {
const uint32_t* ref_row = ref_result->addr32(0, y);
const uint32_t* test_row = test_result->addr32(0, y);
for (int x = 0; x < kTestWidth; x++) {
if (ref_row[x] != test_row[x]) {
if (ref_row[x] == 0) {
count++;
}
}
}
}
return count;
}
static void quickCompareToReference(const RenderEnvironment& env,
const std::string& info) {
quickCompareToReference(env.ref_sk_result(), env.ref_dl_result(), true,
info + " reference rendering");
}
static bool quickCompareToReference(const RenderResult* ref_result,
const RenderResult* test_result,
bool should_match,
const std::string& info) {
int w = test_result->width();
int h = test_result->height();
EXPECT_EQ(w, ref_result->width()) << info;
EXPECT_EQ(h, ref_result->height()) << info;
int pixels_different = 0;
for (int y = 0; y < h; y++) {
const uint32_t* ref_row = ref_result->addr32(0, y);
const uint32_t* test_row = test_result->addr32(0, y);
for (int x = 0; x < w; x++) {
if (ref_row[x] != test_row[x]) {
if (should_match && pixels_different < 5) {
FML_LOG(ERROR) << std::hex << ref_row[x] << " != " << test_row[x];
}
pixels_different++;
}
}
}
if (should_match) {
EXPECT_EQ(pixels_different, 0) << info;
return pixels_different == 0;
} else {
EXPECT_NE(pixels_different, 0) << info;
return pixels_different != 0;
}
}
static void compareToReference(const RenderResult* test_result,
const RenderResult* ref_result,
const std::string& info,
SkRect* bounds,
const BoundsTolerance* tolerance,
const DlColor bg,
bool fuzzyCompares = false,
int width = kTestWidth,
int height = kTestHeight,
bool printMismatches = false) {
uint32_t untouched = bg.premultipliedArgb();
ASSERT_EQ(test_result->width(), width) << info;
ASSERT_EQ(test_result->height(), height) << info;
SkIRect i_bounds =
bounds ? bounds->roundOut() : SkIRect::MakeWH(width, height);
int pixels_different = 0;
int pixels_oob = 0;
int min_x = width;
int min_y = height;
int max_x = 0;
int max_y = 0;
for (int y = 0; y < height; y++) {
const uint32_t* ref_row = ref_result->addr32(0, y);
const uint32_t* test_row = test_result->addr32(0, y);
for (int x = 0; x < width; x++) {
if (bounds && test_row[x] != untouched) {
if (min_x > x) {
min_x = x;
}
if (min_y > y) {
min_y = y;
}
if (max_x <= x) {
max_x = x + 1;
}
if (max_y <= y) {
max_y = y + 1;
}
if (!i_bounds.contains(x, y)) {
pixels_oob++;
}
}
bool match = fuzzyCompares ? fuzzyCompare(test_row[x], ref_row[x], 1)
: test_row[x] == ref_row[x];
if (!match) {
if (printMismatches && pixels_different < 5) {
FML_LOG(ERROR) << "pix[" << x << ", " << y
<< "] mismatch: " << std::hex << test_row[x]
<< "(test) != (ref)" << ref_row[x] << std::dec;
}
pixels_different++;
}
}
}
if (pixels_oob > 0) {
FML_LOG(ERROR) << "pix bounds[" //
<< min_x << ", " << min_y << " => " << max_x << ", "
<< max_y << "]";
FML_LOG(ERROR) << "dl_bounds[" //
<< bounds->fLeft << ", " << bounds->fTop //
<< " => " //
<< bounds->fRight << ", " << bounds->fBottom //
<< "]";
} else if (bounds) {
showBoundsOverflow(info, i_bounds, tolerance, min_x, min_y, max_x, max_y);
}
ASSERT_EQ(pixels_oob, 0) << info;
ASSERT_EQ(pixels_different, 0) << info;
}
static void showBoundsOverflow(const std::string& info,
SkIRect& bounds,
const BoundsTolerance* tolerance,
int pixLeft,
int pixTop,
int pixRight,
int pixBottom) {
int pad_left = std::max(0, pixLeft - bounds.fLeft);
int pad_top = std::max(0, pixTop - bounds.fTop);
int pad_right = std::max(0, bounds.fRight - pixRight);
int pad_bottom = std::max(0, bounds.fBottom - pixBottom);
SkIRect pix_bounds =
SkIRect::MakeLTRB(pixLeft, pixTop, pixRight, pixBottom);
SkISize pix_size = pix_bounds.size();
int pix_width = pix_size.width();
int pix_height = pix_size.height();
int worst_pad_x = std::max(pad_left, pad_right);
int worst_pad_y = std::max(pad_top, pad_bottom);
if (tolerance->overflows(pix_bounds, worst_pad_x, worst_pad_y)) {
FML_LOG(ERROR) << "Computed bounds for " << info;
FML_LOG(ERROR) << "pix bounds[" //
<< pixLeft << ", " << pixTop << " => " //
<< pixRight << ", " << pixBottom //
<< "]";
FML_LOG(ERROR) << "dl_bounds[" //
<< bounds.fLeft << ", " << bounds.fTop //
<< " => " //
<< bounds.fRight << ", " << bounds.fBottom //
<< "]";
FML_LOG(ERROR) << "Bounds overly conservative by up to " //
<< worst_pad_x << ", " << worst_pad_y //
<< " (" << (worst_pad_x * 100.0 / pix_width) //
<< "%, " << (worst_pad_y * 100.0 / pix_height) << "%)";
int pix_area = pix_size.area();
int dl_area = bounds.width() * bounds.height();
FML_LOG(ERROR) << "Total overflow area: " << (dl_area - pix_area) //
<< " (+" << (dl_area * 100.0 / pix_area - 100.0) //
<< "% larger)";
FML_LOG(ERROR);
}
}
static sk_sp<SkTextBlob> MakeTextBlob(const std::string& string,
SkScalar font_height) {
SkFont font = CreateTestFontOfSize(font_height);
sk_sp<SkTypeface> face = font.refTypeface();
FML_CHECK(face);
FML_CHECK(face->countGlyphs() > 0) << "No glyphs in font";
return SkTextBlob::MakeFromText(string.c_str(), string.size(), font,
SkTextEncoding::kUTF8);
}
};
std::vector<BackendType> CanvasCompareTester::TestBackends;
std::string CanvasCompareTester::ImpellerFailureImageDirectory = "";
bool CanvasCompareTester::SaveImpellerFailureImages = false;
std::vector<std::string> CanvasCompareTester::ImpellerFailureImages;
BoundsTolerance CanvasCompareTester::DefaultTolerance =
BoundsTolerance().addAbsolutePadding(1, 1);
// Eventually this bare bones testing::Test fixture will subsume the
// CanvasCompareTester and the TestParameters could then become just
// configuration calls made upon the fixture.
template <typename BaseT>
class DisplayListRenderingTestBase : public BaseT,
protected DisplayListOpFlags {
public:
DisplayListRenderingTestBase() = default;
static bool StartsWith(std::string str, std::string prefix) {
if (prefix.length() > str.length()) {
return false;
}
for (size_t i = 0; i < prefix.length(); i++) {
if (str[i] != prefix[i]) {
return false;
}
}
return true;
}
static void SetUpTestSuite() {
bool do_software = true;
bool do_opengl = false;
bool do_metal = false;
std::vector<std::string> args = ::testing::internal::GetArgvs();
for (auto p_arg = std::next(args.begin()); p_arg != args.end(); p_arg++) {
std::string arg = *p_arg;
bool enable = true;
if (arg == "--save-impeller-failures") {
CanvasCompareTester::SaveImpellerFailureImages = true;
continue;
}
if (StartsWith(arg, "--no")) {
enable = false;
arg = "-" + arg.substr(4);
}
if (arg == "--enable-software") {
do_software = enable;
} else if (arg == "--enable-opengl" || arg == "--enable-gl") {
do_opengl = enable;
} else if (arg == "--enable-metal") {
do_metal = enable;
}
}
if (do_software) {
CanvasCompareTester::AddProvider(BackendType::kSoftwareBackend);
}
if (do_opengl) {
CanvasCompareTester::AddProvider(BackendType::kOpenGlBackend);
}
if (do_metal) {
CanvasCompareTester::AddProvider(BackendType::kMetalBackend);
}
std::string providers = "";
for (auto& back_end : CanvasCompareTester::TestBackends) {
providers += " " + DlSurfaceProvider::BackendName(back_end);
}
FML_LOG(INFO) << "Running tests on [" << providers << " ]";
}
static void TearDownTestSuite() {
if (CanvasCompareTester::ImpellerFailureImages.size() > 0) {
FML_LOG(INFO);
FML_LOG(INFO) << CanvasCompareTester::ImpellerFailureImages.size()
<< " images saved in "
<< CanvasCompareTester::ImpellerFailureImageDirectory;
for (const auto& filename : CanvasCompareTester::ImpellerFailureImages) {
FML_LOG(INFO) << " " << filename;
}
FML_LOG(INFO);
}
}
private:
FML_DISALLOW_COPY_AND_ASSIGN(DisplayListRenderingTestBase);
};
using DisplayListRendering = DisplayListRenderingTestBase<::testing::Test>;
TEST_F(DisplayListRendering, DrawPaint) {
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) { //
ctx.canvas->drawPaint(ctx.paint);
},
[=](const DlRenderContext& ctx) { //
ctx.canvas->DrawPaint(ctx.paint);
},
kDrawPaintFlags));
}
TEST_F(DisplayListRendering, DrawOpaqueColor) {
// We use a non-opaque color to avoid obliterating any backdrop filter output
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) {
// DrawColor is not tested against attributes because it is supposed
// to ignore them. So, if the paint has an alpha, it is because we
// are doing a saveLayer+backdrop test and we need to not flood over
// the backdrop output with a solid color. So, we perform an alpha
// drawColor for that case only.
SkColor color = SkColorSetA(SK_ColorMAGENTA, ctx.paint.getAlpha());
ctx.canvas->drawColor(color);
},
[=](const DlRenderContext& ctx) {
// DrawColor is not tested against attributes because it is supposed
// to ignore them. So, if the paint has an alpha, it is because we
// are doing a saveLayer+backdrop test and we need to not flood over
// the backdrop output with a solid color. So, we transfer the alpha
// from the paint for that case only.
ctx.canvas->DrawColor(
DlColor::kMagenta().withAlpha(ctx.paint.getAlpha()));
},
kDrawColorFlags));
}
TEST_F(DisplayListRendering, DrawAlphaColor) {
// We use a non-opaque color to avoid obliterating any backdrop filter output
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) {
ctx.canvas->drawColor(0x7FFF00FF);
},
[=](const DlRenderContext& ctx) {
ctx.canvas->DrawColor(DlColor(0x7FFF00FF));
},
kDrawColorFlags));
}
TEST_F(DisplayListRendering, DrawDiagonalLines) {
SkPoint p1 = SkPoint::Make(kRenderLeft, kRenderTop);
SkPoint p2 = SkPoint::Make(kRenderRight, kRenderBottom);
SkPoint p3 = SkPoint::Make(kRenderLeft, kRenderBottom);
SkPoint p4 = SkPoint::Make(kRenderRight, kRenderTop);
// Adding some edge center to edge center diagonals to better fill
// out the RRect Clip so bounds checking sees less empty bounds space.
SkPoint p5 = SkPoint::Make(kRenderCenterX, kRenderTop);
SkPoint p6 = SkPoint::Make(kRenderRight, kRenderCenterY);
SkPoint p7 = SkPoint::Make(kRenderLeft, kRenderCenterY);
SkPoint p8 = SkPoint::Make(kRenderCenterX, kRenderBottom);
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) { //
// Skia requires kStroke style on horizontal and vertical
// lines to get the bounds correct.
// See https://bugs.chromium.org/p/skia/issues/detail?id=12446
SkPaint p = ctx.paint;
p.setStyle(SkPaint::kStroke_Style);
ctx.canvas->drawLine(p1, p2, p);
ctx.canvas->drawLine(p3, p4, p);
ctx.canvas->drawLine(p5, p6, p);
ctx.canvas->drawLine(p7, p8, p);
},
[=](const DlRenderContext& ctx) { //
ctx.canvas->DrawLine(p1, p2, ctx.paint);
ctx.canvas->DrawLine(p3, p4, ctx.paint);
ctx.canvas->DrawLine(p5, p6, ctx.paint);
ctx.canvas->DrawLine(p7, p8, ctx.paint);
},
kDrawLineFlags)
.set_draw_line());
}
TEST_F(DisplayListRendering, DrawHorizontalLine) {
SkPoint p1 = SkPoint::Make(kRenderLeft, kRenderCenterY);
SkPoint p2 = SkPoint::Make(kRenderRight, kRenderCenterY);
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) { //
// Skia requires kStroke style on horizontal and vertical
// lines to get the bounds correct.
// See https://bugs.chromium.org/p/skia/issues/detail?id=12446
SkPaint p = ctx.paint;
p.setStyle(SkPaint::kStroke_Style);
ctx.canvas->drawLine(p1, p2, p);
},
[=](const DlRenderContext& ctx) { //
ctx.canvas->DrawLine(p1, p2, ctx.paint);
},
kDrawHVLineFlags)
.set_draw_line()
.set_horizontal_line());
}
TEST_F(DisplayListRendering, DrawVerticalLine) {
SkPoint p1 = SkPoint::Make(kRenderCenterX, kRenderTop);
SkPoint p2 = SkPoint::Make(kRenderCenterY, kRenderBottom);
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) { //
// Skia requires kStroke style on horizontal and vertical
// lines to get the bounds correct.
// See https://bugs.chromium.org/p/skia/issues/detail?id=12446
SkPaint p = ctx.paint;
p.setStyle(SkPaint::kStroke_Style);
ctx.canvas->drawLine(p1, p2, p);
},
[=](const DlRenderContext& ctx) { //
ctx.canvas->DrawLine(p1, p2, ctx.paint);
},
kDrawHVLineFlags)
.set_draw_line()
.set_vertical_line());
}
TEST_F(DisplayListRendering, DrawRect) {
// Bounds are offset by 0.5 pixels to induce AA
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) { //
ctx.canvas->drawRect(kRenderBounds.makeOffset(0.5, 0.5), ctx.paint);
},
[=](const DlRenderContext& ctx) { //
ctx.canvas->DrawRect(kRenderBounds.makeOffset(0.5, 0.5), ctx.paint);
},
kDrawRectFlags));
}
TEST_F(DisplayListRendering, DrawOval) {
SkRect rect = kRenderBounds.makeInset(0, 10);
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) { //
ctx.canvas->drawOval(rect, ctx.paint);
},
[=](const DlRenderContext& ctx) { //
ctx.canvas->DrawOval(rect, ctx.paint);
},
kDrawOvalFlags));
}
TEST_F(DisplayListRendering, DrawCircle) {
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) { //
ctx.canvas->drawCircle(kTestCenter, kRenderRadius, ctx.paint);
},
[=](const DlRenderContext& ctx) { //
ctx.canvas->DrawCircle(kTestCenter, kRenderRadius, ctx.paint);
},
kDrawCircleFlags));
}
TEST_F(DisplayListRendering, DrawRRect) {
SkRRect rrect = SkRRect::MakeRectXY(kRenderBounds, kRenderCornerRadius,
kRenderCornerRadius);
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) { //
ctx.canvas->drawRRect(rrect, ctx.paint);
},
[=](const DlRenderContext& ctx) { //
ctx.canvas->DrawRRect(rrect, ctx.paint);
},
kDrawRRectFlags));
}
TEST_F(DisplayListRendering, DrawDRRect) {
SkRRect outer = SkRRect::MakeRectXY(kRenderBounds, kRenderCornerRadius,
kRenderCornerRadius);
SkRect inner_bounds = kRenderBounds.makeInset(30.0, 30.0);
SkRRect inner = SkRRect::MakeRectXY(inner_bounds, kRenderCornerRadius,
kRenderCornerRadius);
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) { //
ctx.canvas->drawDRRect(outer, inner, ctx.paint);
},
[=](const DlRenderContext& ctx) { //
ctx.canvas->DrawDRRect(outer, inner, ctx.paint);
},
kDrawDRRectFlags));
}
TEST_F(DisplayListRendering, DrawPath) {
SkPath path;
// unclosed lines to show some caps
path.moveTo(kRenderLeft + 15, kRenderTop + 15);
path.lineTo(kRenderRight - 15, kRenderBottom - 15);
path.moveTo(kRenderLeft + 15, kRenderBottom - 15);
path.lineTo(kRenderRight - 15, kRenderTop + 15);
path.addRect(kRenderBounds);
// miter diamonds horizontally and vertically to show miters
path.moveTo(kVerticalMiterDiamondPoints[0]);
for (int i = 1; i < kVerticalMiterDiamondPointCount; i++) {
path.lineTo(kVerticalMiterDiamondPoints[i]);
}
path.close();
path.moveTo(kHorizontalMiterDiamondPoints[0]);
for (int i = 1; i < kHorizontalMiterDiamondPointCount; i++) {
path.lineTo(kHorizontalMiterDiamondPoints[i]);
}
path.close();
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) { //
ctx.canvas->drawPath(path, ctx.paint);
},
[=](const DlRenderContext& ctx) { //
ctx.canvas->DrawPath(path, ctx.paint);
},
kDrawPathFlags)
.set_draw_path());
}
TEST_F(DisplayListRendering, DrawArc) {
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) { //
ctx.canvas->drawArc(kRenderBounds, 60, 330, false, ctx.paint);
},
[=](const DlRenderContext& ctx) { //
ctx.canvas->DrawArc(kRenderBounds, 60, 330, false, ctx.paint);
},
kDrawArcNoCenterFlags));
}
TEST_F(DisplayListRendering, DrawArcCenter) {
// Center arcs that inscribe nearly a whole circle except for a small
// arc extent gap have 2 angles that may appear or disappear at the
// various miter limits tested (0, 4, and 10).
// The center angle here is 12 degrees which shows a miter
// at limit=10, but not 0 or 4.
// The arcs at the corners where it turns in towards the
// center show miters at 4 and 10, but not 0.
// Limit == 0, neither corner does a miter
// Limit == 4, only the edge "turn-in" corners miter
// Limit == 10, edge and center corners all miter
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) { //
ctx.canvas->drawArc(kRenderBounds, 60, 360 - 12, true, ctx.paint);
},
[=](const DlRenderContext& ctx) { //
ctx.canvas->DrawArc(kRenderBounds, 60, 360 - 12, true, ctx.paint);
},
kDrawArcWithCenterFlags)
.set_draw_arc_center());
}
TEST_F(DisplayListRendering, DrawPointsAsPoints) {
// The +/- 16 points are designed to fall just inside the clips
// that are tested against so we avoid lots of undrawn pixels
// in the accumulated bounds.
const SkScalar x0 = kRenderLeft;
const SkScalar x1 = kRenderLeft + 16;
const SkScalar x2 = (kRenderLeft + kRenderCenterX) * 0.5;
const SkScalar x3 = kRenderCenterX + 0.1;
const SkScalar x4 = (kRenderRight + kRenderCenterX) * 0.5;
const SkScalar x5 = kRenderRight - 16;
const SkScalar x6 = kRenderRight;
const SkScalar y0 = kRenderTop;
const SkScalar y1 = kRenderTop + 16;
const SkScalar y2 = (kRenderTop + kRenderCenterY) * 0.5;
const SkScalar y3 = kRenderCenterY + 0.1;
const SkScalar y4 = (kRenderBottom + kRenderCenterY) * 0.5;
const SkScalar y5 = kRenderBottom - 16;
const SkScalar y6 = kRenderBottom;
// clang-format off
const SkPoint points[] = {
{x0, y0}, {x1, y0}, {x2, y0}, {x3, y0}, {x4, y0}, {x5, y0}, {x6, y0},
{x0, y1}, {x1, y1}, {x2, y1}, {x3, y1}, {x4, y1}, {x5, y1}, {x6, y1},
{x0, y2}, {x1, y2}, {x2, y2}, {x3, y2}, {x4, y2}, {x5, y2}, {x6, y2},
{x0, y3}, {x1, y3}, {x2, y3}, {x3, y3}, {x4, y3}, {x5, y3}, {x6, y3},
{x0, y4}, {x1, y4}, {x2, y4}, {x3, y4}, {x4, y4}, {x5, y4}, {x6, y4},
{x0, y5}, {x1, y5}, {x2, y5}, {x3, y5}, {x4, y5}, {x5, y5}, {x6, y5},
{x0, y6}, {x1, y6}, {x2, y6}, {x3, y6}, {x4, y6}, {x5, y6}, {x6, y6},
};
// clang-format on
const int count = sizeof(points) / sizeof(points[0]);
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) {
// Skia requires kStroke style on horizontal and vertical
// lines to get the bounds correct.
// See https://bugs.chromium.org/p/skia/issues/detail?id=12446
SkPaint p = ctx.paint;
p.setStyle(SkPaint::kStroke_Style);
auto mode = SkCanvas::kPoints_PointMode;
ctx.canvas->drawPoints(mode, count, points, p);
},
[=](const DlRenderContext& ctx) {
auto mode = PointMode::kPoints;
ctx.canvas->DrawPoints(mode, count, points, ctx.paint);
},
kDrawPointsAsPointsFlags)
.set_draw_line()
.set_ignores_dashes());
}
TEST_F(DisplayListRendering, DrawPointsAsLines) {
const SkScalar x0 = kRenderLeft + 1;
const SkScalar x1 = kRenderLeft + 16;
const SkScalar x2 = kRenderRight - 16;
const SkScalar x3 = kRenderRight - 1;
const SkScalar y0 = kRenderTop;
const SkScalar y1 = kRenderTop + 16;
const SkScalar y2 = kRenderBottom - 16;
const SkScalar y3 = kRenderBottom;
// clang-format off
const SkPoint points[] = {
// Outer box
{x0, y0}, {x3, y0},
{x3, y0}, {x3, y3},
{x3, y3}, {x0, y3},
{x0, y3}, {x0, y0},
// Diagonals
{x0, y0}, {x3, y3}, {x3, y0}, {x0, y3},
// Inner box
{x1, y1}, {x2, y1},
{x2, y1}, {x2, y2},
{x2, y2}, {x1, y2},
{x1, y2}, {x1, y1},
};
// clang-format on
const int count = sizeof(points) / sizeof(points[0]);
ASSERT_TRUE((count & 1) == 0);
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) {
// Skia requires kStroke style on horizontal and vertical
// lines to get the bounds correct.
// See https://bugs.chromium.org/p/skia/issues/detail?id=12446
SkPaint p = ctx.paint;
p.setStyle(SkPaint::kStroke_Style);
auto mode = SkCanvas::kLines_PointMode;
ctx.canvas->drawPoints(mode, count, points, p);
},
[=](const DlRenderContext& ctx) {
auto mode = PointMode::kLines;
ctx.canvas->DrawPoints(mode, count, points, ctx.paint);
},
kDrawPointsAsLinesFlags));
}
TEST_F(DisplayListRendering, DrawPointsAsPolygon) {
const SkPoint points1[] = {
// RenderBounds box with a diamond
SkPoint::Make(kRenderLeft, kRenderTop),
SkPoint::Make(kRenderRight, kRenderTop),
SkPoint::Make(kRenderRight, kRenderBottom),
SkPoint::Make(kRenderLeft, kRenderBottom),
SkPoint::Make(kRenderLeft, kRenderTop),
SkPoint::Make(kRenderCenterX, kRenderTop),
SkPoint::Make(kRenderRight, kRenderCenterY),
SkPoint::Make(kRenderCenterX, kRenderBottom),
SkPoint::Make(kRenderLeft, kRenderCenterY),
};
const int count1 = sizeof(points1) / sizeof(points1[0]);
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) {
// Skia requires kStroke style on horizontal and vertical
// lines to get the bounds correct.
// See https://bugs.chromium.org/p/skia/issues/detail?id=12446
SkPaint p = ctx.paint;
p.setStyle(SkPaint::kStroke_Style);
auto mode = SkCanvas::kPolygon_PointMode;
ctx.canvas->drawPoints(mode, count1, points1, p);
},
[=](const DlRenderContext& ctx) {
auto mode = PointMode::kPolygon;
ctx.canvas->DrawPoints(mode, count1, points1, ctx.paint);
},
kDrawPointsAsPolygonFlags));
}
TEST_F(DisplayListRendering, DrawVerticesWithColors) {
// Cover as many sides of the box with only 6 vertices:
// +----------+
// |xxxxxxxxxx|
// | xxxxxx|
// | xxx|
// |xxx |
// |xxxxxx |
// |xxxxxxxxxx|
// +----------|
const SkPoint pts[6] = {
// Upper-Right corner, full top, half right coverage
SkPoint::Make(kRenderLeft, kRenderTop),
SkPoint::Make(kRenderRight, kRenderTop),
SkPoint::Make(kRenderRight, kRenderCenterY),
// Lower-Left corner, full bottom, half left coverage
SkPoint::Make(kRenderLeft, kRenderBottom),
SkPoint::Make(kRenderLeft, kRenderCenterY),
SkPoint::Make(kRenderRight, kRenderBottom),
};
const DlColor dl_colors[6] = {
DlColor::kRed(), DlColor::kBlue(), DlColor::kGreen(),
DlColor::kCyan(), DlColor::kYellow(), DlColor::kMagenta(),
};
const SkColor sk_colors[6] = {
SK_ColorRED, SK_ColorBLUE, SK_ColorGREEN,
SK_ColorCYAN, SK_ColorYELLOW, SK_ColorMAGENTA,
};
const std::shared_ptr<DlVertices> dl_vertices =
DlVertices::Make(DlVertexMode::kTriangles, 6, pts, nullptr, dl_colors);
const auto sk_vertices =
SkVertices::MakeCopy(SkVertices::VertexMode::kTriangles_VertexMode, 6,
pts, nullptr, sk_colors);
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) {
ctx.canvas->drawVertices(sk_vertices, SkBlendMode::kSrcOver,
ctx.paint);
},
[=](const DlRenderContext& ctx) {
ctx.canvas->DrawVertices(dl_vertices, DlBlendMode::kSrcOver,
ctx.paint);
},
kDrawVerticesFlags));
}
TEST_F(DisplayListRendering, DrawVerticesWithImage) {
// Cover as many sides of the box with only 6 vertices:
// +----------+
// |xxxxxxxxxx|
// | xxxxxx|
// | xxx|
// |xxx |
// |xxxxxx |
// |xxxxxxxxxx|
// +----------|
const SkPoint pts[6] = {
// Upper-Right corner, full top, half right coverage
SkPoint::Make(kRenderLeft, kRenderTop),
SkPoint::Make(kRenderRight, kRenderTop),
SkPoint::Make(kRenderRight, kRenderCenterY),
// Lower-Left corner, full bottom, half left coverage
SkPoint::Make(kRenderLeft, kRenderBottom),
SkPoint::Make(kRenderLeft, kRenderCenterY),
SkPoint::Make(kRenderRight, kRenderBottom),
};
const SkPoint tex[6] = {
SkPoint::Make(kRenderWidth / 2.0, 0),
SkPoint::Make(0, kRenderHeight),
SkPoint::Make(kRenderWidth, kRenderHeight),
SkPoint::Make(kRenderWidth / 2, kRenderHeight),
SkPoint::Make(0, 0),
SkPoint::Make(kRenderWidth, 0),
};
const std::shared_ptr<DlVertices> dl_vertices =
DlVertices::Make(DlVertexMode::kTriangles, 6, pts, tex, nullptr);
const auto sk_vertices = SkVertices::MakeCopy(
SkVertices::VertexMode::kTriangles_VertexMode, 6, pts, tex, nullptr);
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) { //
SkPaint v_paint = ctx.paint;
if (v_paint.getShader() == nullptr) {
v_paint.setShader(MakeColorSource(ctx.image));
}
ctx.canvas->drawVertices(sk_vertices, SkBlendMode::kSrcOver,
v_paint);
},
[=](const DlRenderContext& ctx) { //
DlPaint v_paint = ctx.paint;
if (v_paint.getColorSource() == nullptr) {
v_paint.setColorSource(MakeColorSource(ctx.image));
}
ctx.canvas->DrawVertices(dl_vertices, DlBlendMode::kSrcOver,
v_paint);
},
kDrawVerticesFlags));
}
TEST_F(DisplayListRendering, DrawImageNearest) {
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) {
ctx.canvas->drawImage(ctx.image, kRenderLeft, kRenderTop,
SkImageSampling::kNearestNeighbor,
&ctx.paint);
},
[=](const DlRenderContext& ctx) {
ctx.canvas->DrawImage(ctx.image, //
SkPoint::Make(kRenderLeft, kRenderTop),
DlImageSampling::kNearestNeighbor,
&ctx.paint);
},
kDrawImageWithPaintFlags));
}
TEST_F(DisplayListRendering, DrawImageNearestNoPaint) {
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) {
ctx.canvas->drawImage(ctx.image, kRenderLeft, kRenderTop,
SkImageSampling::kNearestNeighbor, nullptr);
},
[=](const DlRenderContext& ctx) {
ctx.canvas->DrawImage(ctx.image,
SkPoint::Make(kRenderLeft, kRenderTop),
DlImageSampling::kNearestNeighbor, nullptr);
},
kDrawImageFlags));
}
TEST_F(DisplayListRendering, DrawImageLinear) {
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) {
ctx.canvas->drawImage(ctx.image, kRenderLeft, kRenderTop,
SkImageSampling::kLinear, &ctx.paint);
},
[=](const DlRenderContext& ctx) {
ctx.canvas->DrawImage(ctx.image,
SkPoint::Make(kRenderLeft, kRenderTop),
DlImageSampling::kLinear, &ctx.paint);
},
kDrawImageWithPaintFlags));
}
TEST_F(DisplayListRendering, DrawImageRectNearest) {
SkRect src = SkRect::MakeIWH(kRenderWidth, kRenderHeight).makeInset(5, 5);
SkRect dst = kRenderBounds.makeInset(10.5, 10.5);
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) {
ctx.canvas->drawImageRect(
ctx.image, src, dst, SkImageSampling::kNearestNeighbor,
&ctx.paint, SkCanvas::kFast_SrcRectConstraint);
},
[=](const DlRenderContext& ctx) {
ctx.canvas->DrawImageRect(
ctx.image, src, dst, DlImageSampling::kNearestNeighbor,
&ctx.paint, DlCanvas::SrcRectConstraint::kFast);
},
kDrawImageRectWithPaintFlags));
}
TEST_F(DisplayListRendering, DrawImageRectNearestNoPaint) {
SkRect src = SkRect::MakeIWH(kRenderWidth, kRenderHeight).makeInset(5, 5);
SkRect dst = kRenderBounds.makeInset(10.5, 10.5);
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) {
ctx.canvas->drawImageRect(
ctx.image, src, dst, SkImageSampling::kNearestNeighbor, //
nullptr, SkCanvas::kFast_SrcRectConstraint);
},
[=](const DlRenderContext& ctx) {
ctx.canvas->DrawImageRect(
ctx.image, src, dst, DlImageSampling::kNearestNeighbor, //
nullptr, DlCanvas::SrcRectConstraint::kFast);
},
kDrawImageRectFlags));
}
TEST_F(DisplayListRendering, DrawImageRectLinear) {
SkRect src = SkRect::MakeIWH(kRenderWidth, kRenderHeight).makeInset(5, 5);
SkRect dst = kRenderBounds.makeInset(10.5, 10.5);
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) {
ctx.canvas->drawImageRect(
ctx.image, src, dst, SkImageSampling::kLinear, //
&ctx.paint, SkCanvas::kFast_SrcRectConstraint);
},
[=](const DlRenderContext& ctx) { //
ctx.canvas->DrawImageRect(
ctx.image, src, dst, DlImageSampling::kLinear, //
&ctx.paint, DlCanvas::SrcRectConstraint::kFast);
},
kDrawImageRectWithPaintFlags));
}
TEST_F(DisplayListRendering, DrawImageNineNearest) {
SkIRect src = SkIRect::MakeWH(kRenderWidth, kRenderHeight).makeInset(25, 25);
SkRect dst = kRenderBounds.makeInset(10.5, 10.5);
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) {
ctx.canvas->drawImageNine(ctx.image.get(), src, dst,
SkFilterMode::kNearest, &ctx.paint);
},
[=](const DlRenderContext& ctx) {
ctx.canvas->DrawImageNine(ctx.image, src, dst,
DlFilterMode::kNearest, &ctx.paint);
},
kDrawImageNineWithPaintFlags));
}
TEST_F(DisplayListRendering, DrawImageNineNearestNoPaint) {
SkIRect src = SkIRect::MakeWH(kRenderWidth, kRenderHeight).makeInset(25, 25);
SkRect dst = kRenderBounds.makeInset(10.5, 10.5);
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) {
ctx.canvas->drawImageNine(ctx.image.get(), src, dst,
SkFilterMode::kNearest, nullptr);
},
[=](const DlRenderContext& ctx) {
ctx.canvas->DrawImageNine(ctx.image, src, dst,
DlFilterMode::kNearest, nullptr);
},
kDrawImageNineFlags));
}
TEST_F(DisplayListRendering, DrawImageNineLinear) {
SkIRect src = SkIRect::MakeWH(kRenderWidth, kRenderHeight).makeInset(25, 25);
SkRect dst = kRenderBounds.makeInset(10.5, 10.5);
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) {
ctx.canvas->drawImageNine(ctx.image.get(), src, dst,
SkFilterMode::kLinear, &ctx.paint);
},
[=](const DlRenderContext& ctx) {
ctx.canvas->DrawImageNine(ctx.image, src, dst,
DlFilterMode::kLinear, &ctx.paint);
},
kDrawImageNineWithPaintFlags));
}
TEST_F(DisplayListRendering, DrawAtlasNearest) {
const SkRSXform xform[] = {
// clang-format off
{ 1.2f, 0.0f, kRenderLeft, kRenderTop},
{ 0.0f, 1.2f, kRenderRight, kRenderTop},
{-1.2f, 0.0f, kRenderRight, kRenderBottom},
{ 0.0f, -1.2f, kRenderLeft, kRenderBottom},
// clang-format on
};
const SkRect tex[] = {
// clang-format off
{0, 0, kRenderHalfWidth, kRenderHalfHeight},
{kRenderHalfWidth, 0, kRenderWidth, kRenderHalfHeight},
{kRenderHalfWidth, kRenderHalfHeight, kRenderWidth, kRenderHeight},
{0, kRenderHalfHeight, kRenderHalfWidth, kRenderHeight},
// clang-format on
};
const SkColor sk_colors[] = {
SK_ColorBLUE,
SK_ColorGREEN,
SK_ColorYELLOW,
SK_ColorMAGENTA,
};
const DlColor dl_colors[] = {
DlColor::kBlue(),
DlColor::kGreen(),
DlColor::kYellow(),
DlColor::kMagenta(),
};
const DlImageSampling dl_sampling = DlImageSampling::kNearestNeighbor;
const SkSamplingOptions sk_sampling = SkImageSampling::kNearestNeighbor;
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) {
ctx.canvas->drawAtlas(ctx.image.get(), xform, tex, sk_colors, 4,
SkBlendMode::kSrcOver, sk_sampling, nullptr,
&ctx.paint);
},
[=](const DlRenderContext& ctx) {
ctx.canvas->DrawAtlas(ctx.image, xform, tex, dl_colors, 4,
DlBlendMode::kSrcOver, dl_sampling, nullptr,
&ctx.paint);
},
kDrawAtlasWithPaintFlags));
}
TEST_F(DisplayListRendering, DrawAtlasNearestNoPaint) {
const SkRSXform xform[] = {
// clang-format off
{ 1.2f, 0.0f, kRenderLeft, kRenderTop},
{ 0.0f, 1.2f, kRenderRight, kRenderTop},
{-1.2f, 0.0f, kRenderRight, kRenderBottom},
{ 0.0f, -1.2f, kRenderLeft, kRenderBottom},
// clang-format on
};
const SkRect tex[] = {
// clang-format off
{0, 0, kRenderHalfWidth, kRenderHalfHeight},
{kRenderHalfWidth, 0, kRenderWidth, kRenderHalfHeight},
{kRenderHalfWidth, kRenderHalfHeight, kRenderWidth, kRenderHeight},
{0, kRenderHalfHeight, kRenderHalfWidth, kRenderHeight},
// clang-format on
};
const SkColor sk_colors[] = {
SK_ColorBLUE,
SK_ColorGREEN,
SK_ColorYELLOW,
SK_ColorMAGENTA,
};
const DlColor dl_colors[] = {
DlColor::kBlue(),
DlColor::kGreen(),
DlColor::kYellow(),
DlColor::kMagenta(),
};
const DlImageSampling dl_sampling = DlImageSampling::kNearestNeighbor;
const SkSamplingOptions sk_sampling = SkImageSampling::kNearestNeighbor;
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) {
ctx.canvas->drawAtlas(ctx.image.get(), xform, tex, sk_colors, 4,
SkBlendMode::kSrcOver, sk_sampling, //
nullptr, nullptr);
},
[=](const DlRenderContext& ctx) {
ctx.canvas->DrawAtlas(ctx.image, xform, tex, dl_colors, 4,
DlBlendMode::kSrcOver, dl_sampling, //
nullptr, nullptr);
},
kDrawAtlasFlags));
}
TEST_F(DisplayListRendering, DrawAtlasLinear) {
const SkRSXform xform[] = {
// clang-format off
{ 1.2f, 0.0f, kRenderLeft, kRenderTop},
{ 0.0f, 1.2f, kRenderRight, kRenderTop},
{-1.2f, 0.0f, kRenderRight, kRenderBottom},
{ 0.0f, -1.2f, kRenderLeft, kRenderBottom},
// clang-format on
};
const SkRect tex[] = {
// clang-format off
{0, 0, kRenderHalfWidth, kRenderHalfHeight},
{kRenderHalfWidth, 0, kRenderWidth, kRenderHalfHeight},
{kRenderHalfWidth, kRenderHalfHeight, kRenderWidth, kRenderHeight},
{0, kRenderHalfHeight, kRenderHalfWidth, kRenderHeight},
// clang-format on
};
const SkColor sk_colors[] = {
SK_ColorBLUE,
SK_ColorGREEN,
SK_ColorYELLOW,
SK_ColorMAGENTA,
};
const DlColor dl_colors[] = {
DlColor::kBlue(),
DlColor::kGreen(),
DlColor::kYellow(),
DlColor::kMagenta(),
};
const DlImageSampling dl_sampling = DlImageSampling::kLinear;
const SkSamplingOptions sk_sampling = SkImageSampling::kLinear;
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) {
ctx.canvas->drawAtlas(ctx.image.get(), xform, tex, sk_colors, 2,
SkBlendMode::kSrcOver, sk_sampling, //
nullptr, &ctx.paint);
},
[=](const DlRenderContext& ctx) {
ctx.canvas->DrawAtlas(ctx.image, xform, tex, dl_colors, 2,
DlBlendMode::kSrcOver, dl_sampling, //
nullptr, &ctx.paint);
},
kDrawAtlasWithPaintFlags));
}
sk_sp<DisplayList> makeTestDisplayList() {
DisplayListBuilder builder;
DlPaint paint;
paint.setDrawStyle(DlDrawStyle::kFill);
paint.setColor(DlColor(SK_ColorRED));
builder.DrawRect({kRenderLeft, kRenderTop, kRenderCenterX, kRenderCenterY},
paint);
paint.setColor(DlColor(SK_ColorBLUE));
builder.DrawRect({kRenderCenterX, kRenderTop, kRenderRight, kRenderCenterY},
paint);
paint.setColor(DlColor(SK_ColorGREEN));
builder.DrawRect({kRenderLeft, kRenderCenterY, kRenderCenterX, kRenderBottom},
paint);
paint.setColor(DlColor(SK_ColorYELLOW));
builder.DrawRect(
{kRenderCenterX, kRenderCenterY, kRenderRight, kRenderBottom}, paint);
return builder.Build();
}
TEST_F(DisplayListRendering, DrawDisplayList) {
sk_sp<DisplayList> display_list = makeTestDisplayList();
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) { //
DlSkCanvasAdapter(ctx.canvas).DrawDisplayList(display_list);
},
[=](const DlRenderContext& ctx) { //
ctx.canvas->DrawDisplayList(display_list);
},
kDrawDisplayListFlags)
.set_draw_display_list());
}
TEST_F(DisplayListRendering, DrawTextBlob) {
// TODO(https://github.com/flutter/flutter/issues/82202): Remove once the
// performance overlay can use Fuchsia's font manager instead of the empty
// default.
#if defined(OS_FUCHSIA)
GTEST_SKIP() << "Rendering comparisons require a valid default font manager";
#else
sk_sp<SkTextBlob> blob =
CanvasCompareTester::MakeTextBlob("Testing", kRenderHeight * 0.33f);
#ifdef IMPELLER_SUPPORTS_RENDERING
auto frame = impeller::MakeTextFrameFromTextBlobSkia(blob);
#endif // IMPELLER_SUPPORTS_RENDERING
SkScalar render_y_1_3 = kRenderTop + kRenderHeight * 0.3;
SkScalar render_y_2_3 = kRenderTop + kRenderHeight * 0.6;
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) {
auto paint = ctx.paint;
ctx.canvas->drawTextBlob(blob, kRenderLeft, render_y_1_3, paint);
ctx.canvas->drawTextBlob(blob, kRenderLeft, render_y_2_3, paint);
ctx.canvas->drawTextBlob(blob, kRenderLeft, kRenderBottom, paint);
},
[=](const DlRenderContext& ctx) {
auto paint = ctx.paint;
ctx.canvas->DrawTextBlob(blob, kRenderLeft, render_y_1_3, paint);
ctx.canvas->DrawTextBlob(blob, kRenderLeft, render_y_2_3, paint);
ctx.canvas->DrawTextBlob(blob, kRenderLeft, kRenderBottom, paint);
},
#ifdef IMPELLER_SUPPORTS_RENDERING
[=](const DlRenderContext& ctx) {
auto paint = ctx.paint;
ctx.canvas->DrawTextFrame(frame, kRenderLeft, render_y_1_3, paint);
ctx.canvas->DrawTextFrame(frame, kRenderLeft, render_y_2_3, paint);
ctx.canvas->DrawTextFrame(frame, kRenderLeft, kRenderBottom, paint);
},
#endif // IMPELLER_SUPPORTS_RENDERING
kDrawTextBlobFlags)
.set_draw_text_blob(),
// From examining the bounds differential for the "Default" case, the
// SkTextBlob adds a padding of ~32 on the left, ~30 on the right,
// ~12 on top and ~8 on the bottom, so we add 33h & 13v allowed
// padding to the tolerance
CanvasCompareTester::DefaultTolerance.addBoundsPadding(33, 13));
EXPECT_TRUE(blob->unique());
#endif // OS_FUCHSIA
}
TEST_F(DisplayListRendering, DrawShadow) {
SkPath path;
path.addRoundRect(
{
kRenderLeft + 10,
kRenderTop,
kRenderRight - 10,
kRenderBottom - 20,
},
kRenderCornerRadius, kRenderCornerRadius);
const DlColor color = DlColor::kDarkGrey();
const SkScalar elevation = 5;
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) { //
DlSkCanvasDispatcher::DrawShadow(ctx.canvas, path, color, elevation,
false, 1.0);
},
[=](const DlRenderContext& ctx) { //
ctx.canvas->DrawShadow(path, color, elevation, false, 1.0);
},
kDrawShadowFlags),
CanvasCompareTester::DefaultTolerance.addBoundsPadding(3, 3));
}
TEST_F(DisplayListRendering, DrawShadowTransparentOccluder) {
SkPath path;
path.addRoundRect(
{
kRenderLeft + 10,
kRenderTop,
kRenderRight - 10,
kRenderBottom - 20,
},
kRenderCornerRadius, kRenderCornerRadius);
const DlColor color = DlColor::kDarkGrey();
const SkScalar elevation = 5;
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) { //
DlSkCanvasDispatcher::DrawShadow(ctx.canvas, path, color, elevation,
true, 1.0);
},
[=](const DlRenderContext& ctx) { //
ctx.canvas->DrawShadow(path, color, elevation, true, 1.0);
},
kDrawShadowFlags),
CanvasCompareTester::DefaultTolerance.addBoundsPadding(3, 3));
}
TEST_F(DisplayListRendering, DrawShadowDpr) {
SkPath path;
path.addRoundRect(
{
kRenderLeft + 10,
kRenderTop,
kRenderRight - 10,
kRenderBottom - 20,
},
kRenderCornerRadius, kRenderCornerRadius);
const DlColor color = DlColor::kDarkGrey();
const SkScalar elevation = 5;
CanvasCompareTester::RenderAll( //
TestParameters(
[=](const SkRenderContext& ctx) { //
DlSkCanvasDispatcher::DrawShadow(ctx.canvas, path, color, elevation,
false, 1.5);
},
[=](const DlRenderContext& ctx) { //
ctx.canvas->DrawShadow(path, color, elevation, false, 1.5);
},
kDrawShadowFlags),
CanvasCompareTester::DefaultTolerance.addBoundsPadding(3, 3));
}
TEST_F(DisplayListRendering, SaveLayerClippedContentStillFilters) {
// draw rect is just outside of render bounds on the right
const SkRect draw_rect = SkRect::MakeLTRB( //
kRenderRight + 1, //
kRenderTop, //
kTestBounds2.fRight, //
kRenderBottom //
);
TestParameters test_params(
[=](const SkRenderContext& ctx) {
auto layer_filter =
SkImageFilters::Blur(10.0f, 10.0f, SkTileMode::kDecal, nullptr);
SkPaint layer_paint;
layer_paint.setImageFilter(layer_filter);
ctx.canvas->save();
ctx.canvas->clipRect(kRenderBounds, SkClipOp::kIntersect, false);
ctx.canvas->saveLayer(&kTestBounds2, &layer_paint);
ctx.canvas->drawRect(draw_rect, ctx.paint);
ctx.canvas->restore();
ctx.canvas->restore();
},
[=](const DlRenderContext& ctx) {
auto layer_filter =
DlBlurImageFilter::Make(10.0f, 10.0f, DlTileMode::kDecal);
DlPaint layer_paint;
layer_paint.setImageFilter(layer_filter);
ctx.canvas->Save();
ctx.canvas->ClipRect(kRenderBounds, ClipOp::kIntersect, false);
ctx.canvas->SaveLayer(&kTestBounds2, &layer_paint);
ctx.canvas->DrawRect(draw_rect, ctx.paint);
ctx.canvas->Restore();
ctx.canvas->Restore();
},
kSaveLayerWithPaintFlags);
CaseParameters case_params("Filtered SaveLayer with clipped content");
BoundsTolerance tolerance = BoundsTolerance().addAbsolutePadding(6.0f, 6.0f);
for (auto& back_end : CanvasCompareTester::TestBackends) {
auto provider = CanvasCompareTester::GetProvider(back_end);
RenderEnvironment env = RenderEnvironment::MakeN32(provider.get());
env.init_ref(kEmptySkSetup, test_params.sk_renderer(), //
kEmptyDlSetup, test_params.dl_renderer(),
test_params.imp_renderer());
CanvasCompareTester::quickCompareToReference(env, "default");
CanvasCompareTester::RenderWith(test_params, env, tolerance, case_params);
}
}
TEST_F(DisplayListRendering, SaveLayerConsolidation) {
float commutable_color_matrix[]{
// clang-format off
0, 1, 0, 0, 0,
0, 0, 1, 0, 0,
1, 0, 0, 0, 0,
0, 0, 0, 1, 0,
// clang-format on
};
float non_commutable_color_matrix[]{
// clang-format off
0, 1, 0, .1, 0,
0, 0, 1, .1, 0,
1, 0, 0, .1, 0,
0, 0, 0, .7, 0,
// clang-format on
};
SkMatrix contract_matrix;
contract_matrix.setScale(0.9f, 0.9f, kRenderCenterX, kRenderCenterY);
std::vector<SkScalar> opacities = {
0,
0.5f,
SK_Scalar1,
};
std::vector<std::shared_ptr<DlColorFilter>> color_filters = {
std::make_shared<DlBlendColorFilter>(DlColor::kCyan(),
DlBlendMode::kSrcATop),
std::make_shared<DlMatrixColorFilter>(commutable_color_matrix),
std::make_shared<DlMatrixColorFilter>(non_commutable_color_matrix),
DlSrgbToLinearGammaColorFilter::kInstance,
DlLinearToSrgbGammaColorFilter::kInstance,
};
std::vector<std::shared_ptr<DlImageFilter>> image_filters = {
std::make_shared<DlBlurImageFilter>(5.0f, 5.0f, DlTileMode::kDecal),
std::make_shared<DlDilateImageFilter>(5.0f, 5.0f),
std::make_shared<DlErodeImageFilter>(5.0f, 5.0f),
std::make_shared<DlMatrixImageFilter>(contract_matrix,
DlImageSampling::kLinear),
};
auto render_content = [](DisplayListBuilder& builder) {
builder.DrawRect(
SkRect{kRenderLeft, kRenderTop, kRenderCenterX, kRenderCenterY},
DlPaint(DlColor::kYellow()));
builder.DrawRect(
SkRect{kRenderCenterX, kRenderTop, kRenderRight, kRenderCenterY},
DlPaint(DlColor::kRed()));
builder.DrawRect(
SkRect{kRenderLeft, kRenderCenterY, kRenderCenterX, kRenderBottom},
DlPaint(DlColor::kBlue()));
builder.DrawRect(
SkRect{kRenderCenterX, kRenderCenterY, kRenderRight, kRenderBottom},
DlPaint(DlColor::kRed().modulateOpacity(0.5f)));
};
auto test_attributes_env =
[render_content](DlPaint& paint1, DlPaint& paint2,
const DlPaint& paint_both, bool same, bool rev_same,
const std::string& desc1, const std::string& desc2,
const RenderEnvironment* env) {
DisplayListBuilder nested_builder;
nested_builder.SaveLayer(&kTestBounds2, &paint1);
nested_builder.SaveLayer(&kTestBounds2, &paint2);
render_content(nested_builder);
auto nested_results = env->getResult(nested_builder.Build());
DisplayListBuilder reverse_builder;
reverse_builder.SaveLayer(&kTestBounds2, &paint2);
reverse_builder.SaveLayer(&kTestBounds2, &paint1);
render_content(reverse_builder);
auto reverse_results = env->getResult(reverse_builder.Build());
DisplayListBuilder combined_builder;
combined_builder.SaveLayer(&kTestBounds2, &paint_both);
render_content(combined_builder);
auto combined_results = env->getResult(combined_builder.Build());
// Set this boolean to true to test if combinations that are marked
// as incompatible actually are compatible despite our predictions.
// Some of the combinations that we treat as incompatible actually
// are compatible with swapping the order of the operations, but
// it would take a bit of new infrastructure to really identify
// those combinations. The only hard constraint to test here is
// when we claim that they are compatible and they aren't.
const bool always = false;
if (always || same) {
CanvasCompareTester::quickCompareToReference(
nested_results.get(), combined_results.get(), same,
"nested " + desc1 + " then " + desc2);
}
if (always || rev_same) {
CanvasCompareTester::quickCompareToReference(
reverse_results.get(), combined_results.get(), rev_same,
"nested " + desc2 + " then " + desc1);
}
};
auto test_attributes = [test_attributes_env](DlPaint& paint1, DlPaint& paint2,
const DlPaint& paint_both,
bool same, bool rev_same,
const std::string& desc1,
const std::string& desc2) {
for (auto& back_end : CanvasCompareTester::TestBackends) {
auto provider = CanvasCompareTester::GetProvider(back_end);
auto env = std::make_unique<RenderEnvironment>(
provider.get(), PixelFormat::kN32PremulPixelFormat);
test_attributes_env(paint1, paint2, paint_both, //
same, rev_same, desc1, desc2, env.get());
}
};
// CF then Opacity should always work.
// The reverse sometimes works.
for (size_t cfi = 0; cfi < color_filters.size(); cfi++) {
auto color_filter = color_filters[cfi];
std::string cf_desc = "color filter #" + std::to_string(cfi + 1);
DlPaint nested_paint1 = DlPaint().setColorFilter(color_filter);
for (size_t oi = 0; oi < opacities.size(); oi++) {
SkScalar opacity = opacities[oi];
std::string op_desc = "opacity " + std::to_string(opacity);
DlPaint nested_paint2 = DlPaint().setOpacity(opacity);
DlPaint combined_paint = nested_paint1;
combined_paint.setOpacity(opacity);
bool op_then_cf_works = opacity <= 0.0 || opacity >= 1.0 ||
color_filter->can_commute_with_opacity();
test_attributes(nested_paint1, nested_paint2, combined_paint, true,
op_then_cf_works, cf_desc, op_desc);
}
}
// Opacity then IF should always work.
// The reverse can also work for some values of opacity.
// The reverse should also theoretically work for some IFs, but we
// get some rounding errors that are more than just trivial.
for (size_t oi = 0; oi < opacities.size(); oi++) {
SkScalar opacity = opacities[oi];
std::string op_desc = "opacity " + std::to_string(opacity);
DlPaint nested_paint1 = DlPaint().setOpacity(opacity);
for (size_t ifi = 0; ifi < image_filters.size(); ifi++) {
auto image_filter = image_filters[ifi];
std::string if_desc = "image filter #" + std::to_string(ifi + 1);
DlPaint nested_paint2 = DlPaint().setImageFilter(image_filter);
DlPaint combined_paint = nested_paint1;
combined_paint.setImageFilter(image_filter);
bool if_then_op_works = opacity <= 0.0 || opacity >= 1.0;
test_attributes(nested_paint1, nested_paint2, combined_paint, true,
if_then_op_works, op_desc, if_desc);
}
}
// CF then IF should always work.
// The reverse might work, but we lack the infrastructure to check it.
for (size_t cfi = 0; cfi < color_filters.size(); cfi++) {
auto color_filter = color_filters[cfi];
std::string cf_desc = "color filter #" + std::to_string(cfi + 1);
DlPaint nested_paint1 = DlPaint().setColorFilter(color_filter);
for (size_t ifi = 0; ifi < image_filters.size(); ifi++) {
auto image_filter = image_filters[ifi];
std::string if_desc = "image filter #" + std::to_string(ifi + 1);
DlPaint nested_paint2 = DlPaint().setImageFilter(image_filter);
DlPaint combined_paint = nested_paint1;
combined_paint.setImageFilter(image_filter);
test_attributes(nested_paint1, nested_paint2, combined_paint, true, false,
cf_desc, if_desc);
}
}
}
TEST_F(DisplayListRendering, MatrixColorFilterModifyTransparencyCheck) {
auto test_matrix = [](int element, SkScalar value) {
// clang-format off
float matrix[] = {
1, 0, 0, 0, 0,
0, 1, 0, 0, 0,
0, 0, 1, 0, 0,
0, 0, 0, 1, 0,
};
// clang-format on
std::string desc =
"matrix[" + std::to_string(element) + "] = " + std::to_string(value);
float original_value = matrix[element];
matrix[element] = value;
DlMatrixColorFilter filter(matrix);
auto dl_filter = DlMatrixColorFilter::Make(matrix);
bool is_identity = (dl_filter == nullptr || original_value == value);
DlPaint paint(DlColor(0x7f7f7f7f));
DlPaint filter_save_paint = DlPaint().setColorFilter(&filter);
DisplayListBuilder builder1;
builder1.Translate(kTestCenter.fX, kTestCenter.fY);
builder1.Rotate(45);
builder1.Translate(-kTestCenter.fX, -kTestCenter.fY);
builder1.DrawRect(kRenderBounds, paint);
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
builder2.Translate(kTestCenter.fX, kTestCenter.fY);
builder2.Rotate(45);
builder2.Translate(-kTestCenter.fX, -kTestCenter.fY);
builder2.SaveLayer(&kTestBounds2, &filter_save_paint);
builder2.DrawRect(kRenderBounds, paint);
builder2.Restore();
auto display_list2 = builder2.Build();
for (auto& back_end : CanvasCompareTester::TestBackends) {
auto provider = CanvasCompareTester::GetProvider(back_end);
auto env = std::make_unique<RenderEnvironment>(
provider.get(), PixelFormat::kN32PremulPixelFormat);
auto results1 = env->getResult(display_list1);
auto results2 = env->getResult(display_list2);
CanvasCompareTester::quickCompareToReference(
results1.get(), results2.get(), is_identity,
desc + " filter affects rendering");
int modified_transparent_pixels =
CanvasCompareTester::countModifiedTransparentPixels(results1.get(),
results2.get());
EXPECT_EQ(filter.modifies_transparent_black(),
modified_transparent_pixels != 0)
<< desc;
}
};
// Tests identity (matrix[0] already == 1 in an identity filter)
test_matrix(0, 1);
// test_matrix(19, 1);
for (int i = 0; i < 20; i++) {
test_matrix(i, -0.25);
test_matrix(i, 0);
test_matrix(i, 0.25);
test_matrix(i, 1);
test_matrix(i, 1.25);
test_matrix(i, SK_ScalarNaN);
test_matrix(i, SK_ScalarInfinity);
test_matrix(i, -SK_ScalarInfinity);
}
}
TEST_F(DisplayListRendering, MatrixColorFilterOpacityCommuteCheck) {
auto test_matrix = [](int element, SkScalar value) {
// clang-format off
float matrix[] = {
1, 0, 0, 0, 0,
0, 1, 0, 0, 0,
0, 0, 1, 0, 0,
0, 0, 0, 1, 0,
};
// clang-format on
std::string desc =
"matrix[" + std::to_string(element) + "] = " + std::to_string(value);
matrix[element] = value;
auto filter = DlMatrixColorFilter::Make(matrix);
EXPECT_EQ(SkScalarIsFinite(value), filter != nullptr);
DlPaint paint(DlColor(0x80808080));
DlPaint opacity_save_paint = DlPaint().setOpacity(0.5);
DlPaint filter_save_paint = DlPaint().setColorFilter(filter);
DisplayListBuilder builder1;
builder1.SaveLayer(&kTestBounds2, &opacity_save_paint);
builder1.SaveLayer(&kTestBounds2, &filter_save_paint);
// builder1.DrawRect(kRenderBounds.makeOffset(20, 20), DlPaint());
builder1.DrawRect(kRenderBounds, paint);
builder1.Restore();
builder1.Restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
builder2.SaveLayer(&kTestBounds2, &filter_save_paint);
builder2.SaveLayer(&kTestBounds2, &opacity_save_paint);
// builder1.DrawRect(kRenderBounds.makeOffset(20, 20), DlPaint());
builder2.DrawRect(kRenderBounds, paint);
builder2.Restore();
builder2.Restore();
auto display_list2 = builder2.Build();
for (auto& back_end : CanvasCompareTester::TestBackends) {
auto provider = CanvasCompareTester::GetProvider(back_end);
auto env = std::make_unique<RenderEnvironment>(
provider.get(), PixelFormat::kN32PremulPixelFormat);
auto results1 = env->getResult(display_list1);
auto results2 = env->getResult(display_list2);
if (!filter || filter->can_commute_with_opacity()) {
CanvasCompareTester::compareToReference(
results2.get(), results1.get(), desc, nullptr, nullptr,
DlColor::kTransparent(), true, kTestWidth, kTestHeight, true);
} else {
CanvasCompareTester::quickCompareToReference(
results1.get(), results2.get(), false, desc);
}
}
};
// Tests identity (matrix[0] already == 1 in an identity filter)
test_matrix(0, 1);
// test_matrix(19, 1);
for (int i = 0; i < 20; i++) {
test_matrix(i, -0.25);
test_matrix(i, 0);
test_matrix(i, 0.25);
test_matrix(i, 1);
test_matrix(i, 1.1);
test_matrix(i, SK_ScalarNaN);
test_matrix(i, SK_ScalarInfinity);
test_matrix(i, -SK_ScalarInfinity);
}
}
#define FOR_EACH_BLEND_MODE_ENUM(FUNC) \
FUNC(kClear) \
FUNC(kSrc) \
FUNC(kDst) \
FUNC(kSrcOver) \
FUNC(kDstOver) \
FUNC(kSrcIn) \
FUNC(kDstIn) \
FUNC(kSrcOut) \
FUNC(kDstOut) \
FUNC(kSrcATop) \
FUNC(kDstATop) \
FUNC(kXor) \
FUNC(kPlus) \
FUNC(kModulate) \
FUNC(kScreen) \
FUNC(kOverlay) \
FUNC(kDarken) \
FUNC(kLighten) \
FUNC(kColorDodge) \
FUNC(kColorBurn) \
FUNC(kHardLight) \
FUNC(kSoftLight) \
FUNC(kDifference) \
FUNC(kExclusion) \
FUNC(kMultiply) \
FUNC(kHue) \
FUNC(kSaturation) \
FUNC(kColor) \
FUNC(kLuminosity)
// This function serves both to enhance error output below and to double
// check that the macro supplies all modes (otherwise it won't compile)
static std::string BlendModeToString(DlBlendMode mode) {
switch (mode) {
#define MODE_CASE(m) \
case DlBlendMode::m: \
return #m;
FOR_EACH_BLEND_MODE_ENUM(MODE_CASE)
#undef MODE_CASE
}
}
TEST_F(DisplayListRendering, BlendColorFilterModifyTransparencyCheck) {
auto test_mode_color = [](DlBlendMode mode, DlColor color) {
std::stringstream desc_str;
std::string mode_string = BlendModeToString(mode);
desc_str << "blend[" << mode_string << ", " << color << "]";
std::string desc = desc_str.str();
DlBlendColorFilter filter(color, mode);
if (filter.modifies_transparent_black()) {
ASSERT_NE(DlBlendColorFilter::Make(color, mode), nullptr) << desc;
}
DlPaint paint(DlColor(0x7f7f7f7f));
DlPaint filter_save_paint = DlPaint().setColorFilter(&filter);
DisplayListBuilder builder1;
builder1.Translate(kTestCenter.fX, kTestCenter.fY);
builder1.Rotate(45);
builder1.Translate(-kTestCenter.fX, -kTestCenter.fY);
builder1.DrawRect(kRenderBounds, paint);
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
builder2.Translate(kTestCenter.fX, kTestCenter.fY);
builder2.Rotate(45);
builder2.Translate(-kTestCenter.fX, -kTestCenter.fY);
builder2.SaveLayer(&kTestBounds2, &filter_save_paint);
builder2.DrawRect(kRenderBounds, paint);
builder2.Restore();
auto display_list2 = builder2.Build();
for (auto& back_end : CanvasCompareTester::TestBackends) {
auto provider = CanvasCompareTester::GetProvider(back_end);
auto env = std::make_unique<RenderEnvironment>(
provider.get(), PixelFormat::kN32PremulPixelFormat);
auto results1 = env->getResult(display_list1);
auto results2 = env->getResult(display_list2);
int modified_transparent_pixels =
CanvasCompareTester::countModifiedTransparentPixels(results1.get(),
results2.get());
EXPECT_EQ(filter.modifies_transparent_black(),
modified_transparent_pixels != 0)
<< desc;
}
};
auto test_mode = [&test_mode_color](DlBlendMode mode) {
test_mode_color(mode, DlColor::kTransparent());
test_mode_color(mode, DlColor::kWhite());
test_mode_color(mode, DlColor::kWhite().modulateOpacity(0.5));
test_mode_color(mode, DlColor::kBlack());
test_mode_color(mode, DlColor::kBlack().modulateOpacity(0.5));
};
#define TEST_MODE(V) test_mode(DlBlendMode::V);
FOR_EACH_BLEND_MODE_ENUM(TEST_MODE)
#undef TEST_MODE
}
TEST_F(DisplayListRendering, BlendColorFilterOpacityCommuteCheck) {
auto test_mode_color = [](DlBlendMode mode, DlColor color) {
std::stringstream desc_str;
std::string mode_string = BlendModeToString(mode);
desc_str << "blend[" << mode_string << ", " << color << "]";
std::string desc = desc_str.str();
DlBlendColorFilter filter(color, mode);
if (filter.can_commute_with_opacity()) {
// If it can commute with opacity, then it might also be a NOP,
// so we won't necessarily get a non-null return from |::Make()|
} else {
ASSERT_NE(DlBlendColorFilter::Make(color, mode), nullptr) << desc;
}
DlPaint paint(DlColor(0x80808080));
DlPaint opacity_save_paint = DlPaint().setOpacity(0.5);
DlPaint filter_save_paint = DlPaint().setColorFilter(&filter);
DisplayListBuilder builder1;
builder1.SaveLayer(&kTestBounds2, &opacity_save_paint);
builder1.SaveLayer(&kTestBounds2, &filter_save_paint);
// builder1.DrawRect(kRenderBounds.makeOffset(20, 20), DlPaint());
builder1.DrawRect(kRenderBounds, paint);
builder1.Restore();
builder1.Restore();
auto display_list1 = builder1.Build();
DisplayListBuilder builder2;
builder2.SaveLayer(&kTestBounds2, &filter_save_paint);
builder2.SaveLayer(&kTestBounds2, &opacity_save_paint);
// builder1.DrawRect(kRenderBounds.makeOffset(20, 20), DlPaint());
builder2.DrawRect(kRenderBounds, paint);
builder2.Restore();
builder2.Restore();
auto display_list2 = builder2.Build();
for (auto& back_end : CanvasCompareTester::TestBackends) {
auto provider = CanvasCompareTester::GetProvider(back_end);
auto env = std::make_unique<RenderEnvironment>(
provider.get(), PixelFormat::kN32PremulPixelFormat);
auto results1 = env->getResult(display_list1);
auto results2 = env->getResult(display_list2);
if (filter.can_commute_with_opacity()) {
CanvasCompareTester::compareToReference(
results2.get(), results1.get(), desc, nullptr, nullptr,
DlColor::kTransparent(), true, kTestWidth, kTestHeight, true);
} else {
CanvasCompareTester::quickCompareToReference(
results1.get(), results2.get(), false, desc);
}
}
};
auto test_mode = [&test_mode_color](DlBlendMode mode) {
test_mode_color(mode, DlColor::kTransparent());
test_mode_color(mode, DlColor::kWhite());
test_mode_color(mode, DlColor::kWhite().modulateOpacity(0.5));
test_mode_color(mode, DlColor::kBlack());
test_mode_color(mode, DlColor::kBlack().modulateOpacity(0.5));
};
#define TEST_MODE(V) test_mode(DlBlendMode::V);
FOR_EACH_BLEND_MODE_ENUM(TEST_MODE)
#undef TEST_MODE
}
class DisplayListNopTest : public DisplayListRendering {
// The following code uses the acronym MTB for "modifies_transparent_black"
protected:
DisplayListNopTest() : DisplayListRendering() {
test_src_colors = {
DlColor::kBlack().withAlpha(0), // transparent black
DlColor::kBlack().withAlpha(0x7f), // half transparent black
DlColor::kWhite().withAlpha(0x7f), // half transparent white
DlColor::kBlack(), // opaque black
DlColor::kWhite(), // opaque white
DlColor::kRed(), // opaque red
DlColor::kGreen(), // opaque green
DlColor::kBlue(), // opaque blue
DlColor::kDarkGrey(), // dark grey
DlColor::kLightGrey(), // light grey
};
// We test against a color cube of 3x3x3 colors [55,aa,ff]
// plus transparency as the first color/pixel
test_dst_colors.push_back(DlColor::kTransparent());
const int step = 0x55;
static_assert(step * 3 == 255);
for (int a = step; a < 256; a += step) {
for (int r = step; r < 256; r += step) {
for (int g = step; g < 256; g += step) {
for (int b = step; b < 256; b += step) {
test_dst_colors.push_back(DlColor(a << 24 | r << 16 | g << 8 | b));
}
}
}
}
static constexpr float color_filter_matrix_nomtb[] = {
0.0001, 0.0001, 0.0001, 0.9997, 0.0, //
0.0001, 0.0001, 0.0001, 0.9997, 0.0, //
0.0001, 0.0001, 0.0001, 0.9997, 0.0, //
0.0001, 0.0001, 0.0001, 0.9997, 0.0, //
};
static constexpr float color_filter_matrix_mtb[] = {
0.0001, 0.0001, 0.0001, 0.9997, 0.0, //
0.0001, 0.0001, 0.0001, 0.9997, 0.0, //
0.0001, 0.0001, 0.0001, 0.9997, 0.0, //
0.0001, 0.0001, 0.0001, 0.9997, 0.1, //
};
color_filter_nomtb = DlMatrixColorFilter::Make(color_filter_matrix_nomtb);
color_filter_mtb = DlMatrixColorFilter::Make(color_filter_matrix_mtb);
EXPECT_FALSE(color_filter_nomtb->modifies_transparent_black());
EXPECT_TRUE(color_filter_mtb->modifies_transparent_black());
test_data =
get_output(test_dst_colors.size(), 1, true, [this](SkCanvas* canvas) {
int x = 0;
for (DlColor color : test_dst_colors) {
SkPaint paint;
paint.setColor(ToSk(color));
paint.setBlendMode(SkBlendMode::kSrc);
canvas->drawRect(SkRect::MakeXYWH(x, 0, 1, 1), paint);
x++;
}
});
// For image-on-image tests, the src and dest images will have repeated
// rows/columns that have every color, but laid out at right angles to
// each other so we see an interaction with every test color against
// every other test color.
int data_count = test_data->image()->width();
test_image_dst_data = get_output(
data_count, data_count, true, [this, data_count](SkCanvas* canvas) {
ASSERT_EQ(test_data->width(), data_count);
ASSERT_EQ(test_data->height(), 1);
for (int y = 0; y < data_count; y++) {
canvas->drawImage(test_data->image().get(), 0, y);
}
});
test_image_src_data = get_output(
data_count, data_count, true, [this, data_count](SkCanvas* canvas) {
ASSERT_EQ(test_data->width(), data_count);
ASSERT_EQ(test_data->height(), 1);
canvas->translate(data_count, 0);
canvas->rotate(90);
for (int y = 0; y < data_count; y++) {
canvas->drawImage(test_data->image().get(), 0, y);
}
});
// Double check that the pixel data is laid out in orthogonal stripes
for (int y = 0; y < data_count; y++) {
for (int x = 0; x < data_count; x++) {
EXPECT_EQ(*test_image_dst_data->addr32(x, y), *test_data->addr32(x, 0));
EXPECT_EQ(*test_image_src_data->addr32(x, y), *test_data->addr32(y, 0));
}
}
}
// These flags are 0 by default until they encounter a counter-example
// result and get set.
static constexpr int kWasNotNop = 0x1; // Some tested pixel was modified
static constexpr int kWasMTB = 0x2; // A transparent pixel was modified
std::vector<DlColor> test_src_colors;
std::vector<DlColor> test_dst_colors;
std::shared_ptr<DlColorFilter> color_filter_nomtb;
std::shared_ptr<DlColorFilter> color_filter_mtb;
// A 1-row image containing every color in test_dst_colors
std::unique_ptr<RenderResult> test_data;
// A square image containing test_data duplicated in each row
std::unique_ptr<RenderResult> test_image_dst_data;
// A square image containing test_data duplicated in each column
std::unique_ptr<RenderResult> test_image_src_data;
std::unique_ptr<RenderResult> get_output(
int w,
int h,
bool snapshot,
const std::function<void(SkCanvas*)>& renderer) {
auto surface = SkSurfaces::Raster(SkImageInfo::MakeN32Premul(w, h));
SkCanvas* canvas = surface->getCanvas();
renderer(canvas);
return std::make_unique<SkRenderResult>(surface, snapshot);
}
int check_color_result(DlColor dst_color,
DlColor result_color,
const sk_sp<DisplayList>& dl,
const std::string& desc) {
int ret = 0;
bool is_error = false;
if (dst_color.isTransparent() && !result_color.isTransparent()) {
ret |= kWasMTB;
is_error = !dl->modifies_transparent_black();
}
if (result_color != dst_color) {
ret |= kWasNotNop;
is_error = (dl->op_count() == 0u);
}
if (is_error) {
FML_LOG(ERROR) << std::hex << dst_color << " filters to " << result_color
<< desc;
}
return ret;
}
int check_image_result(const std::unique_ptr<RenderResult>& dst_data,
const std::unique_ptr<RenderResult>& result_data,
const sk_sp<DisplayList>& dl,
const std::string& desc) {
EXPECT_EQ(dst_data->width(), result_data->width());
EXPECT_EQ(dst_data->height(), result_data->height());
int all_flags = 0;
for (int y = 0; y < dst_data->height(); y++) {
const uint32_t* dst_pixels = dst_data->addr32(0, y);
const uint32_t* result_pixels = result_data->addr32(0, y);
for (int x = 0; x < dst_data->width(); x++) {
all_flags |= check_color_result(DlColor(dst_pixels[x]),
DlColor(result_pixels[x]), dl, desc);
}
}
return all_flags;
}
void report_results(int all_flags,
const sk_sp<DisplayList>& dl,
const std::string& desc) {
if (!dl->modifies_transparent_black()) {
EXPECT_TRUE((all_flags & kWasMTB) == 0);
} else if ((all_flags & kWasMTB) == 0) {
FML_LOG(INFO) << "combination does not affect transparency: " << desc;
}
if (dl->op_count() == 0u) {
EXPECT_TRUE((all_flags & kWasNotNop) == 0);
} else if ((all_flags & kWasNotNop) == 0) {
FML_LOG(INFO) << "combination could be classified as a nop: " << desc;
}
};
void test_mode_color_via_filter(DlBlendMode mode, DlColor color) {
std::stringstream desc_stream;
desc_stream << " using SkColorFilter::filterColor() with: ";
desc_stream << BlendModeToString(mode);
desc_stream << "/" << color;
std::string desc = desc_stream.str();
DisplayListBuilder builder({0.0f, 0.0f, 100.0f, 100.0f});
DlPaint paint = DlPaint(color).setBlendMode(mode);
builder.DrawRect({0.0f, 0.0f, 10.0f, 10.0f}, paint);
auto dl = builder.Build();
if (dl->modifies_transparent_black()) {
ASSERT_TRUE(dl->op_count() != 0u);
}
auto sk_mode = static_cast<SkBlendMode>(mode);
auto sk_color_filter = SkColorFilters::Blend(ToSk(color), sk_mode);
auto srgb = SkColorSpace::MakeSRGB();
int all_flags = 0;
if (sk_color_filter) {
for (DlColor dst_color : test_dst_colors) {
SkColor4f dst_color_f = SkColor4f::FromColor(ToSk(dst_color));
DlColor result = DlColor(
sk_color_filter->filterColor4f(dst_color_f, srgb.get(), srgb.get())
.toSkColor());
all_flags |= check_color_result(dst_color, result, dl, desc);
}
if ((all_flags & kWasMTB) != 0) {
EXPECT_FALSE(sk_color_filter->isAlphaUnchanged());
}
}
report_results(all_flags, dl, desc);
};
void test_mode_color_via_rendering(DlBlendMode mode, DlColor color) {
std::stringstream desc_stream;
desc_stream << " rendering with: ";
desc_stream << BlendModeToString(mode);
desc_stream << "/" << color;
std::string desc = desc_stream.str();
auto test_image = test_data->image();
SkRect test_bounds =
SkRect::MakeWH(test_image->width(), test_image->height());
DisplayListBuilder builder(test_bounds);
DlPaint dl_paint = DlPaint(color).setBlendMode(mode);
builder.DrawRect(test_bounds, dl_paint);
auto dl = builder.Build();
bool dl_is_elided = dl->op_count() == 0u;
bool dl_affects_transparent_pixels = dl->modifies_transparent_black();
ASSERT_TRUE(!dl_is_elided || !dl_affects_transparent_pixels);
auto sk_mode = static_cast<SkBlendMode>(mode);
SkPaint sk_paint;
sk_paint.setBlendMode(sk_mode);
sk_paint.setColor(ToSk(color));
for (auto& back_end : CanvasCompareTester::TestBackends) {
auto provider = CanvasCompareTester::GetProvider(back_end);
auto result_surface = provider->MakeOffscreenSurface(
test_image->width(), test_image->height(),
DlSurfaceProvider::kN32PremulPixelFormat);
SkCanvas* result_canvas = result_surface->sk_surface()->getCanvas();
result_canvas->clear(SK_ColorTRANSPARENT);
result_canvas->drawImage(test_image.get(), 0, 0);
result_canvas->drawRect(test_bounds, sk_paint);
if (GrDirectContext* direct_context = GrAsDirectContext(
result_surface->sk_surface()->recordingContext())) {
direct_context->flushAndSubmit();
direct_context->flushAndSubmit(result_surface->sk_surface().get(),
GrSyncCpu::kYes);
}
const std::unique_ptr<RenderResult> result_pixels =
std::make_unique<SkRenderResult>(result_surface->sk_surface());
int all_flags = check_image_result(test_data, result_pixels, dl, desc);
report_results(all_flags, dl, desc);
}
};
void test_attributes_image(DlBlendMode mode,
DlColor color,
DlColorFilter* color_filter,
DlImageFilter* image_filter) {
// if (true) { return; }
std::stringstream desc_stream;
desc_stream << " rendering with: ";
desc_stream << BlendModeToString(mode);
desc_stream << "/" << color;
std::string cf_mtb = color_filter
? color_filter->modifies_transparent_black()
? "modifies transparency"
: "preserves transparency"
: "no filter";
desc_stream << ", CF: " << cf_mtb;
std::string if_mtb = image_filter
? image_filter->modifies_transparent_black()
? "modifies transparency"
: "preserves transparency"
: "no filter";
desc_stream << ", IF: " << if_mtb;
std::string desc = desc_stream.str();
DisplayListBuilder builder({0.0f, 0.0f, 100.0f, 100.0f});
DlPaint paint = DlPaint(color) //
.setBlendMode(mode) //
.setColorFilter(color_filter) //
.setImageFilter(image_filter);
builder.DrawImage(DlImage::Make(test_image_src_data->image()), {0, 0},
DlImageSampling::kNearestNeighbor, &paint);
auto dl = builder.Build();
int w = test_image_src_data->width();
int h = test_image_src_data->height();
auto sk_mode = static_cast<SkBlendMode>(mode);
SkPaint sk_paint;
sk_paint.setBlendMode(sk_mode);
sk_paint.setColor(ToSk(color));
sk_paint.setColorFilter(ToSk(color_filter));
sk_paint.setImageFilter(ToSk(image_filter));
for (auto& back_end : CanvasCompareTester::TestBackends) {
auto provider = CanvasCompareTester::GetProvider(back_end);
auto result_surface = provider->MakeOffscreenSurface(
w, h, DlSurfaceProvider::kN32PremulPixelFormat);
SkCanvas* result_canvas = result_surface->sk_surface()->getCanvas();
result_canvas->clear(SK_ColorTRANSPARENT);
result_canvas->drawImage(test_image_dst_data->image(), 0, 0);
result_canvas->drawImage(test_image_src_data->image(), 0, 0,
SkSamplingOptions(), &sk_paint);
if (GrDirectContext* direct_context = GrAsDirectContext(
result_surface->sk_surface()->recordingContext())) {
direct_context->flushAndSubmit();
direct_context->flushAndSubmit(result_surface->sk_surface().get(),
GrSyncCpu::kYes);
}
std::unique_ptr<RenderResult> result_pixels =
std::make_unique<SkRenderResult>(result_surface->sk_surface());
int all_flags =
check_image_result(test_image_dst_data, result_pixels, dl, desc);
report_results(all_flags, dl, desc);
}
};
};
TEST_F(DisplayListNopTest, BlendModeAndColorViaColorFilter) {
auto test_mode_filter = [this](DlBlendMode mode) {
for (DlColor color : test_src_colors) {
test_mode_color_via_filter(mode, color);
}
};
#define TEST_MODE(V) test_mode_filter(DlBlendMode::V);
FOR_EACH_BLEND_MODE_ENUM(TEST_MODE)
#undef TEST_MODE
}
TEST_F(DisplayListNopTest, BlendModeAndColorByRendering) {
auto test_mode_render = [this](DlBlendMode mode) {
// First check rendering a variety of colors onto image
for (DlColor color : test_src_colors) {
test_mode_color_via_rendering(mode, color);
}
};
#define TEST_MODE(V) test_mode_render(DlBlendMode::V);
FOR_EACH_BLEND_MODE_ENUM(TEST_MODE)
#undef TEST_MODE
}
TEST_F(DisplayListNopTest, BlendModeAndColorAndFiltersByRendering) {
auto test_mode_render = [this](DlBlendMode mode) {
auto image_filter_nomtb = DlColorFilterImageFilter(color_filter_nomtb);
auto image_filter_mtb = DlColorFilterImageFilter(color_filter_mtb);
for (DlColor color : test_src_colors) {
test_attributes_image(mode, color, nullptr, nullptr);
test_attributes_image(mode, color, color_filter_nomtb.get(), nullptr);
test_attributes_image(mode, color, color_filter_mtb.get(), nullptr);
test_attributes_image(mode, color, nullptr, &image_filter_nomtb);
test_attributes_image(mode, color, nullptr, &image_filter_mtb);
}
};
#define TEST_MODE(V) test_mode_render(DlBlendMode::V);
FOR_EACH_BLEND_MODE_ENUM(TEST_MODE)
#undef TEST_MODE
}
#undef FOR_EACH_BLEND_MODE_ENUM
} // namespace testing
} // namespace flutter
| engine/display_list/testing/dl_rendering_unittests.cc/0 | {
"file_path": "engine/display_list/testing/dl_rendering_unittests.cc",
"repo_id": "engine",
"token_count": 91351
} | 208 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_DISPLAY_LIST_UTILS_DL_MATRIX_CLIP_TRACKER_H_
#define FLUTTER_DISPLAY_LIST_UTILS_DL_MATRIX_CLIP_TRACKER_H_
#include <vector>
#include "flutter/display_list/dl_canvas.h"
#include "flutter/fml/logging.h"
#include "third_party/skia/include/core/SkM44.h"
#include "third_party/skia/include/core/SkMatrix.h"
#include "third_party/skia/include/core/SkPath.h"
#include "third_party/skia/include/core/SkRRect.h"
#include "third_party/skia/include/core/SkRect.h"
#include "third_party/skia/include/core/SkScalar.h"
namespace flutter {
class DisplayListMatrixClipTracker {
private:
using ClipOp = DlCanvas::ClipOp;
public:
DisplayListMatrixClipTracker(const SkRect& cull_rect, const SkMatrix& matrix);
DisplayListMatrixClipTracker(const SkRect& cull_rect, const SkM44& matrix);
// This method should almost never be used as it breaks the encapsulation
// of the enclosing clips. However it is needed for practical purposes in
// some rare cases - such as when a saveLayer is collecting rendering
// operations prior to applying a filter on the entire layer bounds and
// some of those operations fall outside the enclosing clip, but their
// filtered content will spread out from where they were rendered on the
// layer into the enclosing clipped area.
// Omitting the |cull_rect| argument, or passing nullptr, will restore the
// cull rect to the initial value it had when the tracker was constructed.
void resetCullRect(const SkRect* cull_rect = nullptr) {
current_->resetBounds(cull_rect ? *cull_rect : original_cull_rect_);
}
static bool is_3x3(const SkM44& m44);
SkRect base_device_cull_rect() const { return saved_[0]->device_cull_rect(); }
bool using_4x4_matrix() const { return current_->is_4x4(); }
SkM44 matrix_4x4() const { return current_->matrix_4x4(); }
SkMatrix matrix_3x3() const { return current_->matrix_3x3(); }
SkRect local_cull_rect() const { return current_->local_cull_rect(); }
SkRect device_cull_rect() const { return current_->device_cull_rect(); }
bool content_culled(const SkRect& content_bounds) const {
return current_->content_culled(content_bounds);
}
bool is_cull_rect_empty() const { return current_->is_cull_rect_empty(); }
void save();
void restore();
void reset();
int getSaveCount() {
// saved_[0] is always the untouched initial conditions
// saved_[1] is the first editable stack entry
return saved_.size() - 1;
}
void restoreToCount(int restore_count);
void translate(SkScalar tx, SkScalar ty) { current_->translate(tx, ty); }
void scale(SkScalar sx, SkScalar sy) { current_->scale(sx, sy); }
void skew(SkScalar skx, SkScalar sky) { current_->skew(skx, sky); }
void rotate(SkScalar degrees) { current_->rotate(degrees); }
void transform(const SkM44& m44);
void transform(const SkMatrix& matrix) { current_->transform(matrix); }
// clang-format off
void transform2DAffine(
SkScalar mxx, SkScalar mxy, SkScalar mxt,
SkScalar myx, SkScalar myy, SkScalar myt);
void transformFullPerspective(
SkScalar mxx, SkScalar mxy, SkScalar mxz, SkScalar mxt,
SkScalar myx, SkScalar myy, SkScalar myz, SkScalar myt,
SkScalar mzx, SkScalar mzy, SkScalar mzz, SkScalar mzt,
SkScalar mwx, SkScalar mwy, SkScalar mwz, SkScalar mwt);
// clang-format on
void setTransform(const SkMatrix& matrix) { current_->setTransform(matrix); }
void setTransform(const SkM44& m44);
void setIdentity() { current_->setIdentity(); }
// If the matrix in |other_tracker| is invertible then transform this
// tracker by the inverse of its matrix and return true. Otherwise,
// return false and leave this tracker unmodified.
bool inverseTransform(const DisplayListMatrixClipTracker& other_tracker);
bool mapRect(SkRect* rect) const { return current_->mapRect(*rect, rect); }
bool mapRect(const SkRect& src, SkRect* mapped) {
return current_->mapRect(src, mapped);
}
void clipRect(const SkRect& rect, ClipOp op, bool is_aa) {
current_->clipBounds(rect, op, is_aa);
}
void clipRRect(const SkRRect& rrect, ClipOp op, bool is_aa);
void clipPath(const SkPath& path, ClipOp op, bool is_aa);
private:
class Data {
public:
virtual ~Data() = default;
virtual bool is_4x4() const = 0;
virtual SkMatrix matrix_3x3() const = 0;
virtual SkM44 matrix_4x4() const = 0;
SkRect device_cull_rect() const { return cull_rect_; }
virtual SkRect local_cull_rect() const = 0;
virtual bool content_culled(const SkRect& content_bounds) const;
bool is_cull_rect_empty() const { return cull_rect_.isEmpty(); }
virtual void translate(SkScalar tx, SkScalar ty) = 0;
virtual void scale(SkScalar sx, SkScalar sy) = 0;
virtual void skew(SkScalar skx, SkScalar sky) = 0;
virtual void rotate(SkScalar degrees) = 0;
virtual void transform(const SkMatrix& matrix) = 0;
virtual void transform(const SkM44& m44) = 0;
virtual void setTransform(const SkMatrix& matrix) = 0;
virtual void setTransform(const SkM44& m44) = 0;
virtual void setIdentity() = 0;
virtual bool mapRect(const SkRect& rect, SkRect* mapped) const = 0;
virtual bool canBeInverted() const = 0;
virtual void clipBounds(const SkRect& clip, ClipOp op, bool is_aa);
virtual void resetBounds(const SkRect& cull_rect);
protected:
explicit Data(const SkRect& rect) : cull_rect_(rect) {}
virtual bool has_perspective() const = 0;
SkRect cull_rect_;
};
friend class Data3x3;
friend class Data4x4;
SkRect original_cull_rect_;
Data* current_;
std::vector<std::unique_ptr<Data>> saved_;
};
} // namespace flutter
#endif // FLUTTER_DISPLAY_LIST_UTILS_DL_MATRIX_CLIP_TRACKER_H_
| engine/display_list/utils/dl_matrix_clip_tracker.h/0 | {
"file_path": "engine/display_list/utils/dl_matrix_clip_tracker.h",
"repo_id": "engine",
"token_count": 2094
} | 209 |
# Flutter Embedder Engine GLFW Example
## Description
This is an example of how to use Flutter Engine Embedder in order to get a
Flutter project rendering in a new host environment. The intended audience is
people who need to support host environment other than the ones already provided
by Flutter. This is an advanced topic and not intended for beginners.
In this example we are demonstrating rendering a Flutter project inside of the GUI
library [GLFW](https://www.glfw.org/). For more information about using the
embedder you can read the wiki article [Custom Flutter Engine Embedders](https://github.com/flutter/flutter/wiki/Custom-Flutter-Engine-Embedders).
## Running Instructions
The following example was tested on MacOSX but with a bit of tweaking should be
able to run on other *nix platforms and Windows.
The example has the following dependencies:
* [GLFW](https://www.glfw.org/) - This can be installed with [Homebrew](https://brew.sh/) - `brew install glfw`
* [CMake](https://cmake.org/) - This can be installed with [Homebrew](https://brew.sh/) - `brew install cmake`
* [Flutter](https://flutter.dev/) - This can be installed from the [Flutter webpage](https://flutter.dev/docs/get-started/install)
* [Flutter Engine](https://flutter.dev) - This can be built or downloaded, see [Custom Flutter Engine Embedders](https://github.com/flutter/flutter/wiki/Custom-Flutter-Engine-Embedders) for more information.
In order to **build** and **run** the example you should be able to go into this directory and run
`./run.sh`.
## Troubleshooting
There are a few things you might have to tweak in order to get your build working:
* Flutter Engine Location - Inside the `CMakeList.txt` file you will see that it is set up to search for the header and library for the Flutter Engine in specific locations, those might not be the location of your Flutter Engine.
* Pixel Ratio - If the project runs but is drawing at the wrong scale you may have to tweak the `kPixelRatio` variable in `FlutterEmbedderGLFW.cc` file.
* GLFW Location - Inside the `CMakeLists.txt` we are searching for the GLFW library, if CMake can't find it you may have to edit that.
| engine/examples/glfw/README.md/0 | {
"file_path": "engine/examples/glfw/README.md",
"repo_id": "engine",
"token_count": 578
} | 210 |
Flow
====
Flow is a simple compositor based on Skia that the Flutter engine uses to cache
recorded paint commands and pixels generated from those recordings. Flow runs on
the raster thread and uploads information to Skia.
| engine/flow/README.md/0 | {
"file_path": "engine/flow/README.md",
"repo_id": "engine",
"token_count": 51
} | 211 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/flow/layer_snapshot_store.h"
#include "flutter/fml/time/time_delta.h"
#include "flutter/fml/time/time_point.h"
namespace flutter {
LayerSnapshotData::LayerSnapshotData(int64_t layer_unique_id,
const fml::TimeDelta& duration,
const sk_sp<SkData>& snapshot,
const SkRect& bounds)
: layer_unique_id_(layer_unique_id),
duration_(duration),
snapshot_(snapshot),
bounds_(bounds) {}
void LayerSnapshotStore::Clear() {
layer_snapshots_.clear();
}
void LayerSnapshotStore::Add(const LayerSnapshotData& data) {
layer_snapshots_.push_back(data);
}
} // namespace flutter
| engine/flow/layer_snapshot_store.cc/0 | {
"file_path": "engine/flow/layer_snapshot_store.cc",
"repo_id": "engine",
"token_count": 376
} | 212 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/flow/layers/clip_rrect_layer.h"
#include "flutter/flow/layers/layer_tree.h"
#include "flutter/flow/layers/opacity_layer.h"
#include "flutter/flow/layers/platform_view_layer.h"
#include "flutter/flow/testing/layer_test.h"
#include "flutter/flow/testing/mock_embedder.h"
#include "flutter/flow/testing/mock_layer.h"
#include "flutter/fml/macros.h"
// TODO(zanderso): https://github.com/flutter/flutter/issues/127701
// NOLINTBEGIN(bugprone-unchecked-optional-access)
namespace flutter {
namespace testing {
using ClipRRectLayerTest = LayerTest;
using ClipOp = DlCanvas::ClipOp;
#ifndef NDEBUG
TEST_F(ClipRRectLayerTest, ClipNoneBehaviorDies) {
const SkRRect layer_rrect = SkRRect::MakeEmpty();
EXPECT_DEATH_IF_SUPPORTED(
auto clip = std::make_shared<ClipRRectLayer>(layer_rrect, Clip::kNone),
"clip_behavior != Clip::kNone");
}
TEST_F(ClipRRectLayerTest, PaintingEmptyLayerDies) {
const SkRRect layer_rrect = SkRRect::MakeEmpty();
auto layer = std::make_shared<ClipRRectLayer>(layer_rrect, Clip::kHardEdge);
layer->Preroll(preroll_context());
// Untouched
EXPECT_EQ(preroll_context()->state_stack.device_cull_rect(), kGiantRect);
EXPECT_TRUE(preroll_context()->state_stack.is_empty());
EXPECT_EQ(layer->paint_bounds(), kEmptyRect);
EXPECT_EQ(layer->child_paint_bounds(), kEmptyRect);
EXPECT_FALSE(layer->needs_painting(paint_context()));
EXPECT_DEATH_IF_SUPPORTED(layer->Paint(paint_context()),
"needs_painting\\(context\\)");
}
TEST_F(ClipRRectLayerTest, PaintBeforePrerollDies) {
const SkRect layer_bounds = SkRect::MakeXYWH(0.5, 1.0, 5.0, 6.0);
const SkRRect layer_rrect = SkRRect::MakeRect(layer_bounds);
auto layer = std::make_shared<ClipRRectLayer>(layer_rrect, Clip::kHardEdge);
EXPECT_EQ(layer->paint_bounds(), kEmptyRect);
EXPECT_EQ(layer->child_paint_bounds(), kEmptyRect);
EXPECT_FALSE(layer->needs_painting(paint_context()));
EXPECT_DEATH_IF_SUPPORTED(layer->Paint(paint_context()),
"needs_painting\\(context\\)");
}
TEST_F(ClipRRectLayerTest, PaintingCulledLayerDies) {
const SkMatrix initial_matrix = SkMatrix::Translate(0.5f, 1.0f);
const SkRect child_bounds = SkRect::MakeXYWH(1.0, 2.0, 2.0, 2.0);
const SkRect layer_bounds = SkRect::MakeXYWH(0.5, 1.0, 5.0, 6.0);
const SkRect distant_bounds = SkRect::MakeXYWH(100.0, 100.0, 10.0, 10.0);
const SkPath child_path = SkPath().addRect(child_bounds);
const SkRRect layer_rrect = SkRRect::MakeRect(layer_bounds);
const DlPaint child_paint = DlPaint(DlColor::kYellow());
auto mock_layer = std::make_shared<MockLayer>(child_path, child_paint);
auto layer = std::make_shared<ClipRRectLayer>(layer_rrect, Clip::kHardEdge);
layer->Add(mock_layer);
// Cull these children
preroll_context()->state_stack.set_preroll_delegate(distant_bounds,
initial_matrix);
layer->Preroll(preroll_context());
// Untouched
EXPECT_EQ(preroll_context()->state_stack.device_cull_rect(), distant_bounds);
EXPECT_TRUE(preroll_context()->state_stack.is_empty());
EXPECT_EQ(mock_layer->paint_bounds(), child_bounds);
EXPECT_EQ(layer->paint_bounds(), child_bounds);
EXPECT_EQ(layer->child_paint_bounds(), child_bounds);
EXPECT_TRUE(mock_layer->needs_painting(paint_context()));
EXPECT_TRUE(layer->needs_painting(paint_context()));
EXPECT_EQ(mock_layer->parent_cull_rect(), kEmptyRect);
EXPECT_EQ(mock_layer->parent_matrix(), initial_matrix);
EXPECT_EQ(mock_layer->parent_mutators(), std::vector({Mutator(layer_rrect)}));
auto mutator = paint_context().state_stack.save();
mutator.clipRect(distant_bounds, false);
EXPECT_FALSE(mock_layer->needs_painting(paint_context()));
EXPECT_FALSE(layer->needs_painting(paint_context()));
EXPECT_DEATH_IF_SUPPORTED(layer->Paint(paint_context()),
"needs_painting\\(context\\)");
}
#endif
TEST_F(ClipRRectLayerTest, ChildOutsideBounds) {
const SkMatrix initial_matrix = SkMatrix::Translate(0.5f, 1.0f);
const SkRect local_cull_bounds = SkRect::MakeXYWH(0.0, 0.0, 2.0, 4.0);
const SkRect device_cull_bounds = initial_matrix.mapRect(local_cull_bounds);
const SkRect child_bounds = SkRect::MakeXYWH(2.5, 5.0, 4.5, 4.0);
const SkRect clip_bounds = SkRect::MakeXYWH(0.5, 1.0, 5.0, 6.0);
const SkPath child_path = SkPath().addRect(child_bounds);
const SkRRect clip_rrect = SkRRect::MakeRect(clip_bounds);
const DlPaint child_paint = DlPaint(DlColor::kYellow());
auto mock_layer = std::make_shared<MockLayer>(child_path, child_paint);
auto layer = std::make_shared<ClipRRectLayer>(clip_rrect, Clip::kHardEdge);
layer->Add(mock_layer);
SkRect clip_cull_rect = clip_bounds;
ASSERT_TRUE(clip_cull_rect.intersect(local_cull_bounds));
SkRect clip_layer_bounds = child_bounds;
ASSERT_TRUE(clip_layer_bounds.intersect(clip_bounds));
// Set up both contexts to cull clipped child
preroll_context()->state_stack.set_preroll_delegate(device_cull_bounds,
initial_matrix);
paint_context().canvas->ClipRect(device_cull_bounds);
paint_context().canvas->Transform(initial_matrix);
layer->Preroll(preroll_context());
// Untouched
EXPECT_EQ(preroll_context()->state_stack.device_cull_rect(),
device_cull_bounds);
EXPECT_EQ(preroll_context()->state_stack.local_cull_rect(),
local_cull_bounds);
EXPECT_TRUE(preroll_context()->state_stack.is_empty());
EXPECT_EQ(mock_layer->paint_bounds(), child_bounds);
EXPECT_EQ(layer->paint_bounds(), clip_layer_bounds);
EXPECT_EQ(layer->child_paint_bounds(), child_bounds);
EXPECT_EQ(mock_layer->parent_cull_rect(), clip_cull_rect);
EXPECT_EQ(mock_layer->parent_matrix(), initial_matrix);
EXPECT_EQ(mock_layer->parent_mutators(), std::vector({Mutator(clip_rrect)}));
EXPECT_FALSE(mock_layer->needs_painting(paint_context()));
ASSERT_FALSE(layer->needs_painting(paint_context()));
// Top level layer not visible so calling layer->Paint()
// would trip an FML_DCHECK
}
TEST_F(ClipRRectLayerTest, FullyContainedChild) {
const SkMatrix initial_matrix = SkMatrix::Translate(0.5f, 1.0f);
const SkRect child_bounds = SkRect::MakeXYWH(1.0, 2.0, 2.0, 2.0);
const SkRect layer_bounds = SkRect::MakeXYWH(0.5, 1.0, 5.0, 6.0);
const SkPath child_path =
SkPath().addRect(child_bounds).addOval(child_bounds.makeInset(0.1, 0.1));
const SkRRect layer_rrect = SkRRect::MakeRectXY(layer_bounds, 0.1, 0.1);
const DlPaint child_paint = DlPaint(DlColor::kYellow());
auto mock_layer = std::make_shared<MockLayer>(child_path, child_paint);
auto layer = std::make_shared<ClipRRectLayer>(layer_rrect, Clip::kHardEdge);
layer->Add(mock_layer);
preroll_context()->state_stack.set_preroll_delegate(initial_matrix);
layer->Preroll(preroll_context());
// Untouched
EXPECT_EQ(preroll_context()->state_stack.device_cull_rect(), kGiantRect);
EXPECT_TRUE(preroll_context()->state_stack.is_empty());
EXPECT_EQ(mock_layer->paint_bounds(), child_bounds);
EXPECT_EQ(layer->paint_bounds(), mock_layer->paint_bounds());
EXPECT_EQ(layer->child_paint_bounds(), child_bounds);
EXPECT_TRUE(mock_layer->needs_painting(paint_context()));
EXPECT_TRUE(layer->needs_painting(paint_context()));
EXPECT_EQ(mock_layer->parent_cull_rect(), layer_bounds);
EXPECT_EQ(mock_layer->parent_matrix(), initial_matrix);
EXPECT_EQ(mock_layer->parent_mutators(), std::vector({Mutator(layer_rrect)}));
layer->Paint(display_list_paint_context());
DisplayListBuilder expected_builder;
/* (ClipRRect)layer::Paint */ {
expected_builder.Save();
{
expected_builder.ClipRRect(layer_rrect);
/* mock_layer::Paint */ {
expected_builder.DrawPath(child_path, child_paint);
}
}
expected_builder.Restore();
}
EXPECT_TRUE(DisplayListsEQ_Verbose(display_list(), expected_builder.Build()));
}
TEST_F(ClipRRectLayerTest, PartiallyContainedChild) {
const SkMatrix initial_matrix = SkMatrix::Translate(0.5f, 1.0f);
const SkRect local_cull_bounds = SkRect::MakeXYWH(0.0, 0.0, 4.0, 5.5);
const SkRect device_cull_bounds = initial_matrix.mapRect(local_cull_bounds);
const SkRect child_bounds = SkRect::MakeXYWH(2.5, 5.0, 4.5, 4.0);
const SkRect clip_bounds = SkRect::MakeXYWH(0.5, 1.0, 5.0, 6.0);
const SkPath child_path =
SkPath().addRect(child_bounds).addOval(child_bounds.makeInset(0.1, 0.1));
const SkRRect clip_rrect = SkRRect::MakeRectXY(clip_bounds, 0.1, 0.1);
const DlPaint child_paint = DlPaint(DlColor::kYellow());
auto mock_layer = std::make_shared<MockLayer>(child_path, child_paint);
auto layer = std::make_shared<ClipRRectLayer>(clip_rrect, Clip::kHardEdge);
layer->Add(mock_layer);
SkRect clip_cull_rect = clip_bounds;
ASSERT_TRUE(clip_cull_rect.intersect(local_cull_bounds));
SkRect clip_layer_bounds = child_bounds;
ASSERT_TRUE(clip_layer_bounds.intersect(clip_bounds));
preroll_context()->state_stack.set_preroll_delegate(device_cull_bounds,
initial_matrix);
layer->Preroll(preroll_context());
// Untouched
EXPECT_EQ(preroll_context()->state_stack.device_cull_rect(),
device_cull_bounds);
EXPECT_EQ(preroll_context()->state_stack.local_cull_rect(),
local_cull_bounds);
EXPECT_TRUE(preroll_context()->state_stack.is_empty());
EXPECT_EQ(mock_layer->paint_bounds(), child_bounds);
EXPECT_EQ(layer->paint_bounds(), clip_layer_bounds);
EXPECT_EQ(layer->child_paint_bounds(), child_bounds);
EXPECT_EQ(mock_layer->parent_cull_rect(), clip_cull_rect);
EXPECT_EQ(mock_layer->parent_matrix(), initial_matrix);
EXPECT_EQ(mock_layer->parent_mutators(), std::vector({Mutator(clip_rrect)}));
layer->Paint(display_list_paint_context());
DisplayListBuilder expected_builder;
/* (ClipRRect)layer::Paint */ {
expected_builder.Save();
{
expected_builder.ClipRRect(clip_rrect);
/* mock_layer::Paint */ {
expected_builder.DrawPath(child_path, child_paint);
}
}
expected_builder.Restore();
}
EXPECT_TRUE(DisplayListsEQ_Verbose(display_list(), expected_builder.Build()));
}
static bool ReadbackResult(PrerollContext* context,
Clip clip_behavior,
const std::shared_ptr<Layer>& child,
bool before) {
const SkRect layer_bounds = SkRect::MakeXYWH(0.5, 1.0, 5.0, 6.0);
const SkRRect layer_rrect = SkRRect::MakeRect(layer_bounds);
auto layer = std::make_shared<ClipRRectLayer>(layer_rrect, clip_behavior);
if (child != nullptr) {
layer->Add(child);
}
context->surface_needs_readback = before;
layer->Preroll(context);
return context->surface_needs_readback;
}
TEST_F(ClipRRectLayerTest, Readback) {
PrerollContext* context = preroll_context();
SkPath path;
DlPaint paint;
const Clip hard = Clip::kHardEdge;
const Clip soft = Clip::kAntiAlias;
const Clip save_layer = Clip::kAntiAliasWithSaveLayer;
std::shared_ptr<MockLayer> nochild;
auto reader = std::make_shared<MockLayer>(path, paint);
reader->set_fake_reads_surface(true);
auto nonreader = std::make_shared<MockLayer>(path, paint);
// No children, no prior readback -> no readback after
EXPECT_FALSE(ReadbackResult(context, hard, nochild, false));
EXPECT_FALSE(ReadbackResult(context, soft, nochild, false));
EXPECT_FALSE(ReadbackResult(context, save_layer, nochild, false));
// No children, prior readback -> readback after
EXPECT_TRUE(ReadbackResult(context, hard, nochild, true));
EXPECT_TRUE(ReadbackResult(context, soft, nochild, true));
EXPECT_TRUE(ReadbackResult(context, save_layer, nochild, true));
// Non readback child, no prior readback -> no readback after
EXPECT_FALSE(ReadbackResult(context, hard, nonreader, false));
EXPECT_FALSE(ReadbackResult(context, soft, nonreader, false));
EXPECT_FALSE(ReadbackResult(context, save_layer, nonreader, false));
// Non readback child, prior readback -> readback after
EXPECT_TRUE(ReadbackResult(context, hard, nonreader, true));
EXPECT_TRUE(ReadbackResult(context, soft, nonreader, true));
EXPECT_TRUE(ReadbackResult(context, save_layer, nonreader, true));
// Readback child, no prior readback -> readback after unless SaveLayer
EXPECT_TRUE(ReadbackResult(context, hard, reader, false));
EXPECT_TRUE(ReadbackResult(context, soft, reader, false));
EXPECT_FALSE(ReadbackResult(context, save_layer, reader, false));
// Readback child, prior readback -> readback after
EXPECT_TRUE(ReadbackResult(context, hard, reader, true));
EXPECT_TRUE(ReadbackResult(context, soft, reader, true));
EXPECT_TRUE(ReadbackResult(context, save_layer, reader, true));
}
TEST_F(ClipRRectLayerTest, OpacityInheritance) {
auto path1 = SkPath().addRect({10, 10, 30, 30});
auto mock1 = MockLayer::MakeOpacityCompatible(path1);
SkRect clip_rect = SkRect::MakeWH(500, 500);
SkRRect clip_rrect = SkRRect::MakeRectXY(clip_rect, 20, 20);
auto clip_rrect_layer =
std::make_shared<ClipRRectLayer>(clip_rrect, Clip::kHardEdge);
clip_rrect_layer->Add(mock1);
// ClipRectLayer will pass through compatibility from a compatible child
PrerollContext* context = preroll_context();
clip_rrect_layer->Preroll(context);
EXPECT_EQ(context->renderable_state_flags,
LayerStateStack::kCallerCanApplyOpacity);
auto path2 = SkPath().addRect({40, 40, 50, 50});
auto mock2 = MockLayer::MakeOpacityCompatible(path2);
clip_rrect_layer->Add(mock2);
// ClipRectLayer will pass through compatibility from multiple
// non-overlapping compatible children
clip_rrect_layer->Preroll(context);
EXPECT_EQ(context->renderable_state_flags,
LayerStateStack::kCallerCanApplyOpacity);
auto path3 = SkPath().addRect({20, 20, 40, 40});
auto mock3 = MockLayer::MakeOpacityCompatible(path3);
clip_rrect_layer->Add(mock3);
// ClipRectLayer will not pass through compatibility from multiple
// overlapping children even if they are individually compatible
clip_rrect_layer->Preroll(context);
EXPECT_EQ(context->renderable_state_flags, 0);
{
// ClipRectLayer(aa with saveLayer) will always be compatible
auto clip_rrect_savelayer = std::make_shared<ClipRRectLayer>(
clip_rrect, Clip::kAntiAliasWithSaveLayer);
clip_rrect_savelayer->Add(mock1);
clip_rrect_savelayer->Add(mock2);
// Double check first two children are compatible and non-overlapping
clip_rrect_savelayer->Preroll(context);
EXPECT_EQ(context->renderable_state_flags, Layer::kSaveLayerRenderFlags);
// Now add the overlapping child and test again, should still be compatible
clip_rrect_savelayer->Add(mock3);
clip_rrect_savelayer->Preroll(context);
EXPECT_EQ(context->renderable_state_flags, Layer::kSaveLayerRenderFlags);
}
// An incompatible, but non-overlapping child for the following tests
auto path4 = SkPath().addRect({60, 60, 70, 70});
auto mock4 = MockLayer::Make(path4);
{
// ClipRectLayer with incompatible child will not be compatible
auto clip_rrect_bad_child =
std::make_shared<ClipRRectLayer>(clip_rrect, Clip::kHardEdge);
clip_rrect_bad_child->Add(mock1);
clip_rrect_bad_child->Add(mock2);
// Double check first two children are compatible and non-overlapping
clip_rrect_bad_child->Preroll(context);
EXPECT_EQ(context->renderable_state_flags,
LayerStateStack::kCallerCanApplyOpacity);
clip_rrect_bad_child->Add(mock4);
// The third child is non-overlapping, but not compatible so the
// TransformLayer should end up incompatible
clip_rrect_bad_child->Preroll(context);
EXPECT_EQ(context->renderable_state_flags, 0);
}
{
// ClipRectLayer(aa with saveLayer) will always be compatible
auto clip_rrect_savelayer_bad_child = std::make_shared<ClipRRectLayer>(
clip_rrect, Clip::kAntiAliasWithSaveLayer);
clip_rrect_savelayer_bad_child->Add(mock1);
clip_rrect_savelayer_bad_child->Add(mock2);
// Double check first two children are compatible and non-overlapping
clip_rrect_savelayer_bad_child->Preroll(context);
EXPECT_EQ(context->renderable_state_flags, Layer::kSaveLayerRenderFlags);
// Now add the incompatible child and test again, should still be compatible
clip_rrect_savelayer_bad_child->Add(mock4);
clip_rrect_savelayer_bad_child->Preroll(context);
EXPECT_EQ(context->renderable_state_flags, Layer::kSaveLayerRenderFlags);
}
}
TEST_F(ClipRRectLayerTest, OpacityInheritancePainting) {
auto path1 = SkPath().addRect({10, 10, 30, 30});
auto mock1 = MockLayer::MakeOpacityCompatible(path1);
auto path2 = SkPath().addRect({40, 40, 50, 50});
auto mock2 = MockLayer::MakeOpacityCompatible(path2);
SkRect clip_rect = SkRect::MakeWH(500, 500);
SkRRect clip_rrect = SkRRect::MakeRectXY(clip_rect, 20, 20);
auto clip_rect_layer =
std::make_shared<ClipRRectLayer>(clip_rrect, Clip::kAntiAlias);
clip_rect_layer->Add(mock1);
clip_rect_layer->Add(mock2);
// ClipRectLayer will pass through compatibility from multiple
// non-overlapping compatible children
PrerollContext* context = preroll_context();
clip_rect_layer->Preroll(context);
EXPECT_EQ(context->renderable_state_flags,
LayerStateStack::kCallerCanApplyOpacity);
int opacity_alpha = 0x7F;
SkPoint offset = SkPoint::Make(10, 10);
auto opacity_layer = std::make_shared<OpacityLayer>(opacity_alpha, offset);
opacity_layer->Add(clip_rect_layer);
opacity_layer->Preroll(context);
EXPECT_TRUE(opacity_layer->children_can_accept_opacity());
DisplayListBuilder expected_builder;
/* OpacityLayer::Paint() */ {
expected_builder.Save();
{
expected_builder.Translate(offset.fX, offset.fY);
/* ClipRectLayer::Paint() */ {
expected_builder.Save();
expected_builder.ClipRRect(clip_rrect, ClipOp::kIntersect, true);
/* child layer1 paint */ {
expected_builder.DrawPath(path1, DlPaint().setAlpha(opacity_alpha));
}
/* child layer2 paint */ {
expected_builder.DrawPath(path2, DlPaint().setAlpha(opacity_alpha));
}
expected_builder.Restore();
}
}
expected_builder.Restore();
}
opacity_layer->Paint(display_list_paint_context());
EXPECT_TRUE(DisplayListsEQ_Verbose(expected_builder.Build(), display_list()));
}
TEST_F(ClipRRectLayerTest, OpacityInheritanceSaveLayerPainting) {
auto path1 = SkPath().addRect({10, 10, 30, 30});
auto mock1 = MockLayer::MakeOpacityCompatible(path1);
auto path2 = SkPath().addRect({20, 20, 40, 40});
auto mock2 = MockLayer::MakeOpacityCompatible(path2);
auto children_bounds = path1.getBounds();
children_bounds.join(path2.getBounds());
SkRect clip_rect = SkRect::MakeWH(500, 500);
SkRRect clip_rrect = SkRRect::MakeRectXY(clip_rect, 20, 20);
auto clip_rrect_layer = std::make_shared<ClipRRectLayer>(
clip_rrect, Clip::kAntiAliasWithSaveLayer);
clip_rrect_layer->Add(mock1);
clip_rrect_layer->Add(mock2);
// ClipRectLayer will pass through compatibility from multiple
// non-overlapping compatible children
PrerollContext* context = preroll_context();
clip_rrect_layer->Preroll(context);
EXPECT_EQ(context->renderable_state_flags, Layer::kSaveLayerRenderFlags);
int opacity_alpha = 0x7F;
SkPoint offset = SkPoint::Make(10, 10);
auto opacity_layer = std::make_shared<OpacityLayer>(opacity_alpha, offset);
opacity_layer->Add(clip_rrect_layer);
opacity_layer->Preroll(context);
EXPECT_TRUE(opacity_layer->children_can_accept_opacity());
DisplayListBuilder expected_builder;
/* OpacityLayer::Paint() */ {
expected_builder.Save();
{
expected_builder.Translate(offset.fX, offset.fY);
/* ClipRectLayer::Paint() */ {
expected_builder.Save();
expected_builder.ClipRRect(clip_rrect, ClipOp::kIntersect, true);
expected_builder.SaveLayer(&children_bounds,
&DlPaint().setAlpha(opacity_alpha));
/* child layer1 paint */ {
expected_builder.DrawPath(path1, DlPaint());
}
/* child layer2 paint */ { //
expected_builder.DrawPath(path2, DlPaint());
}
expected_builder.Restore();
}
}
expected_builder.Restore();
}
opacity_layer->Paint(display_list_paint_context());
EXPECT_TRUE(DisplayListsEQ_Verbose(expected_builder.Build(), display_list()));
}
TEST_F(ClipRRectLayerTest, LayerCached) {
auto path1 = SkPath().addRect({10, 10, 30, 30});
DlPaint paint = DlPaint();
auto mock1 = MockLayer::MakeOpacityCompatible(path1);
SkRect clip_rect = SkRect::MakeWH(500, 500);
SkRRect clip_rrect = SkRRect::MakeRectXY(clip_rect, 20, 20);
auto layer = std::make_shared<ClipRRectLayer>(clip_rrect,
Clip::kAntiAliasWithSaveLayer);
layer->Add(mock1);
auto initial_transform = SkMatrix::Translate(50.0, 25.5);
SkMatrix cache_ctm = initial_transform;
DisplayListBuilder cache_canvas;
cache_canvas.Transform(cache_ctm);
use_mock_raster_cache();
preroll_context()->state_stack.set_preroll_delegate(initial_transform);
const auto* clip_cache_item = layer->raster_cache_item();
layer->Preroll(preroll_context());
LayerTree::TryToRasterCache(cacheable_items(), &paint_context());
EXPECT_EQ(raster_cache()->GetLayerCachedEntriesCount(), (size_t)0);
EXPECT_EQ(clip_cache_item->cache_state(), RasterCacheItem::CacheState::kNone);
layer->Preroll(preroll_context());
LayerTree::TryToRasterCache(cacheable_items(), &paint_context());
EXPECT_EQ(raster_cache()->GetLayerCachedEntriesCount(), (size_t)0);
EXPECT_EQ(clip_cache_item->cache_state(), RasterCacheItem::CacheState::kNone);
layer->Preroll(preroll_context());
LayerTree::TryToRasterCache(cacheable_items(), &paint_context());
EXPECT_EQ(raster_cache()->GetLayerCachedEntriesCount(), (size_t)1);
EXPECT_EQ(clip_cache_item->cache_state(),
RasterCacheItem::CacheState::kCurrent);
EXPECT_TRUE(raster_cache()->Draw(clip_cache_item->GetId().value(),
cache_canvas, &paint));
}
TEST_F(ClipRRectLayerTest, NoSaveLayerShouldNotCache) {
auto path1 = SkPath().addRect({10, 10, 30, 30});
auto mock1 = MockLayer::MakeOpacityCompatible(path1);
SkRect clip_rect = SkRect::MakeWH(500, 500);
SkRRect clip_rrect = SkRRect::MakeRectXY(clip_rect, 20, 20);
auto layer = std::make_shared<ClipRRectLayer>(clip_rrect, Clip::kAntiAlias);
layer->Add(mock1);
auto initial_transform = SkMatrix::Translate(50.0, 25.5);
SkMatrix cache_ctm = initial_transform;
SkCanvas cache_canvas;
cache_canvas.setMatrix(cache_ctm);
use_mock_raster_cache();
preroll_context()->state_stack.set_preroll_delegate(initial_transform);
const auto* clip_cache_item = layer->raster_cache_item();
layer->Preroll(preroll_context());
LayerTree::TryToRasterCache(cacheable_items(), &paint_context());
EXPECT_EQ(raster_cache()->GetLayerCachedEntriesCount(), (size_t)0);
EXPECT_EQ(clip_cache_item->cache_state(), RasterCacheItem::CacheState::kNone);
layer->Preroll(preroll_context());
LayerTree::TryToRasterCache(cacheable_items(), &paint_context());
EXPECT_EQ(raster_cache()->GetLayerCachedEntriesCount(), (size_t)0);
EXPECT_EQ(clip_cache_item->cache_state(), RasterCacheItem::CacheState::kNone);
layer->Preroll(preroll_context());
LayerTree::TryToRasterCache(cacheable_items(), &paint_context());
EXPECT_EQ(raster_cache()->GetLayerCachedEntriesCount(), (size_t)0);
EXPECT_EQ(clip_cache_item->cache_state(), RasterCacheItem::CacheState::kNone);
}
TEST_F(ClipRRectLayerTest, EmptyClipDoesNotCullPlatformView) {
const SkPoint view_offset = SkPoint::Make(0.0f, 0.0f);
const SkSize view_size = SkSize::Make(8.0f, 8.0f);
const int64_t view_id = 42;
auto platform_view =
std::make_shared<PlatformViewLayer>(view_offset, view_size, view_id);
SkRRect clip_rrect = SkRRect::MakeRectXY(kEmptyRect, 20, 20);
auto clip = std::make_shared<ClipRRectLayer>(clip_rrect, Clip::kAntiAlias);
clip->Add(platform_view);
auto embedder = MockViewEmbedder();
DisplayListBuilder fake_overlay_builder;
embedder.AddCanvas(&fake_overlay_builder);
preroll_context()->view_embedder = &embedder;
paint_context().view_embedder = &embedder;
clip->Preroll(preroll_context());
EXPECT_EQ(embedder.prerolled_views(), std::vector<int64_t>({view_id}));
clip->Paint(paint_context());
EXPECT_EQ(embedder.painted_views(), std::vector<int64_t>({view_id}));
}
} // namespace testing
} // namespace flutter
// NOLINTEND(bugprone-unchecked-optional-access)
| engine/flow/layers/clip_rrect_layer_unittests.cc/0 | {
"file_path": "engine/flow/layers/clip_rrect_layer_unittests.cc",
"repo_id": "engine",
"token_count": 9582
} | 213 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/flow/layers/layer.h"
#include "flutter/flow/paint_utils.h"
namespace flutter {
Layer::Layer()
: paint_bounds_(SkRect::MakeEmpty()),
unique_id_(NextUniqueID()),
original_layer_id_(unique_id_) {}
Layer::~Layer() = default;
uint64_t Layer::NextUniqueID() {
static std::atomic<uint64_t> next_id(1);
uint64_t id;
do {
id = next_id.fetch_add(1);
} while (id == 0); // 0 is reserved for an invalid id.
return id;
}
Layer::AutoPrerollSaveLayerState::AutoPrerollSaveLayerState(
PrerollContext* preroll_context,
bool save_layer_is_active,
bool layer_itself_performs_readback)
: preroll_context_(preroll_context),
save_layer_is_active_(save_layer_is_active),
layer_itself_performs_readback_(layer_itself_performs_readback) {
if (save_layer_is_active_) {
prev_surface_needs_readback_ = preroll_context_->surface_needs_readback;
preroll_context_->surface_needs_readback = false;
}
}
Layer::AutoPrerollSaveLayerState Layer::AutoPrerollSaveLayerState::Create(
PrerollContext* preroll_context,
bool save_layer_is_active,
bool layer_itself_performs_readback) {
return Layer::AutoPrerollSaveLayerState(preroll_context, save_layer_is_active,
layer_itself_performs_readback);
}
Layer::AutoPrerollSaveLayerState::~AutoPrerollSaveLayerState() {
if (save_layer_is_active_) {
preroll_context_->surface_needs_readback =
(prev_surface_needs_readback_ || layer_itself_performs_readback_);
}
}
} // namespace flutter
| engine/flow/layers/layer.cc/0 | {
"file_path": "engine/flow/layers/layer.cc",
"repo_id": "engine",
"token_count": 664
} | 214 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/flow/layers/performance_overlay_layer.h"
#include <iomanip>
#include <iostream>
#include <memory>
#include <string>
#include "flow/stopwatch.h"
#include "flow/stopwatch_dl.h"
#include "flow/stopwatch_sk.h"
#include "third_party/skia/include/core/SkFont.h"
#include "third_party/skia/include/core/SkFontMgr.h"
#include "third_party/skia/include/core/SkTextBlob.h"
#include "third_party/skia/include/core/SkTypeface.h"
#include "txt/platform.h"
#ifdef IMPELLER_SUPPORTS_RENDERING
#include "impeller/typographer/backends/skia/text_frame_skia.h" // nogncheck
#endif // IMPELLER_SUPPORTS_RENDERING
namespace flutter {
namespace {
void VisualizeStopWatch(DlCanvas* canvas,
const bool impeller_enabled,
const Stopwatch& stopwatch,
SkScalar x,
SkScalar y,
SkScalar width,
SkScalar height,
bool show_graph,
bool show_labels,
const std::string& label_prefix,
const std::string& font_path) {
const int label_x = 8; // distance from x
const int label_y = -10; // distance from y+height
if (show_graph) {
SkRect visualization_rect = SkRect::MakeXYWH(x, y, width, height);
std::unique_ptr<StopwatchVisualizer> visualizer;
if (impeller_enabled) {
visualizer = std::make_unique<DlStopwatchVisualizer>(stopwatch);
} else {
visualizer = std::make_unique<SkStopwatchVisualizer>(stopwatch);
}
visualizer->Visualize(canvas, visualization_rect);
}
if (show_labels) {
auto text = PerformanceOverlayLayer::MakeStatisticsText(
stopwatch, label_prefix, font_path);
// Historically SK_ColorGRAY (== 0xFF888888) was used here
DlPaint paint(DlColor(0xFF888888));
#ifdef IMPELLER_SUPPORTS_RENDERING
if (impeller_enabled) {
canvas->DrawTextFrame(impeller::MakeTextFrameFromTextBlobSkia(text),
x + label_x, y + height + label_y, paint);
return;
}
#endif // IMPELLER_SUPPORTS_RENDERING
canvas->DrawTextBlob(text, x + label_x, y + height + label_y, paint);
}
}
} // namespace
sk_sp<SkTextBlob> PerformanceOverlayLayer::MakeStatisticsText(
const Stopwatch& stopwatch,
const std::string& label_prefix,
const std::string& font_path) {
SkFont font;
sk_sp<SkFontMgr> font_mgr = txt::GetDefaultFontManager();
if (font_path == "") {
if (sk_sp<SkTypeface> face = font_mgr->matchFamilyStyle(nullptr, {})) {
font = SkFont(face, 15);
} else {
// In Skia's Android fontmgr, matchFamilyStyle can return null instead
// of falling back to a default typeface. If that's the case, we can use
// legacyMakeTypeface, which *does* use that default typeface.
font = SkFont(font_mgr->legacyMakeTypeface(nullptr, {}), 15);
}
} else {
font = SkFont(font_mgr->makeFromFile(font_path.c_str()), 15);
}
// Make sure there's not an empty typeface returned, or we won't see any text.
FML_DCHECK(font.getTypeface()->countGlyphs() > 0);
double max_ms_per_frame = stopwatch.MaxDelta().ToMillisecondsF();
double average_ms_per_frame = stopwatch.AverageDelta().ToMillisecondsF();
std::stringstream stream;
stream.setf(std::ios::fixed | std::ios::showpoint);
stream << std::setprecision(1);
stream << label_prefix << " " << "max " << max_ms_per_frame << " ms/frame, "
<< "avg " << average_ms_per_frame << " ms/frame";
auto text = stream.str();
return SkTextBlob::MakeFromText(text.c_str(), text.size(), font,
SkTextEncoding::kUTF8);
}
PerformanceOverlayLayer::PerformanceOverlayLayer(uint64_t options,
const char* font_path)
: options_(options) {
if (font_path != nullptr) {
font_path_ = font_path;
}
}
void PerformanceOverlayLayer::Diff(DiffContext* context,
const Layer* old_layer) {
DiffContext::AutoSubtreeRestore subtree(context);
if (!context->IsSubtreeDirty()) {
FML_DCHECK(old_layer);
auto prev = old_layer->as_performance_overlay_layer();
context->MarkSubtreeDirty(context->GetOldLayerPaintRegion(prev));
}
context->AddLayerBounds(paint_bounds());
context->SetLayerPaintRegion(this, context->CurrentSubtreeRegion());
}
void PerformanceOverlayLayer::Paint(PaintContext& context) const {
const int padding = 8;
if (!options_) {
return;
}
SkScalar x = paint_bounds().x() + padding;
SkScalar y = paint_bounds().y() + padding;
SkScalar width = paint_bounds().width() - (padding * 2);
SkScalar height = paint_bounds().height() / 2;
auto mutator = context.state_stack.save();
VisualizeStopWatch(
context.canvas, context.impeller_enabled, context.raster_time, x, y,
width, height - padding, options_ & kVisualizeRasterizerStatistics,
options_ & kDisplayRasterizerStatistics, "Raster", font_path_);
VisualizeStopWatch(context.canvas, context.impeller_enabled, context.ui_time,
x, y + height, width, height - padding,
options_ & kVisualizeEngineStatistics,
options_ & kDisplayEngineStatistics, "UI", font_path_);
}
} // namespace flutter
| engine/flow/layers/performance_overlay_layer.cc/0 | {
"file_path": "engine/flow/layers/performance_overlay_layer.cc",
"repo_id": "engine",
"token_count": 2273
} | 215 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/flow/paint_region.h"
namespace flutter {
SkRect PaintRegion::ComputeBounds() const {
SkRect res = SkRect::MakeEmpty();
for (const auto& r : *this) {
res.join(r);
}
return res;
}
} // namespace flutter
| engine/flow/paint_region.cc/0 | {
"file_path": "engine/flow/paint_region.cc",
"repo_id": "engine",
"token_count": 132
} | 216 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/flow/stopwatch_dl.h"
#include <memory>
#include <vector>
#include "display_list/dl_blend_mode.h"
#include "display_list/dl_canvas.h"
#include "display_list/dl_color.h"
#include "display_list/dl_paint.h"
#include "display_list/dl_vertices.h"
#include "include/core/SkRect.h"
namespace flutter {
static const size_t kMaxSamples = 120;
static const size_t kMaxFrameMarkers = 8;
void DlStopwatchVisualizer::Visualize(DlCanvas* canvas,
const SkRect& rect) const {
auto painter = DlVertexPainter();
DlPaint paint;
// Establish the graph position.
auto const x = rect.x();
auto const y = rect.y();
auto const width = rect.width();
auto const height = rect.height();
auto const bottom = rect.bottom();
// Scale the graph to show time frames up to those that are 3x the frame time.
auto const one_frame_ms = GetFrameBudget().count();
auto const max_interval = one_frame_ms * 3.0;
auto const max_unit_interval = UnitFrameInterval(max_interval);
auto const sample_unit_width = (1.0 / kMaxSamples);
// Provide a semi-transparent background for the graph.
painter.DrawRect(rect, DlColor(0x99FFFFFF));
// Prepare a path for the data; we start at the height of the last point so
// it looks like we wrap around.
{
for (auto i = size_t(0); i < stopwatch_.GetLapsCount(); i++) {
auto const sample_unit_height =
(1.0 - UnitHeight(stopwatch_.GetLap(i).ToMillisecondsF(),
max_unit_interval));
auto const bar_width = width * sample_unit_width;
auto const bar_height = height * sample_unit_height;
auto const bar_left = x + width * sample_unit_width * i;
painter.DrawRect(SkRect::MakeLTRB(/*l=*/bar_left,
/*t=*/y + bar_height,
/*r=*/bar_left + bar_width,
/*b=*/bottom),
DlColor(0xAA0000FF));
}
}
// Draw horizontal frame markers.
{
if (max_interval > one_frame_ms) {
// Paint the horizontal markers.
auto count = static_cast<size_t>(max_interval / one_frame_ms);
// Limit the number of markers to a reasonable amount.
if (count > kMaxFrameMarkers) {
count = 1;
}
for (auto i = size_t(0); i < count; i++) {
auto const frame_height =
height * (1.0 - (UnitFrameInterval(i + 1) * one_frame_ms) /
max_unit_interval);
// Draw a skinny rectangle (i.e. a line).
painter.DrawRect(SkRect::MakeLTRB(/*l=*/x,
/*t=*/y + frame_height,
/*r=*/width,
/*b=*/y + frame_height + 1),
DlColor(0xCC000000));
}
}
}
// Paint the vertical marker for the current frame.
{
DlColor color = DlColor::kGreen();
if (UnitFrameInterval(stopwatch_.LastLap().ToMillisecondsF()) > 1.0) {
// budget exceeded.
color = DlColor::kRed();
}
auto const l =
x + width * (static_cast<double>(stopwatch_.GetCurrentSample()) /
kMaxSamples);
auto const t = y;
auto const r = l + width * sample_unit_width;
auto const b = rect.bottom();
painter.DrawRect(SkRect::MakeLTRB(l, t, r, b), color);
}
// Actually draw.
// Use kSrcOver blend mode so that elements under the performance overlay are
// partially visible.
paint.setBlendMode(DlBlendMode::kSrcOver);
// The second blend mode does nothing since the paint has no additional color
// sources like a tiled image or gradient.
canvas->DrawVertices(painter.IntoVertices(), DlBlendMode::kSrcOver, paint);
}
void DlVertexPainter::DrawRect(const SkRect& rect, const DlColor& color) {
// Draw 6 vertices representing 2 triangles.
auto const left = rect.x();
auto const top = rect.y();
auto const right = rect.right();
auto const bottom = rect.bottom();
auto const vertices = std::array<SkPoint, 6>{
SkPoint::Make(left, top), // tl tr
SkPoint::Make(right, top), // br
SkPoint::Make(right, bottom), //
SkPoint::Make(right, bottom), // tl
SkPoint::Make(left, bottom), // bl br
SkPoint::Make(left, top) //
};
auto const colors = std::array<DlColor, 6>{
color, // tl tr
color, // br
color, //
color, // tl
color, // bl br
color //
};
vertices_.insert(vertices_.end(), vertices.begin(), vertices.end());
colors_.insert(colors_.end(), colors.begin(), colors.end());
}
std::shared_ptr<DlVertices> DlVertexPainter::IntoVertices() {
auto const result = DlVertices::Make(
/*mode=*/DlVertexMode::kTriangles,
/*vertex_count=*/vertices_.size(),
/*vertices=*/vertices_.data(),
/*texture_coordinates=*/nullptr,
/*colors=*/colors_.data());
vertices_.clear();
colors_.clear();
return result;
}
} // namespace flutter
| engine/flow/stopwatch_dl.cc/0 | {
"file_path": "engine/flow/stopwatch_dl.cc",
"repo_id": "engine",
"token_count": 2222
} | 217 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/flow/testing/mock_embedder.h"
namespace flutter {
namespace testing {
MockViewEmbedder::MockViewEmbedder() = default;
MockViewEmbedder::~MockViewEmbedder() = default;
void MockViewEmbedder::AddCanvas(DlCanvas* canvas) {
contexts_.emplace_back(canvas);
}
// |ExternalViewEmbedder|
DlCanvas* MockViewEmbedder::GetRootCanvas() {
return nullptr;
}
// |ExternalViewEmbedder|
void MockViewEmbedder::CancelFrame() {}
// |ExternalViewEmbedder|
void MockViewEmbedder::BeginFrame(
GrDirectContext* context,
const fml::RefPtr<fml::RasterThreadMerger>& raster_thread_merger) {}
// |ExternalViewEmbedder|
void MockViewEmbedder::PrepareFlutterView(int64_t flutter_view_id,
SkISize frame_size,
double device_pixel_ratio) {}
// |ExternalViewEmbedder|
void MockViewEmbedder::PrerollCompositeEmbeddedView(
int64_t view_id,
std::unique_ptr<EmbeddedViewParams> params) {
prerolled_views_.emplace_back(view_id);
}
// |ExternalViewEmbedder|
DlCanvas* MockViewEmbedder::CompositeEmbeddedView(int64_t view_id) {
painted_views_.emplace_back(view_id);
DlCanvas* canvas = contexts_.front();
contexts_.pop_front();
return canvas;
}
} // namespace testing
} // namespace flutter
| engine/flow/testing/mock_embedder.cc/0 | {
"file_path": "engine/flow/testing/mock_embedder.cc",
"repo_id": "engine",
"token_count": 572
} | 218 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:convert';
import 'dart:ui';
void main() {
final Paint paint = Paint()..color = Color(0xFFFFFFFF);
print(jsonEncode(<String, String>{
'Paint.toString': paint.toString(),
'Brightness.toString': Brightness.dark.toString(),
'Foo.toString': Foo().toString(),
'Keep.toString': Keep().toString(),
}));
}
class Foo {
@override
String toString() => 'I am a Foo';
}
class Keep {
@keepToString
@override
String toString() => 'I am a Keep';
}
| engine/flutter_frontend_server/test/fixtures/lib/main.dart/0 | {
"file_path": "engine/flutter_frontend_server/test/fixtures/lib/main.dart",
"repo_id": "engine",
"token_count": 225
} | 219 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/fml/base32.h"
#include <cstdint> // uint8_t
#include <limits>
#include <string>
namespace fml {
static constexpr char kEncoding[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
std::pair<bool, std::string> Base32Encode(std::string_view input) {
if (input.empty()) {
return {true, ""};
}
if (input.size() > std::numeric_limits<size_t>::max() / 8) {
return {false, ""};
}
std::string output;
const size_t encoded_length = (input.size() * 8 + 4) / 5;
output.reserve(encoded_length);
Base32EncodeConverter converter;
converter.Append(static_cast<uint8_t>(input[0]));
size_t next_byte_index = 1;
while (converter.CanExtract()) {
output.push_back(kEncoding[converter.Extract()]);
if (converter.CanAppend() && next_byte_index < input.size()) {
converter.Append(static_cast<uint8_t>(input[next_byte_index++]));
}
}
if (converter.BitsAvailable() > 0) {
output.push_back(kEncoding[converter.Peek()]);
}
return {true, output};
}
static constexpr signed char kDecodeMap[] = {
// starting from ASCII 50 '2'
26, 27, 28, 29, 30, 31, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25};
static constexpr int kDecodeMapSize =
sizeof(kDecodeMap) / sizeof(kDecodeMap[0]);
std::pair<bool, std::string> Base32Decode(const std::string& input) {
std::string result;
Base32DecodeConverter converter;
for (char c : input) {
int map_index = c - '2';
if (map_index < 0 || map_index >= kDecodeMapSize ||
kDecodeMap[map_index] == -1) {
return {false, result};
}
converter.Append(kDecodeMap[map_index]);
if (converter.CanExtract()) {
result.push_back(converter.Extract());
}
}
if (converter.Peek() != 0) {
// The padding should always be zero. Return false if not.
return {false, result};
}
return {true, result};
}
} // namespace fml
| engine/fml/base32.cc/0 | {
"file_path": "engine/fml/base32.cc",
"repo_id": "engine",
"token_count": 868
} | 220 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FML_CPU_AFFINITY_H_
#define FLUTTER_FML_CPU_AFFINITY_H_
#include <optional>
#include <string>
#include <vector>
namespace fml {
/// The CPU Affinity provides a hint to the operating system on which cores a
/// particular thread should be scheduled on. The operating system may or may
/// not honor these requests.
enum class CpuAffinity {
/// @brief Request CPU affinity for the performance cores.
///
/// Generally speaking, only the UI and Raster thread should
/// use this option.
kPerformance,
/// @brief Request CPU affinity for the efficiency cores.
kEfficiency,
/// @brief Request affinity for all non-performance cores.
kNotPerformance,
};
/// @brief Request count of efficiency cores.
///
/// Efficiency cores are defined as those with the lowest reported
/// cpu_max_freq. If the CPU speed could not be determined, or if all
/// cores have the same reported speed then this returns std::nullopt.
/// That is, the result will never be 0.
std::optional<size_t> EfficiencyCoreCount();
/// @brief Request the given affinity for the current thread.
///
/// Returns true if successfull, or if it was a no-op. This function is
/// only supported on Android devices.
///
/// Affinity requests are based on documented CPU speed. This speed data
/// is parsed from cpuinfo_max_freq files, see also:
/// https://www.kernel.org/doc/Documentation/cpu-freq/user-guide.txt
bool RequestAffinity(CpuAffinity affinity);
struct CpuIndexAndSpeed {
// The index of the given CPU.
size_t index;
// CPU speed in kHZ
int64_t speed;
};
/// @brief A class that computes the correct CPU indices for a requested CPU
/// affinity.
///
/// @note This is visible for testing.
class CPUSpeedTracker {
public:
explicit CPUSpeedTracker(std::vector<CpuIndexAndSpeed> data);
/// @brief The class is valid if it has more than one CPU index and a distinct
/// set of efficiency or performance CPUs.
///
/// If all CPUs are the same speed this returns false, and all requests
/// to set affinity are ignored.
bool IsValid() const;
/// @brief Return the set of CPU indices for the requested CPU affinity.
///
/// If the tracker is valid, this will always return a non-empty set.
const std::vector<size_t>& GetIndices(CpuAffinity affinity) const;
private:
bool valid_ = false;
std::vector<CpuIndexAndSpeed> cpu_speeds_;
std::vector<size_t> efficiency_;
std::vector<size_t> performance_;
std::vector<size_t> not_performance_;
};
/// @note Visible for testing.
std::optional<int64_t> ReadIntFromFile(const std::string& path);
} // namespace fml
#endif // FLUTTER_FML_CPU_AFFINITY_H_
| engine/fml/cpu_affinity.h/0 | {
"file_path": "engine/fml/cpu_affinity.h",
"repo_id": "engine",
"token_count": 932
} | 221 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/fml/icu_util.h"
#include <memory>
#include <mutex>
#include "flutter/fml/build_config.h"
#include "flutter/fml/logging.h"
#include "flutter/fml/mapping.h"
#include "flutter/fml/native_library.h"
#include "flutter/fml/paths.h"
#include "third_party/icu/source/common/unicode/udata.h"
namespace fml {
namespace icu {
class ICUContext {
public:
explicit ICUContext(const std::string& icu_data_path) : valid_(false) {
valid_ = SetupMapping(icu_data_path) && SetupICU();
}
explicit ICUContext(std::unique_ptr<Mapping> mapping)
: mapping_(std::move(mapping)) {
valid_ = SetupICU();
}
~ICUContext() = default;
bool SetupMapping(const std::string& icu_data_path) {
// Check if the path exists and it readable directly.
auto fd =
fml::OpenFile(icu_data_path.c_str(), false, fml::FilePermission::kRead);
// Check the path relative to the current executable.
if (!fd.is_valid()) {
auto directory = fml::paths::GetExecutableDirectoryPath();
if (!directory.first) {
return false;
}
std::string path_relative_to_executable =
paths::JoinPaths({directory.second, icu_data_path});
fd = fml::OpenFile(path_relative_to_executable.c_str(), false,
fml::FilePermission::kRead);
}
if (!fd.is_valid()) {
return false;
}
std::initializer_list<FileMapping::Protection> protection = {
fml::FileMapping::Protection::kRead};
auto file_mapping = std::make_unique<FileMapping>(fd, protection);
if (file_mapping->GetSize() != 0) {
mapping_ = std::move(file_mapping);
return true;
}
return false;
}
bool SetupICU() {
if (GetSize() == 0) {
return false;
}
UErrorCode err_code = U_ZERO_ERROR;
udata_setCommonData(GetMapping(), &err_code);
return (err_code == U_ZERO_ERROR);
}
const uint8_t* GetMapping() const {
return mapping_ ? mapping_->GetMapping() : nullptr;
}
size_t GetSize() const { return mapping_ ? mapping_->GetSize() : 0; }
bool IsValid() const { return valid_; }
private:
bool valid_;
std::unique_ptr<Mapping> mapping_;
FML_DISALLOW_COPY_AND_ASSIGN(ICUContext);
};
void InitializeICUOnce(const std::string& icu_data_path) {
static ICUContext* context = new ICUContext(icu_data_path);
FML_CHECK(context->IsValid())
<< "Must be able to initialize the ICU context. Tried: " << icu_data_path;
}
std::once_flag g_icu_init_flag;
void InitializeICU(const std::string& icu_data_path) {
std::call_once(g_icu_init_flag,
[&icu_data_path]() { InitializeICUOnce(icu_data_path); });
}
void InitializeICUFromMappingOnce(std::unique_ptr<Mapping> mapping) {
static ICUContext* context = new ICUContext(std::move(mapping));
FML_CHECK(context->IsValid())
<< "Unable to initialize the ICU context from a mapping.";
}
void InitializeICUFromMapping(std::unique_ptr<Mapping> mapping) {
std::call_once(g_icu_init_flag, [mapping = std::move(mapping)]() mutable {
InitializeICUFromMappingOnce(std::move(mapping));
});
}
} // namespace icu
} // namespace fml
| engine/fml/icu_util.cc/0 | {
"file_path": "engine/fml/icu_util.cc",
"repo_id": "engine",
"token_count": 1296
} | 222 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Provides a base class for reference-counted classes.
#ifndef FLUTTER_FML_MEMORY_REF_COUNTED_H_
#define FLUTTER_FML_MEMORY_REF_COUNTED_H_
#include "flutter/fml/macros.h"
#include "flutter/fml/memory/ref_counted_internal.h"
#include "flutter/fml/memory/ref_ptr.h"
namespace fml {
// A base class for (thread-safe) reference-counted classes. Use like:
//
// class Foo : public RefCountedThreadSafe<Foo> {
// ...
// };
//
// |~Foo()| *may* be made private (e.g., to avoid accidental deletion of objects
// while there are still references to them), |Foo| should friend
// |RefCountedThreadSafe<Foo>|; use |FML_FRIEND_REF_COUNTED_THREAD_SAFE()|
// for this:
//
// class Foo : public RefCountedThreadSafe<Foo> {
// ...
// private:
// FML_FRIEND_REF_COUNTED_THREAD_SAFE(Foo);
// ~Foo();
// ...
// };
//
// Similarly, |Foo(...)| may be made private. In this case, there should either
// be a static factory method performing the requisite adoption:
//
// class Foo : public RefCountedThreadSafe<Foo> {
// ...
// public:
// inline static RefPtr<Foo> Create() { return AdoptRef(new Foo()); }
// ...
// private:
// Foo();
// ...
// };
//
// Or, to allow |MakeRefCounted()| to be used, use
// |FML_FRIEND_MAKE_REF_COUNTED()|:
//
// class Foo : public RefCountedThreadSafe<Foo> {
// ...
// private:
// FML_FRIEND_MAKE_REF_COUNTED(Foo);
// Foo();
// Foo(const Bar& bar, bool maybe);
// ...
// };
//
// For now, we only have thread-safe reference counting, since that's all we
// need. It's easy enough to add thread-unsafe versions if necessary.
template <typename T>
class RefCountedThreadSafe : public internal::RefCountedThreadSafeBase {
public:
// Adds a reference to this object.
// Inherited from the internal superclass:
// void AddRef() const;
// Releases a reference to this object. This will destroy this object once the
// last reference is released.
void Release() const {
if (internal::RefCountedThreadSafeBase::Release()) {
delete static_cast<const T*>(this);
}
}
// Returns true if there is exactly one reference to this object. Use of this
// is subtle, and should usually be avoided. To assert that there is only one
// reference (typically held by the calling thread, possibly in a local
// variable), use |AssertHasOneRef()| instead. However, a use is:
//
// if (foo->HasOneRef()) {
// // Do something "fast", since |foo| is the only reference and no other
// // thread can get another reference.
// ...
// } else {
// // Do something slower, but still valid even if there were only one
// // reference.
// ...
// }
//
// Inherited from the internal superclass:
// bool HasOneRef();
// Asserts that there is exactly one reference to this object; does nothing in
// Release builds (when |NDEBUG| is defined).
// Inherited from the internal superclass:
// void AssertHasOneRef();
protected:
// Constructor. Note that the object is constructed with a reference count of
// 1, and then must be adopted (see |AdoptRef()| in ref_ptr.h).
RefCountedThreadSafe() {}
// Destructor. Note that this object should only be destroyed via |Release()|
// (see above), or something that calls |Release()| (see, e.g., |RefPtr<>| in
// ref_ptr.h).
~RefCountedThreadSafe() {}
private:
#ifndef NDEBUG
template <typename U>
friend RefPtr<U> AdoptRef(U*);
// Marks the initial reference (assumed on construction) as adopted. This is
// only required for Debug builds (when |NDEBUG| is not defined).
// TODO(vtl): Should this really be private? This makes manual ref-counting
// and also writing one's own ref pointer class impossible.
void Adopt() { internal::RefCountedThreadSafeBase::Adopt(); }
#endif
FML_DISALLOW_COPY_AND_ASSIGN(RefCountedThreadSafe);
};
// If you subclass |RefCountedThreadSafe| and want to keep your destructor
// private, use this. (See the example above |RefCountedThreadSafe|.)
#define FML_FRIEND_REF_COUNTED_THREAD_SAFE(T) \
friend class ::fml::RefCountedThreadSafe<T>
// If you want to keep your constructor(s) private and still want to use
// |MakeRefCounted<T>()|, use this. (See the example above
// |RefCountedThreadSafe|.)
#define FML_FRIEND_MAKE_REF_COUNTED(T) \
friend class ::fml::internal::MakeRefCountedHelper<T>
} // namespace fml
#endif // FLUTTER_FML_MEMORY_REF_COUNTED_H_
| engine/fml/memory/ref_counted.h/0 | {
"file_path": "engine/fml/memory/ref_counted.h",
"repo_id": "engine",
"token_count": 1563
} | 223 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#define FML_USED_ON_EMBEDDER
#include "flutter/fml/message_loop_impl.h"
#include <algorithm>
#include <vector>
#include "flutter/fml/build_config.h"
#include "flutter/fml/logging.h"
#if FML_OS_MACOSX
#include "flutter/fml/platform/darwin/message_loop_darwin.h"
#elif FML_OS_ANDROID
#include "flutter/fml/platform/android/message_loop_android.h"
#elif OS_FUCHSIA
#include "flutter/fml/platform/fuchsia/message_loop_fuchsia.h"
#elif FML_OS_LINUX
#include "flutter/fml/platform/linux/message_loop_linux.h"
#elif FML_OS_WIN
#include "flutter/fml/platform/win/message_loop_win.h"
#endif
namespace fml {
fml::RefPtr<MessageLoopImpl> MessageLoopImpl::Create() {
#if FML_OS_MACOSX
return fml::MakeRefCounted<MessageLoopDarwin>();
#elif FML_OS_ANDROID
return fml::MakeRefCounted<MessageLoopAndroid>();
#elif OS_FUCHSIA
return fml::MakeRefCounted<MessageLoopFuchsia>();
#elif FML_OS_LINUX
return fml::MakeRefCounted<MessageLoopLinux>();
#elif FML_OS_WIN
return fml::MakeRefCounted<MessageLoopWin>();
#else
return nullptr;
#endif
}
MessageLoopImpl::MessageLoopImpl()
: task_queue_(MessageLoopTaskQueues::GetInstance()),
queue_id_(task_queue_->CreateTaskQueue()),
terminated_(false) {
task_queue_->SetWakeable(queue_id_, this);
}
MessageLoopImpl::~MessageLoopImpl() {
task_queue_->Dispose(queue_id_);
}
void MessageLoopImpl::PostTask(const fml::closure& task,
fml::TimePoint target_time) {
FML_DCHECK(task != nullptr);
if (terminated_) {
// If the message loop has already been terminated, PostTask should destruct
// |task| synchronously within this function.
return;
}
task_queue_->RegisterTask(queue_id_, task, target_time);
}
void MessageLoopImpl::AddTaskObserver(intptr_t key,
const fml::closure& callback) {
FML_DCHECK(callback != nullptr);
FML_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this)
<< "Message loop task observer must be added on the same thread as the "
"loop.";
if (callback != nullptr) {
task_queue_->AddTaskObserver(queue_id_, key, callback);
} else {
FML_LOG(ERROR) << "Tried to add a null TaskObserver.";
}
}
void MessageLoopImpl::RemoveTaskObserver(intptr_t key) {
FML_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this)
<< "Message loop task observer must be removed from the same thread as "
"the loop.";
task_queue_->RemoveTaskObserver(queue_id_, key);
}
void MessageLoopImpl::DoRun() {
if (terminated_) {
// Message loops may be run only once.
return;
}
// Allow the implementation to do its thing.
Run();
// The loop may have been implicitly terminated. This can happen if the
// implementation supports termination via platform specific APIs or just
// error conditions. Set the terminated flag manually.
terminated_ = true;
// The message loop is shutting down. Check if there are expired tasks. This
// is the last chance for expired tasks to be serviced. Make sure the
// terminated flag is already set so we don't accrue additional tasks now.
RunExpiredTasksNow();
// When the message loop is in the process of shutting down, pending tasks
// should be destructed on the message loop's thread. We have just returned
// from the implementations |Run| method which we know is on the correct
// thread. Drop all pending tasks on the floor.
task_queue_->DisposeTasks(queue_id_);
}
void MessageLoopImpl::DoTerminate() {
terminated_ = true;
Terminate();
}
void MessageLoopImpl::FlushTasks(FlushType type) {
const auto now = fml::TimePoint::Now();
fml::closure invocation;
do {
invocation = task_queue_->GetNextTaskToRun(queue_id_, now);
if (!invocation) {
break;
}
invocation();
std::vector<fml::closure> observers =
task_queue_->GetObserversToNotify(queue_id_);
for (const auto& observer : observers) {
observer();
}
if (type == FlushType::kSingle) {
break;
}
} while (invocation);
}
void MessageLoopImpl::RunExpiredTasksNow() {
FlushTasks(FlushType::kAll);
}
void MessageLoopImpl::RunSingleExpiredTaskNow() {
FlushTasks(FlushType::kSingle);
}
TaskQueueId MessageLoopImpl::GetTaskQueueId() const {
return queue_id_;
}
} // namespace fml
| engine/fml/message_loop_impl.cc/0 | {
"file_path": "engine/fml/message_loop_impl.cc",
"repo_id": "engine",
"token_count": 1582
} | 224 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/fml/platform/android/jni_weak_ref.h"
#include "flutter/fml/logging.h"
#include "flutter/fml/platform/android/jni_util.h"
namespace fml {
namespace jni {
JavaObjectWeakGlobalRef::JavaObjectWeakGlobalRef() : obj_(NULL) {}
JavaObjectWeakGlobalRef::JavaObjectWeakGlobalRef(
const JavaObjectWeakGlobalRef& orig)
: obj_(NULL) {
Assign(orig);
}
JavaObjectWeakGlobalRef::JavaObjectWeakGlobalRef(JNIEnv* env, jobject obj)
: obj_(env->NewWeakGlobalRef(obj)) {
FML_DCHECK(obj_);
}
JavaObjectWeakGlobalRef::~JavaObjectWeakGlobalRef() {
reset();
}
void JavaObjectWeakGlobalRef::operator=(const JavaObjectWeakGlobalRef& rhs) {
Assign(rhs);
}
void JavaObjectWeakGlobalRef::reset() {
if (obj_) {
AttachCurrentThread()->DeleteWeakGlobalRef(obj_);
obj_ = NULL;
}
}
ScopedJavaLocalRef<jobject> JavaObjectWeakGlobalRef::get(JNIEnv* env) const {
return GetRealObject(env, obj_);
}
ScopedJavaLocalRef<jobject> GetRealObject(JNIEnv* env, jweak obj) {
jobject real = NULL;
if (obj) {
real = env->NewLocalRef(obj);
if (!real) {
FML_DLOG(ERROR) << "The real object has been deleted!";
}
}
return ScopedJavaLocalRef<jobject>(env, real);
}
void JavaObjectWeakGlobalRef::Assign(const JavaObjectWeakGlobalRef& other) {
if (&other == this) {
return;
}
JNIEnv* env = AttachCurrentThread();
if (obj_) {
env->DeleteWeakGlobalRef(obj_);
}
obj_ = other.obj_ ? env->NewWeakGlobalRef(other.obj_) : NULL;
}
} // namespace jni
} // namespace fml
| engine/fml/platform/android/jni_weak_ref.cc/0 | {
"file_path": "engine/fml/platform/android/jni_weak_ref.cc",
"repo_id": "engine",
"token_count": 615
} | 225 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/fml/message_loop.h"
#include "flutter/fml/platform/darwin/scoped_nsobject.h"
#include "flutter/fml/platform/darwin/weak_nsobject.h"
#include "flutter/fml/task_runner.h"
#include "flutter/fml/thread.h"
#include "gtest/gtest.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace fml {
namespace {
TEST(WeakNSObjectTestARC, WeakNSObject) {
scoped_nsobject<NSObject> p1;
WeakNSObject<NSObject> w1;
@autoreleasepool {
p1.reset(([[NSObject alloc] init]));
WeakNSObjectFactory factory(p1.get());
w1 = factory.GetWeakNSObject();
EXPECT_TRUE(w1);
p1.reset();
}
EXPECT_FALSE(w1);
}
TEST(WeakNSObjectTestARC, MultipleWeakNSObject) {
scoped_nsobject<NSObject> p1;
WeakNSObject<NSObject> w1;
WeakNSObject<NSObject> w2;
@autoreleasepool {
p1.reset([[NSObject alloc] init]);
WeakNSObjectFactory factory(p1.get());
w1 = factory.GetWeakNSObject();
// NOLINTNEXTLINE(performance-unnecessary-copy-initialization)
w2 = w1;
EXPECT_TRUE(w1);
EXPECT_TRUE(w2);
EXPECT_TRUE(w1.get() == w2.get());
p1.reset();
}
EXPECT_FALSE(w1);
EXPECT_FALSE(w2);
}
TEST(WeakNSObjectTestARC, WeakNSObjectDies) {
scoped_nsobject<NSObject> p1([[NSObject alloc] init]);
WeakNSObjectFactory factory(p1.get());
{
WeakNSObject<NSObject> w1 = factory.GetWeakNSObject();
EXPECT_TRUE(w1);
}
}
TEST(WeakNSObjectTestARC, WeakNSObjectReset) {
scoped_nsobject<NSObject> p1([[NSObject alloc] init]);
WeakNSObjectFactory factory(p1.get());
WeakNSObject<NSObject> w1 = factory.GetWeakNSObject();
EXPECT_TRUE(w1);
w1.reset();
EXPECT_FALSE(w1);
EXPECT_TRUE(p1);
EXPECT_TRUE([p1 description]);
}
TEST(WeakNSObjectTestARC, WeakNSObjectEmpty) {
scoped_nsobject<NSObject> p1;
WeakNSObject<NSObject> w1;
@autoreleasepool {
scoped_nsobject<NSObject> p1([[NSObject alloc] init]);
EXPECT_FALSE(w1);
WeakNSObjectFactory factory(p1.get());
w1 = factory.GetWeakNSObject();
EXPECT_TRUE(w1);
p1.reset();
}
EXPECT_FALSE(w1);
}
TEST(WeakNSObjectTestARC, WeakNSObjectCopy) {
scoped_nsobject<NSObject> p1;
WeakNSObject<NSObject> w1;
WeakNSObject<NSObject> w2;
@autoreleasepool {
scoped_nsobject<NSObject> p1([[NSObject alloc] init]);
WeakNSObjectFactory factory(p1.get());
w1 = factory.GetWeakNSObject();
// NOLINTNEXTLINE(performance-unnecessary-copy-initialization)
w2 = w1;
EXPECT_TRUE(w1);
EXPECT_TRUE(w2);
p1.reset();
}
EXPECT_FALSE(w1);
EXPECT_FALSE(w2);
}
TEST(WeakNSObjectTestARC, WeakNSObjectAssignment) {
scoped_nsobject<NSObject> p1;
WeakNSObject<NSObject> w1;
WeakNSObject<NSObject> w2;
@autoreleasepool {
scoped_nsobject<NSObject> p1([[NSObject alloc] init]);
WeakNSObjectFactory factory(p1.get());
w1 = factory.GetWeakNSObject();
// NOLINTNEXTLINE(performance-unnecessary-copy-initialization)
w2 = w1;
EXPECT_TRUE(w1);
EXPECT_TRUE(w2);
p1.reset();
}
EXPECT_FALSE(w1);
EXPECT_FALSE(w2);
}
} // namespace
} // namespace fml
| engine/fml/platform/darwin/weak_nsobject_arc_unittests.mm/0 | {
"file_path": "engine/fml/platform/darwin/weak_nsobject_arc_unittests.mm",
"repo_id": "engine",
"token_count": 1383
} | 226 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FML_PLATFORM_LINUX_TIMERFD_H_
#define FLUTTER_FML_PLATFORM_LINUX_TIMERFD_H_
#include "flutter/fml/time/time_point.h"
// clang-format off
#if __has_include(<sys/timerfd.h>) && \
(!defined(__ANDROID_API__) || __ANDROID_API__ >= 19)
// sys/timerfd.h is always present in Android NDK due to unified headers,
// but timerfd functions are only available on API 19 or later.
// clang-format on
#include <sys/timerfd.h>
#define FML_TIMERFD_AVAILABLE 1
#else // __has_include(<sys/timerfd.h>)
#define FML_TIMERFD_AVAILABLE 0
#include <sys/types.h>
// Must come after sys/types
#include <linux/time.h>
#define TFD_TIMER_ABSTIME (1 << 0)
#define TFD_TIMER_CANCEL_ON_SET (1 << 1)
#define TFD_CLOEXEC O_CLOEXEC
#define TFD_NONBLOCK O_NONBLOCK
int timerfd_create(int clockid, int flags);
int timerfd_settime(int ufc,
int flags,
const struct itimerspec* utmr,
struct itimerspec* otmr);
#endif // __has_include(<sys/timerfd.h>)
namespace fml {
/// Rearms the timer to expire at the given time point.
bool TimerRearm(int fd, fml::TimePoint time_point);
/// Drains the timer FD and returns true if it has expired. This may be false in
/// case the timer read is non-blocking and this routine was called before the
/// timer expiry.
bool TimerDrain(int fd);
} // namespace fml
#endif // FLUTTER_FML_PLATFORM_LINUX_TIMERFD_H_
| engine/fml/platform/linux/timerfd.h/0 | {
"file_path": "engine/fml/platform/linux/timerfd.h",
"repo_id": "engine",
"token_count": 636
} | 227 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/fml/platform/win/message_loop_win.h"
#include <VersionHelpers.h>
#include <timeapi.h>
#include "flutter/fml/logging.h"
constexpr uint32_t kHighResolutionTimer = 1; // 1 ms
constexpr uint32_t kLowResolutionTimer = 15; // 15 ms
namespace fml {
MessageLoopWin::MessageLoopWin()
: timer_(CreateWaitableTimer(NULL, FALSE, NULL)) {
FML_CHECK(timer_.is_valid());
// Flutter uses timers to schedule frames. By default, Windows timers do
// not have the precision to reliably schedule frame rates greater than
// 60hz. We can increase the precision, but on versions of Windows before
// 10, this would globally increase timer precision leading to increased
// resource usage. This would be particularly problematic on a laptop or
// mobile device.
if (IsWindows10OrGreater()) {
timer_resolution_ = kHighResolutionTimer;
} else {
timer_resolution_ = kLowResolutionTimer;
}
timeBeginPeriod(timer_resolution_);
}
MessageLoopWin::~MessageLoopWin() = default;
void MessageLoopWin::Run() {
running_ = true;
while (running_) {
FML_CHECK(WaitForSingleObject(timer_.get(), INFINITE) == 0);
RunExpiredTasksNow();
}
}
void MessageLoopWin::Terminate() {
running_ = false;
WakeUp(fml::TimePoint::Now());
timeEndPeriod(timer_resolution_);
}
void MessageLoopWin::WakeUp(fml::TimePoint time_point) {
LARGE_INTEGER due_time = {0};
fml::TimePoint now = fml::TimePoint::Now();
if (time_point > now) {
due_time.QuadPart = (time_point - now).ToNanoseconds() / -100;
}
FML_CHECK(SetWaitableTimer(timer_.get(), &due_time, 0, NULL, NULL, FALSE));
}
} // namespace fml
| engine/fml/platform/win/message_loop_win.cc/0 | {
"file_path": "engine/fml/platform/win/message_loop_win.cc",
"repo_id": "engine",
"token_count": 590
} | 228 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FML_SIZE_H_
#define FLUTTER_FML_SIZE_H_
#include <cstddef>
namespace fml {
template <typename T, std::size_t N>
constexpr std::size_t size(T (&array)[N]) {
return N;
}
} // namespace fml
#endif // FLUTTER_FML_SIZE_H_
| engine/fml/size.h/0 | {
"file_path": "engine/fml/size.h",
"repo_id": "engine",
"token_count": 151
} | 229 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/fml/synchronization/sync_switch.h"
namespace fml {
SyncSwitch::Handlers& SyncSwitch::Handlers::SetIfTrue(
const std::function<void()>& handler) {
true_handler = handler;
return *this;
}
SyncSwitch::Handlers& SyncSwitch::Handlers::SetIfFalse(
const std::function<void()>& handler) {
false_handler = handler;
return *this;
}
SyncSwitch::SyncSwitch(bool value)
: mutex_(std::unique_ptr<fml::SharedMutex>(fml::SharedMutex::Create())),
value_(value) {}
void SyncSwitch::Execute(const SyncSwitch::Handlers& handlers) const {
fml::SharedLock lock(*mutex_);
if (value_) {
handlers.true_handler();
} else {
handlers.false_handler();
}
}
void SyncSwitch::SetSwitch(bool value) {
{
fml::UniqueLock lock(*mutex_);
value_ = value;
}
for (Observer* observer : observers_) {
observer->OnSyncSwitchUpdate(value);
}
}
void SyncSwitch::AddObserver(Observer* observer) const {
fml::UniqueLock lock(*mutex_);
if (std::find(observers_.begin(), observers_.end(), observer) ==
observers_.end()) {
observers_.push_back(observer);
}
}
void SyncSwitch::RemoveObserver(Observer* observer) const {
fml::UniqueLock lock(*mutex_);
observers_.erase(std::remove(observers_.begin(), observers_.end(), observer),
observers_.end());
}
} // namespace fml
| engine/fml/synchronization/sync_switch.cc/0 | {
"file_path": "engine/fml/synchronization/sync_switch.cc",
"repo_id": "engine",
"token_count": 532
} | 230 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/fml/time/chrono_timestamp_provider.h"
#include <chrono>
namespace fml {
ChronoTimestampProvider::ChronoTimestampProvider() = default;
ChronoTimestampProvider::~ChronoTimestampProvider() = default;
fml::TimePoint ChronoTimestampProvider::Now() {
const auto chrono_time_point = std::chrono::steady_clock::now();
const auto ticks_since_epoch = chrono_time_point.time_since_epoch().count();
return fml::TimePoint::FromTicks(ticks_since_epoch);
}
fml::TimePoint ChronoTicksSinceEpoch() {
return ChronoTimestampProvider::Instance().Now();
}
} // namespace fml
| engine/fml/time/chrono_timestamp_provider.cc/0 | {
"file_path": "engine/fml/time/chrono_timestamp_provider.cc",
"repo_id": "engine",
"token_count": 244
} | 231 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_IMPELLER_AIKS_CANVAS_H_
#define FLUTTER_IMPELLER_AIKS_CANVAS_H_
#include <deque>
#include <functional>
#include <memory>
#include <optional>
#include <vector>
#include "impeller/aiks/image.h"
#include "impeller/aiks/image_filter.h"
#include "impeller/aiks/paint.h"
#include "impeller/aiks/picture.h"
#include "impeller/core/sampler_descriptor.h"
#include "impeller/entity/entity.h"
#include "impeller/entity/entity_pass.h"
#include "impeller/entity/geometry/geometry.h"
#include "impeller/entity/geometry/vertices_geometry.h"
#include "impeller/geometry/matrix.h"
#include "impeller/geometry/path.h"
#include "impeller/geometry/point.h"
#include "impeller/geometry/vector.h"
#include "impeller/typographer/text_frame.h"
namespace impeller {
struct CanvasStackEntry {
Matrix transform;
// |cull_rect| is conservative screen-space bounds of the clipped output area
std::optional<Rect> cull_rect;
size_t clip_depth = 0u;
// The number of clips tracked for this canvas stack entry.
size_t num_clips = 0u;
Entity::RenderingMode rendering_mode = Entity::RenderingMode::kDirect;
};
enum class PointStyle {
/// @brief Points are drawn as squares.
kRound,
/// @brief Points are drawn as circles.
kSquare,
};
/// Controls the behavior of the source rectangle given to DrawImageRect.
enum class SourceRectConstraint {
/// @brief Faster, but may sample outside the bounds of the source rectangle.
kFast,
/// @brief Sample only within the source rectangle. May be slower.
kStrict,
};
class Canvas {
public:
struct DebugOptions {
/// When enabled, layers that are rendered to an offscreen texture
/// internally get a translucent checkerboard pattern painted over them.
///
/// Requires the `IMPELLER_DEBUG` preprocessor flag.
bool offscreen_texture_checkerboard = false;
} debug_options;
Canvas();
explicit Canvas(Rect cull_rect);
explicit Canvas(IRect cull_rect);
~Canvas();
void Save();
void SaveLayer(
const Paint& paint,
std::optional<Rect> bounds = std::nullopt,
const std::shared_ptr<ImageFilter>& backdrop_filter = nullptr,
ContentBoundsPromise bounds_promise = ContentBoundsPromise::kUnknown);
bool Restore();
size_t GetSaveCount() const;
void RestoreToCount(size_t count);
const Matrix& GetCurrentTransform() const;
const std::optional<Rect> GetCurrentLocalCullingBounds() const;
void ResetTransform();
void Transform(const Matrix& transform);
void Concat(const Matrix& transform);
void PreConcat(const Matrix& transform);
void Translate(const Vector3& offset);
void Scale(const Vector2& scale);
void Scale(const Vector3& scale);
void Skew(Scalar sx, Scalar sy);
void Rotate(Radians radians);
void DrawPath(const Path& path, const Paint& paint);
void DrawPaint(const Paint& paint);
void DrawLine(const Point& p0, const Point& p1, const Paint& paint);
void DrawRect(const Rect& rect, const Paint& paint);
void DrawOval(const Rect& rect, const Paint& paint);
void DrawRRect(const Rect& rect,
const Size& corner_radii,
const Paint& paint);
void DrawCircle(const Point& center, Scalar radius, const Paint& paint);
void DrawPoints(std::vector<Point> points,
Scalar radius,
const Paint& paint,
PointStyle point_style);
void DrawImage(const std::shared_ptr<Image>& image,
Point offset,
const Paint& paint,
SamplerDescriptor sampler = {});
void DrawImageRect(
const std::shared_ptr<Image>& image,
Rect source,
Rect dest,
const Paint& paint,
SamplerDescriptor sampler = {},
SourceRectConstraint src_rect_constraint = SourceRectConstraint::kFast);
void ClipPath(
const Path& path,
Entity::ClipOperation clip_op = Entity::ClipOperation::kIntersect);
void ClipRect(
const Rect& rect,
Entity::ClipOperation clip_op = Entity::ClipOperation::kIntersect);
void ClipOval(
const Rect& bounds,
Entity::ClipOperation clip_op = Entity::ClipOperation::kIntersect);
void ClipRRect(
const Rect& rect,
const Size& corner_radii,
Entity::ClipOperation clip_op = Entity::ClipOperation::kIntersect);
void DrawTextFrame(const std::shared_ptr<TextFrame>& text_frame,
Point position,
const Paint& paint);
void DrawVertices(const std::shared_ptr<VerticesGeometry>& vertices,
BlendMode blend_mode,
const Paint& paint);
void DrawAtlas(const std::shared_ptr<Image>& atlas,
std::vector<Matrix> transforms,
std::vector<Rect> texture_coordinates,
std::vector<Color> colors,
BlendMode blend_mode,
SamplerDescriptor sampler,
std::optional<Rect> cull_rect,
const Paint& paint);
Picture EndRecordingAsPicture();
private:
std::unique_ptr<EntityPass> base_pass_;
EntityPass* current_pass_ = nullptr;
uint64_t current_depth_ = 0u;
std::deque<CanvasStackEntry> transform_stack_;
std::optional<Rect> initial_cull_rect_;
void Initialize(std::optional<Rect> cull_rect);
void Reset();
EntityPass& GetCurrentPass();
size_t GetClipDepth() const;
void AddEntityToCurrentPass(Entity entity);
void ClipGeometry(const std::shared_ptr<Geometry>& geometry,
Entity::ClipOperation clip_op);
void IntersectCulling(Rect clip_bounds);
void SubtractCulling(Rect clip_bounds);
void Save(bool create_subpass,
BlendMode = BlendMode::kSourceOver,
const std::shared_ptr<ImageFilter>& backdrop_filter = nullptr);
void RestoreClip();
bool AttemptDrawBlurredRRect(const Rect& rect,
Size corner_radii,
const Paint& paint);
Canvas(const Canvas&) = delete;
Canvas& operator=(const Canvas&) = delete;
};
} // namespace impeller
#endif // FLUTTER_IMPELLER_AIKS_CANVAS_H_
| engine/impeller/aiks/canvas.h/0 | {
"file_path": "engine/impeller/aiks/canvas.h",
"repo_id": "engine",
"token_count": 2360
} | 232 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "impeller/aiks/paint_pass_delegate.h"
#include "impeller/core/formats.h"
#include "impeller/core/sampler_descriptor.h"
#include "impeller/entity/contents/contents.h"
#include "impeller/entity/contents/texture_contents.h"
#include "impeller/entity/entity_pass.h"
#include "impeller/geometry/color.h"
namespace impeller {
/// PaintPassDelegate
/// ----------------------------------------------
PaintPassDelegate::PaintPassDelegate(Paint paint) : paint_(std::move(paint)) {}
// |EntityPassDelgate|
PaintPassDelegate::~PaintPassDelegate() = default;
// |EntityPassDelgate|
bool PaintPassDelegate::CanElide() {
return paint_.blend_mode == BlendMode::kDestination;
}
// |EntityPassDelgate|
bool PaintPassDelegate::CanCollapseIntoParentPass(EntityPass* entity_pass) {
return false;
}
// |EntityPassDelgate|
std::shared_ptr<Contents> PaintPassDelegate::CreateContentsForSubpassTarget(
std::shared_ptr<Texture> target,
const Matrix& effect_transform) {
auto contents = TextureContents::MakeRect(Rect::MakeSize(target->GetSize()));
contents->SetTexture(target);
contents->SetLabel("Subpass");
contents->SetSourceRect(Rect::MakeSize(target->GetSize()));
contents->SetOpacity(paint_.color.alpha);
contents->SetDeferApplyingOpacity(true);
return paint_.WithFiltersForSubpassTarget(std::move(contents),
effect_transform);
}
// |EntityPassDelgate|
std::shared_ptr<FilterContents> PaintPassDelegate::WithImageFilter(
const FilterInput::Variant& input,
const Matrix& effect_transform) const {
return paint_.WithImageFilter(input, effect_transform,
Entity::RenderingMode::kSubpass);
}
/// OpacityPeepholePassDelegate
/// ----------------------------------------------
OpacityPeepholePassDelegate::OpacityPeepholePassDelegate(Paint paint)
: paint_(std::move(paint)) {}
// |EntityPassDelgate|
OpacityPeepholePassDelegate::~OpacityPeepholePassDelegate() = default;
// |EntityPassDelgate|
bool OpacityPeepholePassDelegate::CanElide() {
return paint_.blend_mode == BlendMode::kDestination;
}
// |EntityPassDelgate|
bool OpacityPeepholePassDelegate::CanCollapseIntoParentPass(
EntityPass* entity_pass) {
// Passes with enforced bounds that clip the contents can not be safely
// collapsed.
if (entity_pass->GetBoundsLimitMightClipContent()) {
return false;
}
// OpacityPeepholePassDelegate will only get used if the pass's blend mode is
// SourceOver, so no need to check here.
if (paint_.color.alpha <= 0.0 || paint_.color.alpha >= 1.0 ||
paint_.image_filter || paint_.color_filter) {
return false;
}
// Note: determing whether any coverage intersects has quadradic complexity in
// the number of rectangles, and depending on whether or not we cache at
// different levels of the entity tree may end up cubic. In the interest of
// proving whether or not this optimization is valuable, we only consider very
// simple peephole optimizations here - where there is a single drawing
// command wrapped in save layer. This would indicate something like an
// Opacity or FadeTransition wrapping a very simple widget, like in the
// CupertinoPicker.
if (entity_pass->GetElementCount() > 3) {
// Single paint command with a save layer would be:
// 1. clip
// 2. draw command
// 3. restore.
return false;
}
bool all_can_accept = true;
std::vector<Rect> all_coverages;
auto had_subpass = entity_pass->IterateUntilSubpass(
[&all_coverages, &all_can_accept](Entity& entity) {
const auto& contents = entity.GetContents();
if (!entity.CanInheritOpacity()) {
all_can_accept = false;
return false;
}
auto maybe_coverage = contents->GetCoverage(entity);
if (maybe_coverage.has_value()) {
auto coverage = maybe_coverage.value();
for (const auto& cv : all_coverages) {
if (cv.IntersectsWithRect(coverage)) {
all_can_accept = false;
return false;
}
}
all_coverages.push_back(coverage);
}
return true;
});
if (had_subpass || !all_can_accept) {
return false;
}
auto alpha = paint_.color.alpha;
entity_pass->IterateUntilSubpass([&alpha](Entity& entity) {
entity.SetInheritedOpacity(alpha);
return true;
});
return true;
}
// |EntityPassDelgate|
std::shared_ptr<Contents>
OpacityPeepholePassDelegate::CreateContentsForSubpassTarget(
std::shared_ptr<Texture> target,
const Matrix& effect_transform) {
auto contents = TextureContents::MakeRect(Rect::MakeSize(target->GetSize()));
contents->SetLabel("Subpass");
contents->SetTexture(target);
contents->SetSourceRect(Rect::MakeSize(target->GetSize()));
contents->SetOpacity(paint_.color.alpha);
contents->SetDeferApplyingOpacity(true);
return paint_.WithFiltersForSubpassTarget(std::move(contents),
effect_transform);
}
// |EntityPassDelgate|
std::shared_ptr<FilterContents> OpacityPeepholePassDelegate::WithImageFilter(
const FilterInput::Variant& input,
const Matrix& effect_transform) const {
return paint_.WithImageFilter(input, effect_transform,
Entity::RenderingMode::kSubpass);
}
} // namespace impeller
| engine/impeller/aiks/paint_pass_delegate.cc/0 | {
"file_path": "engine/impeller/aiks/paint_pass_delegate.cc",
"repo_id": "engine",
"token_count": 1957
} | 233 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_IMPELLER_BASE_BACKEND_CAST_H_
#define FLUTTER_IMPELLER_BASE_BACKEND_CAST_H_
namespace impeller {
template <class Sub, class Base>
class BackendCast {
public:
static Sub& Cast(Base& base) { return reinterpret_cast<Sub&>(base); }
static const Sub& Cast(const Base& base) {
return reinterpret_cast<const Sub&>(base);
}
static Sub* Cast(Base* base) { return reinterpret_cast<Sub*>(base); }
static const Sub* Cast(const Base* base) {
return reinterpret_cast<const Sub*>(base);
}
};
} // namespace impeller
#endif // FLUTTER_IMPELLER_BASE_BACKEND_CAST_H_
| engine/impeller/base/backend_cast.h/0 | {
"file_path": "engine/impeller/base/backend_cast.h",
"repo_id": "engine",
"token_count": 263
} | 234 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_IMPELLER_BASE_VALIDATION_H_
#define FLUTTER_IMPELLER_BASE_VALIDATION_H_
#include <sstream>
namespace impeller {
class ValidationLog {
public:
ValidationLog();
~ValidationLog();
std::ostream& GetStream();
private:
std::ostringstream stream_;
ValidationLog(const ValidationLog&) = delete;
ValidationLog(ValidationLog&&) = delete;
ValidationLog& operator=(const ValidationLog&) = delete;
ValidationLog& operator=(ValidationLog&&) = delete;
};
void ImpellerValidationBreak(const char* message);
void ImpellerValidationErrorsSetFatal(bool fatal);
bool ImpellerValidationErrorsAreFatal();
struct ScopedValidationDisable {
ScopedValidationDisable();
~ScopedValidationDisable();
ScopedValidationDisable(const ScopedValidationDisable&) = delete;
ScopedValidationDisable& operator=(const ScopedValidationDisable&) = delete;
};
struct ScopedValidationFatal {
ScopedValidationFatal();
~ScopedValidationFatal();
ScopedValidationFatal(const ScopedValidationFatal&) = delete;
ScopedValidationFatal& operator=(const ScopedValidationFatal&) = delete;
};
} // namespace impeller
//------------------------------------------------------------------------------
/// Get a stream to the log Impeller uses for all validation errors. The
/// behavior of these logs is as follows:
///
/// * Validation error are completely ignored in the Flutter release
/// runtime-mode.
/// * In non-release runtime-modes, validation logs are redirected to the
/// Flutter `INFO` log. These logs typically show up when verbose logging is
/// enabled.
/// * If `ImpellerValidationErrorsSetFatal` is set to `true`, validation logs
/// are fatal. The runtime-mode restriction still applies. This usually
/// happens in test environments.
///
#define VALIDATION_LOG ::impeller::ValidationLog{}.GetStream()
#endif // FLUTTER_IMPELLER_BASE_VALIDATION_H_
| engine/impeller/base/validation.h/0 | {
"file_path": "engine/impeller/base/validation.h",
"repo_id": "engine",
"token_count": 607
} | 235 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_IMPELLER_COMPILER_INCLUDE_DIR_H_
#define FLUTTER_IMPELLER_COMPILER_INCLUDE_DIR_H_
#include <memory>
#include <string>
#include "flutter/fml/unique_fd.h"
namespace impeller {
namespace compiler {
struct IncludeDir {
std::shared_ptr<fml::UniqueFD> dir;
std::string name;
};
} // namespace compiler
} // namespace impeller
#endif // FLUTTER_IMPELLER_COMPILER_INCLUDE_DIR_H_
| engine/impeller/compiler/include_dir.h/0 | {
"file_path": "engine/impeller/compiler/include_dir.h",
"repo_id": "engine",
"token_count": 210
} | 236 |
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
copy("impeller") {
sources = [
"blending.glsl",
"branching.glsl",
"color.glsl",
"constants.glsl",
"conversions.glsl",
"dithering.glsl",
"external_texture_oes.glsl",
"gaussian.glsl",
"gradient.glsl",
"path.glsl",
"texture.glsl",
"tile_mode.glsl",
"transform.glsl",
"types.glsl",
]
outputs = [ "$root_out_dir/shader_lib/impeller/{{source_file_part}}" ]
}
| engine/impeller/compiler/shader_lib/impeller/BUILD.gn/0 | {
"file_path": "engine/impeller/compiler/shader_lib/impeller/BUILD.gn",
"repo_id": "engine",
"token_count": 243
} | 237 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "impeller/compiler/source_options.h"
namespace impeller {
namespace compiler {
SourceOptions::SourceOptions() = default;
SourceOptions::SourceOptions(const std::string& file_name,
SourceType source_type)
: type(source_type == SourceType::kUnknown
? SourceTypeFromFileName(file_name)
: source_type),
file_name(file_name) {}
SourceOptions::~SourceOptions() = default;
} // namespace compiler
} // namespace impeller
| engine/impeller/compiler/source_options.cc/0 | {
"file_path": "engine/impeller/compiler/source_options.cc",
"repo_id": "engine",
"token_count": 237
} | 238 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.