This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@staticInterop | |
import 'dart:js_interop'; | |
@JS() | |
@staticInterop | |
class Element {} | |
@JS() | |
@staticInterop | |
class Canvas extends Element {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
import 'dart:math' as math; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(Example()); | |
} | |
class Example extends StatefulWidget { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// @brief A storage only class for half precision 4x4 matrix. | |
struct HalfMatrix { | |
union { | |
Half m[16]; | |
Half e[4][4]; | |
HalfVector4 vec[4]; | |
}; | |
constexpr HalfMatrix(const Matrix& m) | |
: vec{Vector4(m.m[0], m.m[1], m.m[2], m.m[3]), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct FragInfo | |
{ | |
vec2 start_point; | |
vec2 end_point; | |
float tile_mode; | |
float texture_sampler_y_coord_scale; | |
float alpha; | |
vec2 half_texel; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <metal_stdlib> | |
#include <simd/simd.h> | |
using namespace metal; | |
struct FragInfo | |
{ | |
float2 start_point; | |
float2 end_point; | |
float tile_mode; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'dart:ui' as ui; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/services.dart'; | |
Future<ui.Image> loadImageFromAsset(String assetName) async { | |
if (kIsWeb) { | |
WidgetsFlutterBinding.ensureInitialized(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/packages/flutter_tools/lib/src/asset.dart b/packages/flutter_tools/lib/src/asset.dart | |
index 81dd56d75e..bea3526d4d 100644 | |
--- a/packages/flutter_tools/lib/src/asset.dart | |
+++ b/packages/flutter_tools/lib/src/asset.dart | |
@@ -413,8 +413,7 @@ class ManifestAssetBundle implements AssetBundle { | |
// For all platforms, include the shaders unconditionally. They are | |
// small, and whether they're used is determined only by the app source | |
// code and not by the Flutter manifest. | |
- if (targetPlatform != TargetPlatform.web_javascript) | |
- ..._getMaterialShaders(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:ui' as ui show window; | |
import 'package:flutter/material.dart'; | |
void main() { | |
final binding = WidgetsFlutterBinding.ensureInitialized(); | |
ui.window.onPointerDataPacket = null; | |
var root = MediaQuery.fromWindow( | |
child: Directionality( | |
textDirection: TextDirection.ltr, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/web_ui/lib/src/engine/canvaskit/painting.dart b/lib/web_ui/lib/src/engine/canvaskit/painting.dart | |
index 8cd9fc1ab8..3f7e536ac4 100644 | |
--- a/lib/web_ui/lib/src/engine/canvaskit/painting.dart | |
+++ b/lib/web_ui/lib/src/engine/canvaskit/painting.dart | |
@@ -423,11 +423,12 @@ class CkFragmentProgram implements ui.FragmentProgram { | |
if (type == UniformType.SampledImage) { | |
textureCount += 1; | |
} else { | |
+ final Object? rows = rawUniformData['rows']; | |
final Object? bitWidth = rawUniformData['bit_width']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/packages/flutter_tools/lib/src/asset.dart b/packages/flutter_tools/lib/src/asset.dart | |
index ea0104f8ef..44e5110df1 100644 | |
--- a/packages/flutter_tools/lib/src/asset.dart | |
+++ b/packages/flutter_tools/lib/src/asset.dart | |
@@ -412,8 +412,7 @@ class ManifestAssetBundle implements AssetBundle { | |
// For all platforms, include the shaders unconditionally. They are | |
// small, and whether they're used is determined only by the app source | |
// code and not by the Flutter manifest. | |
- if (targetPlatform != TargetPlatform.web_javascript) | |
- ..._getMaterialShaders(), |