<commit_before>// 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.

// @dart = 2.6
part of engine;

/// EXPERIMENTAL: Enable the Skia-based rendering backend.
const bool experimentalUseSkia =
    bool.fromEnvironment('FLUTTER_WEB_USE_SKIA', defaultValue: false);

/// The URL to use when downloading the CanvasKit script and associated wasm.
///
/// When CanvasKit pushes a new release to NPM, update this URL to reflect the
/// most recent version. For example, if CanvasKit releases version 0.34.0 to
/// NPM, update this URL to `https://unpkg.com/canvaskit-wasm@0.34.0/bin/`.
const String canvasKitBaseUrl = 'https://unpkg.com/canvaskit-wasm@0.15.0/bin/';

/// Initialize the Skia backend.
///
/// This calls `CanvasKitInit` and assigns the global [canvasKit] object.
Future<void> initializeSkia() {
  final Completer<void> canvasKitCompleter = Completer<void>();
  StreamSubscription<html.Event> loadSubscription;
  loadSubscription = domRenderer.canvasKitScript.onLoad.listen((_) {
    loadSubscription.cancel();
    final js.JsObject canvasKitInitArgs = js.JsObject.jsify(<String, dynamic>{
      'locateFile': (String file, String unusedBase) => canvasKitBaseUrl + file,
    });
    final js.JsObject canvasKitInit =
        js.JsObject(js.context['CanvasKitInit'], <dynamic>[canvasKitInitArgs]);
    final js.JsObject canvasKitInitPromise = canvasKitInit.callMethod('ready');
    canvasKitInitPromise.callMethod('then', <dynamic>[
      (js.JsObject ck) {
        canvasKit = ck;<commit_msg>Revert "Update CanvasKit to 0.15.0 (#18570)" (#18600)<commit_after>// 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.

// @dart = 2.6
part of engine;

/// EXPERIMENTAL: Enable the Skia-based rendering backend.
const bool experimentalUseSkia =
    bool.fromEnvironment('FLUTTER_WEB_USE_SKIA', defaultValue: false);

/// The URL to use when downloading the CanvasKit script and associated wasm.
///
/// When CanvasKit pushes a new release to NPM, update this URL to reflect the
/// most recent version. For example, if CanvasKit releases version 0.34.0 to
/// NPM, update this URL to `https://unpkg.com/canvaskit-wasm@0.34.0/bin/`.
const String canvasKitBaseUrl = 'https://unpkg.com/canvaskit-wasm@0.14.0/bin/';

/// Initialize the Skia backend.
///
/// This calls `CanvasKitInit` and assigns the global [canvasKit] object.
Future<void> initializeSkia() {
  final Completer<void> canvasKitCompleter = Completer<void>();
  StreamSubscription<html.Event> loadSubscription;
  loadSubscription = domRenderer.canvasKitScript.onLoad.listen((_) {
    loadSubscription.cancel();
    final js.JsObject canvasKitInitArgs = js.JsObject.jsify(<String, dynamic>{
      'locateFile': (String file, String unusedBase) => canvasKitBaseUrl + file,
    });
    final js.JsObject canvasKitInit =
        js.JsObject(js.context['CanvasKitInit'], <dynamic>[canvasKitInitArgs]);
    final js.JsObject canvasKitInitPromise = canvasKitInit.callMethod('ready');
    canvasKitInitPromise.callMethod('then', <dynamic>[
      (js.JsObject ck) {
        canvasKit = ck;
{'fraction_non_alphanumeric': 0.11894543225015328, 'fraction_numerical': 0.015328019619865114, 'mean_word_length': 4.05891472868217, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2765178', 'n_tokens_mistral': 1018, 'n_tokens_neox': 983, 'n_words': 291}